1 |
commit: 13f1a19ed3db9534e74d23254e41ef7c30c5b9fe |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 3 16:29:56 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 10 07:16:40 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=13f1a19e |
7 |
|
8 |
Include INHERIT value in generated cache |
9 |
|
10 |
PkgCore uses an additional md5-cache INHERIT key to indicate eclasses |
11 |
explicitly inherited in an ebuild. Update Portage to emit the same key |
12 |
to restore cache compatibility. |
13 |
|
14 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
15 |
|
16 |
bin/ebuild.sh | 8 +++++++- |
17 |
bin/phase-functions.sh | 2 +- |
18 |
lib/portage/__init__.py | 2 +- |
19 |
lib/portage/package/ebuild/_config/special_env_vars.py | 2 +- |
20 |
4 files changed, 10 insertions(+), 4 deletions(-) |
21 |
|
22 |
diff --git a/bin/ebuild.sh b/bin/ebuild.sh |
23 |
index 381bcb5c8..07ca58d22 100755 |
24 |
--- a/bin/ebuild.sh |
25 |
+++ b/bin/ebuild.sh |
26 |
@@ -402,6 +402,9 @@ inherit() { |
27 |
unset $__export_funcs_var |
28 |
|
29 |
has $1 $INHERITED || export INHERITED="$INHERITED $1" |
30 |
+ if [[ ${ECLASS_DEPTH} -eq 1 ]]; then |
31 |
+ export PORTAGE_EXPLICIT_INHERIT="${PORTAGE_EXPLICIT_INHERIT} $1" |
32 |
+ fi |
33 |
fi |
34 |
|
35 |
shift |
36 |
@@ -648,6 +651,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then |
37 |
unset INHERITED IUSE REQUIRED_USE ECLASS E_IUSE E_REQUIRED_USE |
38 |
unset E_DEPEND E_RDEPEND E_PDEPEND E_BDEPEND E_IDEPEND E_PROPERTIES |
39 |
unset E_RESTRICT PROVIDES_EXCLUDE REQUIRES_EXCLUDE |
40 |
+ unset PORTAGE_EXPLICIT_INHERIT |
41 |
|
42 |
if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then |
43 |
source "$EBUILD" || die "error sourcing ebuild" |
44 |
@@ -757,7 +761,7 @@ if [[ $EBUILD_PHASE = depend ]] ; then |
45 |
metadata_keys=( |
46 |
DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE |
47 |
DESCRIPTION KEYWORDS INHERITED IUSE REQUIRED_USE PDEPEND BDEPEND |
48 |
- EAPI PROPERTIES DEFINED_PHASES IDEPEND |
49 |
+ EAPI PROPERTIES DEFINED_PHASES IDEPEND INHERIT |
50 |
) |
51 |
|
52 |
if ! ___eapi_has_BDEPEND; then |
53 |
@@ -767,6 +771,8 @@ if [[ $EBUILD_PHASE = depend ]] ; then |
54 |
unset IDEPEND |
55 |
fi |
56 |
|
57 |
+ INHERIT=${PORTAGE_EXPLICIT_INHERIT} |
58 |
+ |
59 |
# The extra $(echo) commands remove newlines. |
60 |
for f in "${metadata_keys[@]}" ; do |
61 |
echo "${f}=$(echo ${!f})" >&${PORTAGE_PIPE_FD} || exit $? |
62 |
|
63 |
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh |
64 |
index 0bb5d86e1..d3221993d 100644 |
65 |
--- a/bin/phase-functions.sh |
66 |
+++ b/bin/phase-functions.sh |
67 |
@@ -20,7 +20,7 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \ |
68 |
PORTAGE_BUILD_USER PORTAGE_BUNZIP2_COMMAND \ |
69 |
PORTAGE_BZIP2_COMMAND PORTAGE_COLORMAP PORTAGE_CONFIGROOT \ |
70 |
PORTAGE_DEBUG PORTAGE_DEPCACHEDIR PORTAGE_EBUILD_EXIT_FILE \ |
71 |
- PORTAGE_ECLASS_LOCATIONS \ |
72 |
+ PORTAGE_ECLASS_LOCATIONS PORTAGE_EXPLICIT_INHERIT \ |
73 |
PORTAGE_GID PORTAGE_GRPNAME PORTAGE_INST_GID PORTAGE_INST_UID \ |
74 |
PORTAGE_INTERNAL_CALLER PORTAGE_IPC_DAEMON PORTAGE_IUSE PORTAGE_LOG_FILE \ |
75 |
PORTAGE_MUTABLE_FILTERED_VARS PORTAGE_OVERRIDE_EPREFIX PORTAGE_PROPERTIES \ |
76 |
|
77 |
diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py |
78 |
index 232d77f0e..a41ca4323 100644 |
79 |
--- a/lib/portage/__init__.py |
80 |
+++ b/lib/portage/__init__.py |
81 |
@@ -519,7 +519,7 @@ auxdbkeys = ( |
82 |
'RESTRICT', 'HOMEPAGE', 'LICENSE', 'DESCRIPTION', |
83 |
'KEYWORDS', 'INHERITED', 'IUSE', 'REQUIRED_USE', |
84 |
'PDEPEND', 'BDEPEND', 'EAPI', |
85 |
- 'PROPERTIES', 'DEFINED_PHASES', 'IDEPEND', |
86 |
+ 'PROPERTIES', 'DEFINED_PHASES', 'IDEPEND', 'INHERIT', |
87 |
) |
88 |
|
89 |
def portageexit(): |
90 |
|
91 |
diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py b/lib/portage/package/ebuild/_config/special_env_vars.py |
92 |
index 456af1838..8e314a6d6 100644 |
93 |
--- a/lib/portage/package/ebuild/_config/special_env_vars.py |
94 |
+++ b/lib/portage/package/ebuild/_config/special_env_vars.py |
95 |
@@ -22,7 +22,7 @@ env_blacklist = frozenset(( |
96 |
"KEYWORDS", "LICENSE", "MERGE_TYPE", |
97 |
"PDEPEND", "PF", "PKGUSE", "PORTAGE_BACKGROUND", |
98 |
"PORTAGE_BACKGROUND_UNMERGE", "PORTAGE_BUILDDIR_LOCKED", |
99 |
- "PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT", |
100 |
+ "PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT", "PORTAGE_EXPLICIT_INHERIT", |
101 |
"PORTAGE_INTERNAL_CALLER", "PORTAGE_IUSE", |
102 |
"PORTAGE_NONFATAL", "PORTAGE_PIPE_FD", "PORTAGE_REPO_NAME", |
103 |
"PORTAGE_USE", "PROPERTIES", "RDEPEND", "REPOSITORY", |