From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QABos-0003xb-Bv for garchives@archives.gentoo.org; Thu, 14 Apr 2011 01:58:06 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3CD121C002; Thu, 14 Apr 2011 01:57:59 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E7D651C002 for ; Thu, 14 Apr 2011 01:57:58 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 63DF01B4001 for ; Thu, 14 Apr 2011 01:57:58 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B671E80065 for ; Thu, 14 Apr 2011 01:57:57 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <81035828fb9abdee32c881ffa17cc92117e2966b.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:2.1.9 commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/repoman X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 81035828fb9abdee32c881ffa17cc92117e2966b Date: Thu, 14 Apr 2011 01:57:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 57055bf78b6dbec61f045e48283931e6 commit: 81035828fb9abdee32c881ffa17cc92117e2966b Author: Zac Medico gentoo org> AuthorDate: Thu Apr 14 01:54:30 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Thu Apr 14 01:57:14 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D81035828 repoman: cleanup gpgsign --- bin/repoman | 35 +++++++++++++++++++++++------------ 1 files changed, 23 insertions(+), 12 deletions(-) diff --git a/bin/repoman b/bin/repoman index 56c4bf7..d6c26d6 100755 --- a/bin/repoman +++ b/bin/repoman @@ -66,7 +66,8 @@ import portage.checksum import portage.const from portage import cvstree, normalize_path from portage import util -from portage.exception import FileNotFound, ParseError, PermissionDenied +from portage.exception import (FileNotFound, MissingParameter, + ParseError, PermissionDenied) from portage.manifest import Manifest from portage.process import find_binary, spawn from portage.output import bold, create_color_func, \ @@ -2418,22 +2419,32 @@ else: =20 # Setup the GPG commands def gpgsign(filename): - if "PORTAGE_GPG_KEY" not in repoman_settings and "${PORTAGE_GPG_KEY}" = in repoman_settings["PORTAGE_GPG_SIGNING_COMMAND"]: - raise portage.exception.MissingParameter("PORTAGE_GPG_KEY is unset!") - if "PORTAGE_GPG_DIR" not in repoman_settings and "${PORTAGE_GPG_DIR}" = in repoman_settings["PORTAGE_GPG_SIGNING_COMMAND"]: - repoman_settings["PORTAGE_GPG_DIR"] =3D os.path.expanduser("~/.gnupg"= ) - logging.info("Automatically setting PORTAGE_GPG_DIR to '%s'" % repoma= n_settings["PORTAGE_GPG_DIR"]) - if "${PORTAGE_GPG_DIR}" in repoman_settings["PORTAGE_GPG_SIGNING_COMMA= ND"]: - repoman_settings["PORTAGE_GPG_DIR"] =3D os.path.expanduser(repoman_se= ttings["PORTAGE_GPG_DIR"]) + gpgcmd =3D repoman_settings.get("PORTAGE_GPG_SIGNING_COMMAND") + if gpgcmd is None: + raise MissingParameter("PORTAGE_GPG_SIGNING_COMMAND is unset!" + \ + " Is make.globals missing?") + if "${PORTAGE_GPG_KEY}" in gpgcmd and \ + "PORTAGE_GPG_KEY" not in repoman_settings: + raise MissingParameter("PORTAGE_GPG_KEY is unset!") + if "${PORTAGE_GPG_DIR}" in gpgcmd: + if "PORTAGE_GPG_DIR" not in repoman_settings: + repoman_settings["PORTAGE_GPG_DIR"] =3D \ + os.path.expanduser("~/.gnupg") + logging.info("Automatically setting PORTAGE_GPG_DIR to '%s'" \ + % repoman_settings["PORTAGE_GPG_DIR"]) + else: + repoman_settings["PORTAGE_GPG_DIR"] =3D \ + 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=3D'%s'" % \ repoman_settings["PORTAGE_GPG_DIR"]) gpgvars =3D {"FILE": filename} - for var in ("PORTAGE_GPG_DIR", "PORTAGE_GPG_KEY"): - if "${%s}" % var in repoman_settings["PORTAGE_GPG_SIGNING_COMMAND"]: - gpgvars[var] =3D repoman_settings[var] - gpgcmd =3D portage.util.varexpand(repoman_settings["PORTAGE_GPG_SIGNIN= G_COMMAND"], mydict=3Dgpgvars) + for k in ("PORTAGE_GPG_DIR", "PORTAGE_GPG_KEY"): + v =3D repoman_settings.get(k) + if v is not None: + gpgvars[k] =3D v + gpgcmd =3D portage.util.varexpand(gpgcmd, mydict=3Dgpgvars) if options.pretend: print("("+gpgcmd+")") else: