3
0
mirror of https://git.launchpad.net/ubuntu-dev-tools synced 2025-03-26 10:21:09 +00:00

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

@ -89,6 +89,10 @@ def main():
parser.add_option('--no-conf', parser.add_option('--no-conf',
dest='no_conf', default=False, action='store_true', dest='no_conf', default=False, action='store_true',
help="Don't read config files or environment variables") 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() (options, args) = parser.parse_args()
if not args: if not args:
parser.error('Must specify package name') parser.error('Must specify package name')

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