diff options
author | Michał Górny <mgorny@gentoo.org> | 2021-06-20 21:48:43 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-06-20 22:21:29 +0200 |
commit | c8a52e17017058394ea35394ebfae0e049c8779c (patch) | |
tree | 780d8e6728b9f33ad7481687bce0ed61ccba808d | |
parent | fetch: Fix AttributeError when no URL specified (diff) | |
download | portage-c8a52e17017058394ea35394ebfae0e049c8779c.tar.gz portage-c8a52e17017058394ea35394ebfae0e049c8779c.tar.bz2 portage-c8a52e17017058394ea35394ebfae0e049c8779c.zip |
Fix exposing evaluated PROPERTIES & RESTRICT in EAPI 8
Reorder the code to prevent eclass PROPERTIES & RESTRICT logic from
overriding the processed values gotten from PORTAGE_PROPERTIES
and PORTAGE_RESTRICT. Otherwise, code in Portage misbehaves due to
unexpected USE-conditionals in PROPERTIES/RESTRICT.
Bug: https://bugs.gentoo.org/796959
Reviewed-by: Zac Medico <zmedico@gentoo.org>
Closes: https://github.com/gentoo/portage/pull/733
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rwxr-xr-x | bin/ebuild.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 2c3b985a9..904fdf54e 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -653,13 +653,6 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then shopt -u failglob fi - if [[ "${EBUILD_PHASE}" != "depend" ]] ; then - PROPERTIES=${PORTAGE_PROPERTIES} - RESTRICT=${PORTAGE_RESTRICT} - [[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \ - rm "$PORTAGE_BUILDDIR/.ebuild_changed" - fi - [ "${EAPI+set}" = set ] || EAPI=0 # export EAPI for helpers (especially since we unset it above) @@ -688,6 +681,13 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND unset E_BDEPEND E_PROPERTIES E_RESTRICT __INHERITED_QA_CACHE + if [[ "${EBUILD_PHASE}" != "depend" ]] ; then + PROPERTIES=${PORTAGE_PROPERTIES} + RESTRICT=${PORTAGE_RESTRICT} + [[ -e $PORTAGE_BUILDDIR/.ebuild_changed ]] && \ + rm "$PORTAGE_BUILDDIR/.ebuild_changed" + fi + # alphabetically ordered by $EBUILD_PHASE value case ${EAPI} in 0|1) |