1 |
Bug: https://bugs.gentoo.org/373349 |
2 |
Bug: https://bugs.gentoo.org/373351 |
3 |
--- |
4 |
bin/eapi.sh | 4 ++++ |
5 |
bin/phase-functions.sh | 6 ++++-- |
6 |
pym/portage/eapi.py | 11 +++++++++++ |
7 |
pym/portage/package/ebuild/doebuild.py | 14 ++++++++++---- |
8 |
4 files changed, 29 insertions(+), 6 deletions(-) |
9 |
|
10 |
diff --git a/bin/eapi.sh b/bin/eapi.sh |
11 |
index 3e837f19d..9fa96548b 100644 |
12 |
--- a/bin/eapi.sh |
13 |
+++ b/bin/eapi.sh |
14 |
@@ -38,6 +38,10 @@ ___eapi_has_RDEPEND_DEPEND_fallback() { |
15 |
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3)$ ]] |
16 |
} |
17 |
|
18 |
+___eapi_has_PORTDIR_ECLASSDIR() { |
19 |
+ [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]] |
20 |
+} |
21 |
+ |
22 |
# HELPERS PRESENCE |
23 |
|
24 |
___eapi_has_dohard() { |
25 |
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh |
26 |
index d95012d6b..017dc132b 100644 |
27 |
--- a/bin/phase-functions.sh |
28 |
+++ b/bin/phase-functions.sh |
29 |
@@ -12,7 +12,7 @@ PORTAGE_READONLY_METADATA="DEFINED_PHASES DEPEND DESCRIPTION |
30 |
PDEPEND PROVIDE RDEPEND REPOSITORY RESTRICT SLOT SRC_URI" |
31 |
|
32 |
PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \ |
33 |
- EBUILD_SH_ARGS ECLASSDIR EMERGE_FROM FILESDIR MERGE_TYPE \ |
34 |
+ EBUILD_SH_ARGS EMERGE_FROM FILESDIR MERGE_TYPE \ |
35 |
PM_EBUILD_HOOK_DIR \ |
36 |
PORTAGE_ACTUAL_DISTDIR PORTAGE_ARCHLIST PORTAGE_BASHRC \ |
37 |
PORTAGE_BINPKG_FILE PORTAGE_BINPKG_TAR_OPTS PORTAGE_BINPKG_TMPFILE \ |
38 |
@@ -30,7 +30,6 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \ |
39 |
PORTAGE_SAVED_READONLY_VARS PORTAGE_SIGPIPE_STATUS \ |
40 |
PORTAGE_TMPDIR PORTAGE_UPDATE_ENV PORTAGE_USERNAME \ |
41 |
PORTAGE_VERBOSE PORTAGE_WORKDIR_MODE PORTAGE_XATTR_EXCLUDE \ |
42 |
- PORTDIR \ |
43 |
REPLACING_VERSIONS REPLACED_BY_VERSION T WORKDIR \ |
44 |
__PORTAGE_HELPER __PORTAGE_TEST_HARDLINK_LOCKS" |
45 |
|
46 |
@@ -106,6 +105,9 @@ __filter_readonly_variables() { |
47 |
if ___eapi_has_prefix_variables; then |
48 |
filtered_vars+=" ED EPREFIX EROOT" |
49 |
fi |
50 |
+ if ___eapi_has_PORTDIR_ECLASSDIR; then |
51 |
+ filtered_vars+=" PORTDIR ECLASSDIR" |
52 |
+ fi |
53 |
|
54 |
if has --filter-sandbox $* ; then |
55 |
filtered_vars="${filtered_vars} SANDBOX_.*" |
56 |
diff --git a/pym/portage/eapi.py b/pym/portage/eapi.py |
57 |
index 092780ded..5613fb5d2 100644 |
58 |
--- a/pym/portage/eapi.py |
59 |
+++ b/pym/portage/eapi.py |
60 |
@@ -47,6 +47,14 @@ def eapi_exports_replace_vars(eapi): |
61 |
def eapi_exports_EBUILD_PHASE_FUNC(eapi): |
62 |
return eapi not in ("0", "1", "2", "3", "4", "4-python", "4-slot-abi") |
63 |
|
64 |
+def eapi_exports_PORTDIR(eapi): |
65 |
+ return eapi in ("0", "1", "2", "3", "4", "4-python", "4-slot-abi", |
66 |
+ "5", "5-progress", "6") |
67 |
+ |
68 |
+def eapi_exports_ECLASSDIR(eapi): |
69 |
+ return eapi in ("0", "1", "2", "3", "4", "4-python", "4-slot-abi", |
70 |
+ "5", "5-progress", "6") |
71 |
+ |
72 |
def eapi_exports_REPOSITORY(eapi): |
73 |
return eapi in ("4-python", "5-progress") |
74 |
|
75 |
@@ -105,6 +113,7 @@ def eapi_empty_groups_always_true(eapi): |
76 |
|
77 |
_eapi_attrs = collections.namedtuple('_eapi_attrs', |
78 |
'dots_in_PN dots_in_use_flags exports_EBUILD_PHASE_FUNC ' |
79 |
+ 'exports_PORTDIR exports_ECLASSDIR ' |
80 |
'feature_flag_test feature_flag_targetroot ' |
81 |
'hdepend iuse_defaults iuse_effective posixish_locale ' |
82 |
'repo_deps required_use required_use_at_most_one_of slot_operator slot_deps ' |
83 |
@@ -134,6 +143,8 @@ def _get_eapi_attrs(eapi): |
84 |
dots_in_use_flags = (eapi is None or eapi_allows_dots_in_use_flags(eapi)), |
85 |
empty_groups_always_true = (eapi is not None and eapi_empty_groups_always_true(eapi)), |
86 |
exports_EBUILD_PHASE_FUNC = (eapi is None or eapi_exports_EBUILD_PHASE_FUNC(eapi)), |
87 |
+ exports_PORTDIR = (eapi is not None and eapi_exports_PORTDIR(eapi)), |
88 |
+ exports_ECLASSDIR = (eapi is not None and eapi_exports_ECLASSDIR(eapi)), |
89 |
feature_flag_test = True, |
90 |
feature_flag_targetroot = (eapi is not None and eapi_has_targetroot(eapi)), |
91 |
hdepend = (eapi is not None and eapi_has_hdepend(eapi)), |
92 |
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py |
93 |
index 8c8f373bf..92db04868 100644 |
94 |
--- a/pym/portage/package/ebuild/doebuild.py |
95 |
+++ b/pym/portage/package/ebuild/doebuild.py |
96 |
@@ -57,10 +57,11 @@ from portage.data import portage_gid, portage_uid, secpass, \ |
97 |
from portage.dbapi.porttree import _parse_uri_map |
98 |
from portage.dep import Atom, check_required_use, \ |
99 |
human_readable_required_use, paren_enclose, use_reduce |
100 |
-from portage.eapi import eapi_exports_KV, eapi_exports_merge_type, \ |
101 |
- eapi_exports_replace_vars, eapi_exports_REPOSITORY, \ |
102 |
- eapi_has_required_use, eapi_has_src_prepare_and_src_configure, \ |
103 |
- eapi_has_pkg_pretend, _get_eapi_attrs |
104 |
+from portage.eapi import (eapi_exports_KV, eapi_exports_merge_type, |
105 |
+ eapi_exports_replace_vars, eapi_exports_REPOSITORY, |
106 |
+ eapi_has_required_use, eapi_has_src_prepare_and_src_configure, |
107 |
+ eapi_has_pkg_pretend, _get_eapi_attrs, |
108 |
+ eapi_exports_PORTDIR, eapi_exports_ECLASSDIR) |
109 |
from portage.elog import elog_process, _preload_elog_modules |
110 |
from portage.elog.messages import eerror, eqawarn |
111 |
from portage.exception import (DigestException, FileNotFound, |
112 |
@@ -446,6 +447,11 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, |
113 |
if eapi_exports_REPOSITORY(eapi) and "PORTAGE_REPO_NAME" in mysettings.configdict["pkg"]: |
114 |
mysettings.configdict["pkg"]["REPOSITORY"] = mysettings.configdict["pkg"]["PORTAGE_REPO_NAME"] |
115 |
|
116 |
+ if not eapi_exports_PORTDIR(eapi): |
117 |
+ del mysettings["PORTDIR"] |
118 |
+ if not eapi_exports_ECLASSDIR(eapi): |
119 |
+ del mysettings["ECLASSDIR"] |
120 |
+ |
121 |
if mydo != "depend": |
122 |
if hasattr(mydbapi, "getFetchMap") and \ |
123 |
("A" not in mysettings.configdict["pkg"] or \ |
124 |
-- |
125 |
2.16.2 |