Minor improvements in gpgsign().
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Wed, 30 Mar 2011 22:19:54 +0000 (00:19 +0200)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Wed, 30 Mar 2011 22:19:54 +0000 (00:19 +0200)
repoman_settings["PORTAGE_GPG_DIR"] is always set.

bin/repoman

index 985b8ea48aba5f9889c83192989df689da1d2b53..8f363722d6e2cef8d5374f58d8a728dc9f81cf90 100755 (executable)
@@ -2423,16 +2423,15 @@ else:
                        raise portage.exception.MissingParameter("PORTAGE_GPG_KEY is unset!")
                if "PORTAGE_GPG_DIR" not in repoman_settings:
                        repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser("~/.gnupg")
-                       logging.info("Automatically setting PORTAGE_GPG_DIR to %s" % repoman_settings["PORTAGE_GPG_DIR"])
+                       logging.info("Automatically setting PORTAGE_GPG_DIR to '%s'" % repoman_settings["PORTAGE_GPG_DIR"])
                repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser(repoman_settings["PORTAGE_GPG_DIR"])
                if not os.access(repoman_settings["PORTAGE_GPG_DIR"], os.X_OK):
                        raise portage.exception.InvalidLocation(
                                "Unable to access directory: PORTAGE_GPG_DIR='%s'" % \
                                repoman_settings["PORTAGE_GPG_DIR"])
-               gpgcmd = "gpg --sign --clearsign --yes "
-               gpgcmd+= "--default-key "+repoman_settings["PORTAGE_GPG_KEY"]
-               if "PORTAGE_GPG_DIR" in repoman_settings:
-                       gpgcmd += " --homedir "+repoman_settings["PORTAGE_GPG_DIR"]
+               gpgcmd = "gpg --sign --clearsign --yes"
+               gpgcmd += " --default-key " + repoman_settings["PORTAGE_GPG_KEY"]
+               gpgcmd += " --homedir " + repoman_settings["PORTAGE_GPG_DIR"]
                if options.pretend:
                        print("("+gpgcmd+" "+filename+")")
                else: