From: Mark Hymers Date: Wed, 27 Jul 2011 14:18:09 +0000 (+0100) Subject: Remove use of GPGKeyring and use database X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e817e83aa60af8ebe5dda25d276b5d1ab8661e13;p=dak Remove use of GPGKeyring and use database Signed-off-by: Mark Hymers --- diff --git a/dak/add_user.py b/dak/add_user.py index f087849c..f2391bd6 100755 --- a/dak/add_user.py +++ b/dak/add_user.py @@ -22,7 +22,7 @@ import sys import apt_pkg from daklib import utils -from daklib.dbconn import DBConn, get_or_set_uid +from daklib.dbconn import DBConn, get_or_set_uid, get_active_keyring_paths from daklib.regexes import re_gpg_fingerprint_colon, re_user_address, re_user_mails, re_user_name ################################################################################ @@ -124,7 +124,7 @@ def main(): session = DBConn().session() if not keyrings: - keyrings = Cnf.ValueList("Dinstall::GPGKeyring") + keyrings = get_active_keyring_paths() cmd = "gpg --with-colons --no-secmem-warning --no-auto-check-trustdb --no-default-keyring %s --with-fingerprint --list-key %s" \ % (utils.gpg_keyring_args(keyrings), diff --git a/daklib/utils.py b/daklib/utils.py index 413bcb6d..133500c6 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -39,7 +39,10 @@ import re import email as modemail import subprocess -from dbconn import DBConn, get_architecture, get_component, get_suite, get_override_type, Keyring, session_wrapper +from dbconn import DBConn, get_architecture, get_component, get_suite, \ + get_override_type, Keyring, session_wrapper, \ + get_active_keyring_paths, get_primary_keyring_path +from sqlalchemy import desc from dak_exceptions import * from gpg import SignedFile from textutils import fix_maintainer @@ -1250,7 +1253,7 @@ def retrieve_key (filename, keyserver=None, keyring=None): if not keyserver: keyserver = Cnf["Dinstall::KeyServer"] if not keyring: - keyring = Cnf.ValueList("Dinstall::GPGKeyring")[0] + keyring = get_primary_keyring_path() # Ensure the filename contains no shell meta-characters or other badness if not re_taint_free.match(filename): @@ -1287,7 +1290,7 @@ def retrieve_key (filename, keyserver=None, keyring=None): def gpg_keyring_args(keyrings=None): if not keyrings: - keyrings = Cnf.ValueList("Dinstall::GPGKeyring") + keyrings = get_active_keyring_paths() return " ".join(["--keyring %s" % x for x in keyrings])