From 5960003fc970480bd48b0cc1c0f8b5ed80af7dac Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 3 Sep 2014 09:16:56 +0200 Subject: read all tags from a dsc file and improve tests --- apt/debfile.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'apt') diff --git a/apt/debfile.py b/apt/debfile.py index 5c6de3c7..2528fd8a 100644 --- a/apt/debfile.py +++ b/apt/debfile.py @@ -718,6 +718,11 @@ class DscSrcPackage(DebPackage): tagfile = apt_pkg.TagFile(fobj) try: for sec in tagfile: + # we only care about the stanza with the "Format:" tag, the + # rest is gpg signature noise. we should probably have + # bindings for apts OpenMaybeClearsignedFile() + if not "Format" in sec: + continue for tag in depends_tags: if tag not in sec: continue @@ -730,14 +735,9 @@ class DscSrcPackage(DebPackage): self.pkgname = sec['Source'] if 'Binary' in sec: self.binaries = sec['Binary'].split(', ') - # read some more tags - for tag in ('Version', 'Files', 'Checksum-Sha1'): + for tag in sec.keys(): if tag in sec: self._sections[tag] = sec[tag] - # we only care about the stanza with the "Format:" tag, the - # rest is gpg signature noise - if 'Format' in sec: - break finally: del tagfile fobj.close() -- cgit v1.2.3