public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: bin/, lib/portage/, lib/portage/package/ebuild/_config/
@ 2021-09-10  7:16 Michał Górny
  0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2021-09-10  7:16 UTC (permalink / raw
  To: gentoo-commits

commit:     13f1a19ed3db9534e74d23254e41ef7c30c5b9fe
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  3 16:29:56 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep 10 07:16:40 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=13f1a19e

Include INHERIT value in generated cache

PkgCore uses an additional md5-cache INHERIT key to indicate eclasses
explicitly inherited in an ebuild.  Update Portage to emit the same key
to restore cache compatibility.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 bin/ebuild.sh                                          | 8 +++++++-
 bin/phase-functions.sh                                 | 2 +-
 lib/portage/__init__.py                                | 2 +-
 lib/portage/package/ebuild/_config/special_env_vars.py | 2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 381bcb5c8..07ca58d22 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -402,6 +402,9 @@ inherit() {
 			unset $__export_funcs_var
 
 			has $1 $INHERITED || export INHERITED="$INHERITED $1"
+			if [[ ${ECLASS_DEPTH} -eq 1 ]]; then
+				export PORTAGE_EXPLICIT_INHERIT="${PORTAGE_EXPLICIT_INHERIT} $1"
+			fi
 		fi
 
 		shift
@@ -648,6 +651,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
 		unset INHERITED IUSE REQUIRED_USE ECLASS E_IUSE E_REQUIRED_USE
 		unset E_DEPEND E_RDEPEND E_PDEPEND E_BDEPEND E_IDEPEND E_PROPERTIES
 		unset E_RESTRICT PROVIDES_EXCLUDE REQUIRES_EXCLUDE
+		unset PORTAGE_EXPLICIT_INHERIT
 
 		if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then
 			source "$EBUILD" || die "error sourcing ebuild"
@@ -757,7 +761,7 @@ if [[ $EBUILD_PHASE = depend ]] ; then
 	metadata_keys=(
 		DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE
 		DESCRIPTION KEYWORDS INHERITED IUSE REQUIRED_USE PDEPEND BDEPEND
-		EAPI PROPERTIES DEFINED_PHASES IDEPEND
+		EAPI PROPERTIES DEFINED_PHASES IDEPEND INHERIT
 	)
 
 	if ! ___eapi_has_BDEPEND; then
@@ -767,6 +771,8 @@ if [[ $EBUILD_PHASE = depend ]] ; then
 		unset IDEPEND
 	fi
 
+	INHERIT=${PORTAGE_EXPLICIT_INHERIT}
+
 	# The extra $(echo) commands remove newlines.
 	for f in "${metadata_keys[@]}" ; do
 		echo "${f}=$(echo ${!f})" >&${PORTAGE_PIPE_FD} || exit $?

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index 0bb5d86e1..d3221993d 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -20,7 +20,7 @@ PORTAGE_READONLY_VARS="D EBUILD EBUILD_PHASE EBUILD_PHASE_FUNC \
 	PORTAGE_BUILD_USER PORTAGE_BUNZIP2_COMMAND \
 	PORTAGE_BZIP2_COMMAND PORTAGE_COLORMAP PORTAGE_CONFIGROOT \
 	PORTAGE_DEBUG PORTAGE_DEPCACHEDIR PORTAGE_EBUILD_EXIT_FILE \
-	PORTAGE_ECLASS_LOCATIONS \
+	PORTAGE_ECLASS_LOCATIONS PORTAGE_EXPLICIT_INHERIT \
 	PORTAGE_GID PORTAGE_GRPNAME PORTAGE_INST_GID PORTAGE_INST_UID \
 	PORTAGE_INTERNAL_CALLER PORTAGE_IPC_DAEMON PORTAGE_IUSE PORTAGE_LOG_FILE \
 	PORTAGE_MUTABLE_FILTERED_VARS PORTAGE_OVERRIDE_EPREFIX PORTAGE_PROPERTIES \

diff --git a/lib/portage/__init__.py b/lib/portage/__init__.py
index 232d77f0e..a41ca4323 100644
--- a/lib/portage/__init__.py
+++ b/lib/portage/__init__.py
@@ -519,7 +519,7 @@ auxdbkeys = (
 	'RESTRICT',  'HOMEPAGE',  'LICENSE',   'DESCRIPTION',
 	'KEYWORDS',  'INHERITED', 'IUSE', 'REQUIRED_USE',
 	'PDEPEND',   'BDEPEND', 'EAPI',
-	'PROPERTIES', 'DEFINED_PHASES', 'IDEPEND',
+	'PROPERTIES', 'DEFINED_PHASES', 'IDEPEND', 'INHERIT',
 )
 
 def portageexit():

diff --git a/lib/portage/package/ebuild/_config/special_env_vars.py b/lib/portage/package/ebuild/_config/special_env_vars.py
index 456af1838..8e314a6d6 100644
--- a/lib/portage/package/ebuild/_config/special_env_vars.py
+++ b/lib/portage/package/ebuild/_config/special_env_vars.py
@@ -22,7 +22,7 @@ env_blacklist = frozenset((
 	"KEYWORDS", "LICENSE", "MERGE_TYPE",
 	"PDEPEND", "PF", "PKGUSE", "PORTAGE_BACKGROUND",
 	"PORTAGE_BACKGROUND_UNMERGE", "PORTAGE_BUILDDIR_LOCKED",
-	"PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT",
+	"PORTAGE_BUILT_USE", "PORTAGE_CONFIGROOT", "PORTAGE_EXPLICIT_INHERIT",
 	"PORTAGE_INTERNAL_CALLER", "PORTAGE_IUSE",
 	"PORTAGE_NONFATAL", "PORTAGE_PIPE_FD", "PORTAGE_REPO_NAME",
 	"PORTAGE_USE", "PROPERTIES", "RDEPEND", "REPOSITORY",


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-10  7:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-10  7:16 [gentoo-commits] proj/portage:master commit in: bin/, lib/portage/, lib/portage/package/ebuild/_config/ Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox