Set REPOSITORY variable in ebuild environment in EAPI="4-python".
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Sun, 8 Jan 2012 06:19:06 +0000 (07:19 +0100)
committerArfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org>
Sun, 8 Jan 2012 06:19:06 +0000 (07:19 +0100)
bin/phase-functions.sh
pym/portage/eapi.py
pym/portage/package/ebuild/_config/special_env_vars.py
pym/portage/package/ebuild/doebuild.py

index 2167853dc202bead09309158491c40c6eaed8eac..ce251ceb987a555387037d22f3edf1beb0278683 100644 (file)
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Hardcoded bash lists are needed for backward compatibility with
@@ -9,7 +9,7 @@
 
 PORTAGE_READONLY_METADATA="DEFINED_PHASES DEPEND DESCRIPTION
        EAPI HOMEPAGE INHERITED IUSE REQUIRED_USE KEYWORDS LICENSE
-       PDEPEND PROVIDE RDEPEND RESTRICT SLOT SRC_URI"
+       PDEPEND PROVIDE RDEPEND REPOSITORY RESTRICT SLOT SRC_URI"
 
 PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE \
        EBUILD_SH_ARGS ECLASSDIR EMERGE_FROM FILESDIR MERGE_TYPE \
index da5fd8c2713192cf8610285e49845f3f8c6e551b..65c99c7e57dd7508013a8a1ac75b3b9eeb7ff7b5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 def eapi_has_iuse_defaults(eapi):
@@ -34,6 +34,9 @@ def eapi_exports_merge_type(eapi):
 def eapi_exports_replace_vars(eapi):
        return eapi not in ("0", "1", "2", "3")
 
+def eapi_exports_REPOSITORY(eapi):
+       return eapi in ("4-python",)
+
 def eapi_has_pkg_pretend(eapi):
        return eapi not in ("0", "1", "2", "3")
 
index c1628f77341ee5e679503b6ba2a73b294fe99f69..132f8ebd863e23c79ebbdde4938d92706e18c9d1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = (
@@ -21,8 +21,8 @@ env_blacklist = frozenset((
        "PORTAGE_BACKGROUND_UNMERGE", "PORTAGE_BUILDIR_LOCKED",
        "PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT", "PORTAGE_IUSE",
        "PORTAGE_NONFATAL", "PORTAGE_REPO_NAME",
-       "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "RESTRICT",
-       "ROOT", "SLOT", "SRC_URI"
+       "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "REPOSITORY",
+       "RESTRICT", "ROOT", "SLOT", "SRC_URI"
 ))
 
 environ_whitelist = []
index 3c0d023d417d714b9f075db378d4ad11f55159b4..cb7cc1cb3f8672b0334dd227b3ed436dcc5a831c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
@@ -41,8 +41,9 @@ from portage.dbapi.porttree import _parse_uri_map
 from portage.dep import Atom, check_required_use, \
        human_readable_required_use, paren_enclose, use_reduce
 from portage.eapi import eapi_exports_KV, eapi_exports_merge_type, \
-       eapi_exports_replace_vars, eapi_has_required_use, \
-       eapi_has_src_prepare_and_src_configure, eapi_has_pkg_pretend
+       eapi_exports_replace_vars, eapi_exports_REPOSITORY, \
+       eapi_has_required_use, eapi_has_src_prepare_and_src_configure, \
+       eapi_has_pkg_pretend
 from portage.elog import elog_process, _preload_elog_modules
 from portage.elog.messages import eerror, eqawarn
 from portage.exception import DigestException, FileNotFound, \
@@ -243,6 +244,7 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
                mysettings['PORTDIR'] = repo.eclass_db.porttrees[0]
                mysettings['PORTDIR_OVERLAY'] = ' '.join(repo.eclass_db.porttrees[1:])
                mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"] = repo.name
+               mysettings.configdict["pkg"]["REPOSITORY"] = repo.name
 
        mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"])
        mysettings["DISTDIR"] = os.path.realpath(mysettings["DISTDIR"])
@@ -412,6 +414,9 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
                        mysettings["KV"] = ""
                mysettings.backup_changes("KV")
 
+       if mydo != "depend" and not eapi_exports_REPOSITORY(eapi):
+               mysettings.pop('REPOSITORY', None)
+
 _doebuild_manifest_cache = None
 _doebuild_broken_ebuilds = set()
 _doebuild_broken_manifests = set()