From: Peter Palfrader Date: Sun, 5 Apr 2009 23:35:26 +0000 (+0200) Subject: ud-gpgimport: work on add_keyrings if no keyrings are given on the command line X-Git-Tag: userdir-ldap-0.3.65~1 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=696f436ea7a32dd31d9361647d118403743c26ff ud-gpgimport: work on add_keyrings if no keyrings are given on the command line --- diff --git a/debian/changelog b/debian/changelog index 34d2406..b26f4bb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,10 @@ userdir-ldap (0.3.64) unstable; urgency=low * userdir-ldap.conf: add keyring.pgp to default add_keyrings. * userdir_gpg.py: add a ClearKeyrings(). + * ud-gpgimport: work on add_keyrings if no keyrings are given on the + command line. - -- Peter Palfrader Mon, 06 Apr 2009 01:34:39 +0200 + -- Peter Palfrader Mon, 06 Apr 2009 01:35:12 +0200 userdir-ldap (0.3.63) unstable; urgency=low diff --git a/ud-gpgimport b/ud-gpgimport index 0ad4fc9..31fb347 100755 --- a/ud-gpgimport +++ b/ud-gpgimport @@ -62,9 +62,7 @@ for (switch, val) in options: LoadOverride(val); elif (switch == '-a'): NoAct = 0; -if len(arguments) == 0: - print "Give some keyrings to probe"; - sys.exit(0); + # Main program starts here @@ -105,14 +103,16 @@ Attrs = None; print; # Popen GPG with the correct magic special options -Args = [GPGPath] + GPGBasicOptions; +ClearKeyrings() +if len(arguments) == 0: + print "Using default keyrings: %s"%ConfModule.add_keyrings; + SetKeyrings(ConfModule.add_keyrings.split(":")) for x in arguments: - Args.append("--keyring"); if x.find("/") == -1: - Args.append("./"+x); - else: - Args.append(x); -Args = Args + GPGSearchOptions + [" 2> /dev/null"] + x= "./"+x + SetKeyrings( [x] ) + +Args = [GPGPath] + GPGBasicOptions + GPGKeyRings + GPGSearchOptions + [" 2> /dev/null"] Keys = os.popen(" ".join(Args),"r"); # Loop over the GPG key file