From 439baf280a7b927ce190c5f6fdc698731db37dfb Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Wed, 30 Mar 2011 22:32:45 +0200 Subject: [PATCH] Simplify calculation of repoman_settings["PORTAGE_GPG_DIR"] in gpgsign(). os.path.expanduser() works even when HOME environment variable is not set. --- bin/repoman | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/repoman b/bin/repoman index 86eba81e4..0a480a5cc 100755 --- a/bin/repoman +++ b/bin/repoman @@ -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( -- 2.26.2