1 |
commit: 0d9ea2752aa7819e5b26b47920c09218d9f5b7c2 |
2 |
Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Gentoo <DOT> Org> |
3 |
AuthorDate: Sun Jan 8 06:19:06 2012 +0000 |
4 |
Commit: Arfrever Frehtes Taifersar Arahesis <arfrever <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 8 06:19:06 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0d9ea275 |
7 |
|
8 |
Set REPOSITORY variable in ebuild environment in EAPI="4-python". |
9 |
|
10 |
--- |
11 |
bin/phase-functions.sh | 4 ++-- |
12 |
pym/portage/eapi.py | 5 ++++- |
13 |
.../package/ebuild/_config/special_env_vars.py | 6 +++--- |
14 |
pym/portage/package/ebuild/doebuild.py | 11 ++++++++--- |
15 |
4 files changed, 17 insertions(+), 9 deletions(-) |
16 |
|
17 |
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh |
18 |
index 2167853..ce251ce 100644 |
19 |
--- a/bin/phase-functions.sh |
20 |
+++ b/bin/phase-functions.sh |
21 |
@@ -1,5 +1,5 @@ |
22 |
#!/bin/bash |
23 |
-# Copyright 1999-2011 Gentoo Foundation |
24 |
+# Copyright 1999-2012 Gentoo Foundation |
25 |
# Distributed under the terms of the GNU General Public License v2 |
26 |
|
27 |
# Hardcoded bash lists are needed for backward compatibility with |
28 |
@@ -9,7 +9,7 @@ |
29 |
|
30 |
PORTAGE_READONLY_METADATA="DEFINED_PHASES DEPEND DESCRIPTION |
31 |
EAPI HOMEPAGE INHERITED IUSE REQUIRED_USE KEYWORDS LICENSE |
32 |
- PDEPEND PROVIDE RDEPEND RESTRICT SLOT SRC_URI" |
33 |
+ PDEPEND PROVIDE RDEPEND REPOSITORY RESTRICT SLOT SRC_URI" |
34 |
|
35 |
PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE \ |
36 |
EBUILD_SH_ARGS ECLASSDIR EMERGE_FROM FILESDIR MERGE_TYPE \ |
37 |
|
38 |
diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py |
39 |
index da5fd8c..65c99c7 100644 |
40 |
--- a/pym/portage/eapi.py |
41 |
+++ b/pym/portage/eapi.py |
42 |
@@ -1,4 +1,4 @@ |
43 |
-# Copyright 2010 Gentoo Foundation |
44 |
+# Copyright 2010-2012 Gentoo Foundation |
45 |
# Distributed under the terms of the GNU General Public License v2 |
46 |
|
47 |
def eapi_has_iuse_defaults(eapi): |
48 |
@@ -34,6 +34,9 @@ def eapi_exports_merge_type(eapi): |
49 |
def eapi_exports_replace_vars(eapi): |
50 |
return eapi not in ("0", "1", "2", "3") |
51 |
|
52 |
+def eapi_exports_REPOSITORY(eapi): |
53 |
+ return eapi in ("4-python",) |
54 |
+ |
55 |
def eapi_has_pkg_pretend(eapi): |
56 |
return eapi not in ("0", "1", "2", "3") |
57 |
|
58 |
|
59 |
diff --git a/pym/portage/package/ebuild/_config/special_env_vars.py b/pym/portage/package/ebuild/_config/special_env_vars.py |
60 |
index c1628f7..132f8eb 100644 |
61 |
--- a/pym/portage/package/ebuild/_config/special_env_vars.py |
62 |
+++ b/pym/portage/package/ebuild/_config/special_env_vars.py |
63 |
@@ -1,4 +1,4 @@ |
64 |
-# Copyright 2010-2011 Gentoo Foundation |
65 |
+# Copyright 2010-2012 Gentoo Foundation |
66 |
# Distributed under the terms of the GNU General Public License v2 |
67 |
|
68 |
__all__ = ( |
69 |
@@ -21,8 +21,8 @@ env_blacklist = frozenset(( |
70 |
"PORTAGE_BACKGROUND_UNMERGE", "PORTAGE_BUILDIR_LOCKED", |
71 |
"PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT", "PORTAGE_IUSE", |
72 |
"PORTAGE_NONFATAL", "PORTAGE_REPO_NAME", |
73 |
- "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "RESTRICT", |
74 |
- "ROOT", "SLOT", "SRC_URI" |
75 |
+ "PORTAGE_USE", "PROPERTIES", "PROVIDE", "RDEPEND", "REPOSITORY", |
76 |
+ "RESTRICT", "ROOT", "SLOT", "SRC_URI" |
77 |
)) |
78 |
|
79 |
environ_whitelist = [] |
80 |
|
81 |
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py |
82 |
index 3c0d023..cb7cc1c 100644 |
83 |
--- a/pym/portage/package/ebuild/doebuild.py |
84 |
+++ b/pym/portage/package/ebuild/doebuild.py |
85 |
@@ -1,4 +1,4 @@ |
86 |
-# Copyright 2010-2011 Gentoo Foundation |
87 |
+# Copyright 2010-2012 Gentoo Foundation |
88 |
# Distributed under the terms of the GNU General Public License v2 |
89 |
|
90 |
__all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild'] |
91 |
@@ -41,8 +41,9 @@ from portage.dbapi.porttree import _parse_uri_map |
92 |
from portage.dep import Atom, check_required_use, \ |
93 |
human_readable_required_use, paren_enclose, use_reduce |
94 |
from portage.eapi import eapi_exports_KV, eapi_exports_merge_type, \ |
95 |
- eapi_exports_replace_vars, eapi_has_required_use, \ |
96 |
- eapi_has_src_prepare_and_src_configure, eapi_has_pkg_pretend |
97 |
+ eapi_exports_replace_vars, eapi_exports_REPOSITORY, \ |
98 |
+ eapi_has_required_use, eapi_has_src_prepare_and_src_configure, \ |
99 |
+ eapi_has_pkg_pretend |
100 |
from portage.elog import elog_process, _preload_elog_modules |
101 |
from portage.elog.messages import eerror, eqawarn |
102 |
from portage.exception import DigestException, FileNotFound, \ |
103 |
@@ -243,6 +244,7 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, |
104 |
mysettings['PORTDIR'] = repo.eclass_db.porttrees[0] |
105 |
mysettings['PORTDIR_OVERLAY'] = ' '.join(repo.eclass_db.porttrees[1:]) |
106 |
mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"] = repo.name |
107 |
+ mysettings.configdict["pkg"]["REPOSITORY"] = repo.name |
108 |
|
109 |
mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"]) |
110 |
mysettings["DISTDIR"] = os.path.realpath(mysettings["DISTDIR"]) |
111 |
@@ -412,6 +414,9 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, |
112 |
mysettings["KV"] = "" |
113 |
mysettings.backup_changes("KV") |
114 |
|
115 |
+ if mydo != "depend" and not eapi_exports_REPOSITORY(eapi): |
116 |
+ mysettings.pop('REPOSITORY', None) |
117 |
+ |
118 |
_doebuild_manifest_cache = None |
119 |
_doebuild_broken_ebuilds = set() |
120 |
_doebuild_broken_manifests = set() |