]> git.decadent.org.uk Git - dak.git/commitdiff
Remove use of GPGKeyring and use database
authorMark Hymers <mhy@debian.org>
Wed, 27 Jul 2011 14:18:09 +0000 (15:18 +0100)
committerMark Hymers <mhy@debian.org>
Wed, 27 Jul 2011 14:18:09 +0000 (15:18 +0100)
Signed-off-by: Mark Hymers <mhy@debian.org>
dak/add_user.py
daklib/utils.py

index f087849c8bd507653af2c7af8c357bc1fc767bb8..f2391bd65acf59cf64a9613b4c5fbeb111dbb060 100755 (executable)
@@ -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),
index 413bcb6dcc79b51f245ee87a151216953c28713b..133500c66fc90883a6be95c6b535fbb6302fee78 100755 (executable)
@@ -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])