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 1S9fxH-00018n-UJ for garchives@archives.gentoo.org; Mon, 19 Mar 2012 17:01:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C2D07E0B81; Mon, 19 Mar 2012 17:00:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 8FF06E0B81 for ; Mon, 19 Mar 2012 17:00:56 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F35AE1B400D for ; Mon, 19 Mar 2012 17:00:55 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id B9D3BE5403 for ; Mon, 19 Mar 2012 17:00:54 +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: <1332176438.3ca5f0cc08d233a3e229e78b573c7aab7d46cb9c.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/package/ebuild/doebuild.py X-VCS-Directories: pym/portage/package/ebuild/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 3ca5f0cc08d233a3e229e78b573c7aab7d46cb9c X-VCS-Branch: master Date: Mon, 19 Mar 2012 17:00:54 +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: fb4747e3-01af-4584-be83-e8e5a7027afa X-Archives-Hash: d21c87de0ae87e1f13d7682644d903ad commit: 3ca5f0cc08d233a3e229e78b573c7aab7d46cb9c Author: Zac Medico gentoo org> AuthorDate: Mon Mar 19 17:00:38 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon Mar 19 17:00:38 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D3ca5f0cc doebuild_environment: sanity check for bug 408817 Ensure that CATEGORY is determined correctly, and raise AssertionError if it can't be determined. --- pym/portage/package/ebuild/doebuild.py | 20 ++++++++++++-------- 1 files changed, 12 insertions(+), 8 deletions(-) diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package= /ebuild/doebuild.py index 31ecf8c..56de554 100644 --- a/pym/portage/package/ebuild/doebuild.py +++ b/pym/portage/package/ebuild/doebuild.py @@ -174,20 +174,24 @@ def doebuild_environment(myebuild, mydo, myroot=3DN= one, settings=3DNone, ebuild_path =3D os.path.abspath(myebuild) pkg_dir =3D os.path.dirname(ebuild_path) mytree =3D os.path.dirname(os.path.dirname(pkg_dir)) - - if "CATEGORY" in mysettings.configdict["pkg"]: - cat =3D mysettings.configdict["pkg"]["CATEGORY"] - else: - cat =3D os.path.basename(normalize_path(os.path.join(pkg_dir, ".."))) - mypv =3D os.path.basename(ebuild_path)[:-7] - - mycpv =3D cat+"/"+mypv mysplit =3D _pkgsplit(mypv) if mysplit is None: raise IncorrectParameter( _("Invalid ebuild path: '%s'") % myebuild) =20 + if mysettings.mycpv is not None and \ + mysettings.configdict["pkg"].get("PF") =3D=3D mypv and \ + "CATEGORY" in mysettings.configdict["pkg"]: + cat =3D mysettings.configdict["pkg"]["CATEGORY"] + mycpv =3D mysettings.mycpv + elif os.path.basename(pkg_dir) in (mysplit[0], mypv): + # portdbapi or vardbapi + cat =3D os.path.basename(os.path.dirname(pkg_dir)) + mycpv =3D cat + "/" + mypv + else: + raise AssertionError("unable to determine CATEGORY") + # Make a backup of PORTAGE_TMPDIR prior to calling config.reset() # so that the caller can override it. tmpdir =3D mysettings["PORTAGE_TMPDIR"]