From 1242127976118dbf4c73a9132db3481d72906c86 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Wed, 25 May 2011 18:53:13 +0000 Subject: [PATCH] do not check for a valid signature in parse_deb822, parse_changes 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 | 11 ++++------- tests/test_parse_changes.py | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/daklib/utils.py b/daklib/utils.py index a9909c66..c1d78e3c 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -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: diff --git a/tests/test_parse_changes.py b/tests/test_parse_changes.py index 86291cc4..85a76948 100755 --- a/tests/test_parse_changes.py +++ b/tests/test_parse_changes.py @@ -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: -- 2.39.5