Simplify calculation of repoman_settings["PORTAGE_GPG_DIR"] in gpgsign().
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Wed, 30 Mar 2011 20:32:45 +0000 (22:32 +0200)
committerZac Medico <zmedico@gentoo.org>
Wed, 13 Apr 2011 07:40:39 +0000 (00:40 -0700)
os.path.expanduser() works even when HOME environment variable is not set.

bin/repoman

index 86eba81e4433090ef2f23b94ef9fb7a62b347320..0a480a5cce163283de2373986224756b2482cdcb 100755 (executable)
@@ -2421,11 +2421,8 @@ else:
                if "PORTAGE_GPG_KEY" not in repoman_settings:
                        raise portage.exception.MissingParameter("PORTAGE_GPG_KEY is unset!")
                if "PORTAGE_GPG_DIR" not in repoman_settings:
-                       if "HOME" in os.environ:
-                               repoman_settings["PORTAGE_GPG_DIR"] = os.path.join(os.environ["HOME"], ".gnupg")
-                               logging.info("Automatically setting PORTAGE_GPG_DIR to %s" % repoman_settings["PORTAGE_GPG_DIR"])
-                       else:
-                               raise portage.exception.MissingParameter("PORTAGE_GPG_DIR is unset!")
+                       repoman_settings["PORTAGE_GPG_DIR"] = os.path.expanduser("~/.gnupg")
+                       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(