X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Futils.py;h=82dd4ca26889f9f79b206aa1cfddcbcb9b52b9ef;hb=bd07a0ed5414ac3a7303d6b2d10338bf3ce28ecc;hp=0b2d8c87eca2bfbcc5933b603159ffffc0d568b8;hpb=40970b8f6af57da3b1a65237e7bc6af7ba77ec73;p=dak.git diff --git a/daklib/utils.py b/daklib/utils.py index 0b2d8c87..82dd4ca2 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -39,7 +39,7 @@ import re import email as modemail import subprocess -from dbconn import DBConn, get_architecture, get_component, get_suite, get_override_type +from dbconn import DBConn, get_architecture, get_component, get_suite, get_override_type, Keyring, session_wrapper from dak_exceptions import * from textutils import fix_maintainer from regexes import re_html_escaping, html_escaping, re_single_line_field, \ @@ -1307,8 +1307,8 @@ def gpg_keyring_args(keyrings=None): return " ".join(["--keyring %s" % x for x in keyrings]) ################################################################################ - -def check_signature (sig_filename, data_filename="", keyrings=None, autofetch=None): +@session_wrapper +def check_signature (sig_filename, data_filename="", keyrings=None, autofetch=None, session=None): """ Check the signature of a file and return the fingerprint if the signature is valid or 'None' if it's not. The first argument is the @@ -1336,7 +1336,7 @@ def check_signature (sig_filename, data_filename="", keyrings=None, autofetch=No return (None, rejects) if not keyrings: - keyrings = Cnf.ValueList("Dinstall::GPGKeyring") + keyrings = [ x.keyring_name for x in session.query(Keyring).filter(Keyring.active == True).all() ] # Autofetch the signing key if that's enabled if autofetch == None: