X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-gpgimport;h=9730ca41fce9c3bfd12a9ade2460fd57d55d3a7e;hb=0b086a5406ec0ccae9c660050af7c9f343cf89e6;hp=0ad4fc9d6d9a082106a9ecce4a07d2e25e392229;hpb=595923978a9ad55f4ec55b1aabef44683b111911;p=mirror%2Fuserdir-ldap.git diff --git a/ud-gpgimport b/ud-gpgimport index 0ad4fc9..9730ca4 100755 --- a/ud-gpgimport +++ b/ud-gpgimport @@ -3,6 +3,7 @@ # Copyright (c) 1999-2000 Jason Gunthorpe # Copyright (c) 2004 Joey Schulze +# Copyright (c) 2008, 2009 Peter Palfrader # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -62,9 +63,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 +104,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