]> err.no Git - dak/commitdiff
do not check for a valid signature in parse_deb822, parse_changes
authorAnsgar Burchardt <ansgar@debian.org>
Wed, 25 May 2011 18:53:13 +0000 (18:53 +0000)
committerAnsgar Burchardt <ansgar@debian.org>
Wed, 25 May 2011 18:55:41 +0000 (18:55 +0000)
Not all files need to have a valid signature: old .dsc's can be signed
by a key no longer in the keyrings.

daklib/utils.py
tests/test_parse_changes.py

index a9909c66004ec2748321e8b74857237c15c5c43f..c1d78e3ce08d28a1e4e49ff3764180d78d2d018f 100755 (executable)
@@ -152,12 +152,10 @@ def extract_component_from_section(section):
 
 ################################################################################
 
-@session_wrapper
 def parse_deb822(armored_contents, signing_rules=0, keyrings=None, session=None):
-    if keyrings == None:
-        keyrings = [ k.keyring_name for k in session.query(Keyring).filter(Keyring.active == True).all() ]
     require_signature = True
-    if signing_rules == -1:
+    if keyrings == None:
+        keyrings = []
         require_signature = False
 
     signed_file = SignedFile(armored_contents, keyrings=keyrings, require_signature=require_signature)
@@ -227,8 +225,7 @@ def parse_deb822(armored_contents, signing_rules=0, keyrings=None, session=None)
 
 ################################################################################
 
-@session_wrapper
-def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None, session=None):
+def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None):
     """
     Parses a changes file and returns a dictionary where each field is a
     key.  The mandatory first argument is the filename of the .changes
@@ -257,7 +254,7 @@ def parse_changes(filename, signing_rules=0, dsc_file=0, keyrings=None, session=
         unicode(content, 'utf-8')
     except UnicodeError:
         raise ChangesUnicodeError, "Changes file not proper utf-8"
-    changes = parse_deb822(content, signing_rules, keyrings=keyrings, session=session)
+    changes = parse_deb822(content, signing_rules, keyrings=keyrings)
 
 
     if not dsc_file:
index 86291cc4d2a080b5ed7ab6439c33b0abf112e741..85a76948d193c5f4a8f4615eb71aa1fdc011236f 100755 (executable)
@@ -10,7 +10,7 @@ from daklib.dak_exceptions import InvalidDscError, ParseChangesError
 
 class ParseChangesTestCase(DakTestCase):
     def assertParse(self, filename, *args):
-        return parse_changes(fixture(filename), *args, keyrings=())
+        return parse_changes(fixture(filename), *args)
 
     def assertFails(self, filename, line=None, *args):
         try: