aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2012-05-24 14:29:52 +0200
committerGuido Günther <agx@sigxcpu.org>2012-05-24 14:51:30 +0200
commita5f0d875d7779b2001fda0f436a4710dfa9a5d77 (patch)
tree15070b2cc54b9a013e4bf419946c89fc6d001a37
parent24e8455e29db5dddcb3d03f206183e4654546352 (diff)
import_dsc: add --allow-unauthenticated
Closes: #670623
-rw-r--r--docs/manpages/git-import-dsc.sgml8
-rw-r--r--gbp/config.py3
-rw-r--r--gbp/scripts/import_dsc.py30
3 files changed, 28 insertions, 13 deletions
diff --git a/docs/manpages/git-import-dsc.sgml b/docs/manpages/git-import-dsc.sgml
index d25d9a5a..fd049797 100644
--- a/docs/manpages/git-import-dsc.sgml
+++ b/docs/manpages/git-import-dsc.sgml
@@ -41,6 +41,7 @@
<arg><option>options</option></arg>
<arg choice="req"><option>--download</option></arg>
+ <arg><option>--[no-]allow-unauthenticated</option></arg>
<group choice="plain">
<arg><replaceable>URL</replaceable></arg>
<arg><replaceable>source-package</replaceable></arg>
@@ -140,6 +141,13 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--allow-unauthenticated</option>
+ </term>
+ <listitem>
+ <para>Whether to skip signature verification on downloads.</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--allow-same-version</option>
</term>
<listitem>
diff --git a/gbp/config.py b/gbp/config.py
index 40424444..52453e9e 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -128,6 +128,7 @@ class GbpOptionParser(OptionParser):
'pbuilder-options': '',
'template-dir': '',
'remote-config': '',
+ 'allow-unauthenticated': 'False',
}
help = {
'debian-branch':
@@ -217,6 +218,8 @@ class GbpOptionParser(OptionParser):
"Template directory used by git init, default is '%(template-dir)s'",
'remote-config':
"Remote defintion in gbp.conf used to create the remote repository",
+ 'allow-unauthenticated':
+ "Don't verify integrity of downloaded source",
}
def_config_files = [ '/etc/git-buildpackage/gbp.conf',
diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py
index ca4031d5..879b537a 100644
--- a/gbp/scripts/import_dsc.py
+++ b/gbp/scripts/import_dsc.py
@@ -41,22 +41,22 @@ class SkipImport(Exception):
pass
-def download_source(pkg, dirs):
+def download_source(pkg, dirs, unauth):
+ opts = [ '--download-only' ]
+ if unauth:
+ opts.append('--allow-unauthenticated')
+
if re.match(r'[a-z]{1,5}://', pkg):
- mode='dget'
+ cmd = 'dget'
+ opts += ['-q', pkg]
else:
- mode='apt-get'
+ cmd = 'apt-get'
+ opts += ['-qq', 'source', pkg]
dirs['download'] = os.path.abspath(tempfile.mkdtemp())
- gbp.log.info("Downloading '%s' using '%s'..." % (pkg, mode))
- if mode == 'apt-get':
- gbpc.RunAtCommand('apt-get',
- ['-qq', '--download-only', 'source', pkg],
- shell=False)(dir=dirs['download'])
- else:
- gbpc.RunAtCommand('dget',
- ['-q', '--download-only', pkg],
- shell=False)(dir=dirs['download'])
+ gbp.log.info("Downloading '%s' using '%s'..." % (pkg, cmd))
+
+ gbpc.RunAtCommand(cmd, opts, shell=False)(dir=dirs['download'])
dsc = glob.glob(os.path.join(dirs['download'], '*.dsc'))[0]
return dsc
@@ -229,6 +229,8 @@ def parse_args(argv):
dest="author_committer")
import_group.add_boolean_config_file_option(option_name="author-date-is-committer-date",
dest="author_committer_date")
+ import_group.add_boolean_config_file_option(option_name="allow-unauthenticated",
+ dest="allow_unauthenticated")
(options, args) = parser.parse_args(argv[1:])
gbp.log.setup(options.color, options.verbose)
@@ -251,7 +253,9 @@ def main(argv):
else:
pkg = args[0]
if options.download:
- dsc = download_source(pkg, dirs=dirs)
+ dsc = download_source(pkg,
+ dirs=dirs,
+ unauth=options.allow_unauthenticated)
else:
dsc = pkg