pull-debian-source: --no-verify-signature option

Using pull-debian-source fails on some very old packages such as on
texinfo 4.8.dfsg.1-4. I have hand-verified that the signature is good
(though with no trust path), so presumably this is because the signature
has rotated out of debian-keyring.

Add a --no-verify-signature option so that developers can still make use
of the find-and-download functionality of this tool, albeit without
signture verification.
This commit is contained in:
Robie Basak 2017-06-30 15:44:52 +01:00
parent 15841a3df6
commit 4c66fba4d9
2 changed files with 10 additions and 6 deletions

View File

@ -89,6 +89,10 @@ def main():
parser.add_option('--no-conf',
dest='no_conf', default=False, action='store_true',
help="Don't read config files or environment variables")
parser.add_option('--no-verify-signature',
dest='verify_signature', default=True,
action='store_false',
help="Allow signature verification failure")
(options, args) = parser.parse_args()
if not args:
parser.error('Must specify package name')

View File

@ -303,10 +303,10 @@ class SourcePackage(object):
else:
Logger.info(message)
def _write_dsc(self):
def _write_dsc(self, verify_signature=True):
"Write dsc file to workdir"
if self._dsc is None:
self.pull_dsc()
self.pull_dsc(verify_signature=verify_signature)
with open(self.dsc_pathname, 'wb') as f:
f.write(self.dsc.raw_text)
@ -359,9 +359,9 @@ class SourcePackage(object):
return False
return True
def pull(self):
def pull(self, verify_signature=True):
"Pull into workdir"
self._write_dsc()
self._write_dsc(verify_signature=verify_signature)
for entry in self.dsc['Files']:
name = entry['name']
for url in self._source_urls(name):
@ -471,7 +471,7 @@ class DebianSourcePackage(SourcePackage):
if self.snapshot_list:
yield self._snapshot_url(name)
def pull_dsc(self):
def pull_dsc(self, verify_signature=True):
"Retrieve dscfile and parse"
try:
super(DebianSourcePackage, self).pull_dsc()
@ -489,7 +489,7 @@ class DebianSourcePackage(SourcePackage):
break
else:
raise DownloadError('dsc could not be found anywhere')
self._check_dsc(verify_signature=True)
self._check_dsc(verify_signature=verify_signature)
# Local methods:
@property