aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-11-16 11:00:28 +0100
committerMichał Górny <mgorny@gentoo.org>2021-05-12 13:21:44 +0200
commit56421775978dbee167dd241c43d3a56b8a3ea48e (patch)
treea6fd17b75712b221b01f2044abc7d5a5a9dd581c
parentSupport new econf-passed parameters for EAPI 8 (diff)
downloadportage-master.tar.gz
portage-master.tar.bz2
portage-master.zip
Accumulated PROPERTIES and RESTRICT for EAPI 8HEADmaster
Reviewed-by: Zac Medico <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/638 Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--bin/eapi.sh8
-rwxr-xr-xbin/ebuild.sh48
2 files changed, 50 insertions, 6 deletions
diff --git a/bin/eapi.sh b/bin/eapi.sh
index a93efa8cd..e2b6f62a0 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -50,6 +50,14 @@ ___eapi_has_PORTDIR_ECLASSDIR() {
[[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ ]]
}
+___eapi_has_accumulated_PROPERTIES() {
+ [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
+___eapi_has_accumulated_RESTRICT() {
+ [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6|7)$ ]]
+}
+
# HELPERS PRESENCE
___eapi_has_dohard() {
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index cfcf6eba3..ed0218787 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -255,6 +255,8 @@ inherit() {
local B_RDEPEND
local B_PDEPEND
local B_BDEPEND
+ local B_PROPERTIES
+ local B_RESTRICT
while [ "$1" ]; do
location=""
potential_location=""
@@ -299,7 +301,7 @@ inherit() {
# Retain the old data and restore it later.
unset B_IUSE B_REQUIRED_USE B_DEPEND B_RDEPEND B_PDEPEND
- unset B_BDEPEND
+ unset B_BDEPEND B_PROPERTIES B_RESTRICT
[ "${IUSE+set}" = set ] && B_IUSE="${IUSE}"
[ "${REQUIRED_USE+set}" = set ] && B_REQUIRED_USE="${REQUIRED_USE}"
[ "${DEPEND+set}" = set ] && B_DEPEND="${DEPEND}"
@@ -307,6 +309,16 @@ inherit() {
[ "${PDEPEND+set}" = set ] && B_PDEPEND="${PDEPEND}"
[ "${BDEPEND+set}" = set ] && B_BDEPEND="${BDEPEND}"
unset IUSE REQUIRED_USE DEPEND RDEPEND PDEPEND BDEPEND
+
+ if ___eapi_has_accumulated_PROPERTIES; then
+ [[ ${PROPERTIES+set} == set ]] && B_PROPERTIES=${PROPERTIES}
+ unset PROPERTIES
+ fi
+ if ___eapi_has_accumulated_RESTRICT; then
+ [[ ${RESTRICT+set} == set ]] && B_RESTRICT=${RESTRICT}
+ unset RESTRICT
+ fi
+
#turn on glob expansion
set +f
fi
@@ -344,6 +356,23 @@ inherit() {
[ "${B_BDEPEND+set}" = set ] && BDEPEND="${B_BDEPEND}"
[ "${B_BDEPEND+set}" = set ] || unset BDEPEND
+ if ___eapi_has_accumulated_PROPERTIES; then
+ [[ ${PROPERTIES+set} == set ]] &&
+ E_PROPERTIES+=${E_PROPERTIES:+ }${PROPERTIES}
+ [[ ${B_PROPERTIES+set} == set ]] &&
+ PROPERTIES=${B_PROPERTIES}
+ [[ ${B_PROPERTIES+set} == set ]] ||
+ unset PROPERTIES
+ fi
+ if ___eapi_has_accumulated_RESTRICT; then
+ [[ ${RESTRICT+set} == set ]] &&
+ E_RESTRICT+=${E_RESTRICT:+ }${RESTRICT}
+ [[ ${B_RESTRICT+set} == set ]] &&
+ RESTRICT=${B_RESTRICT}
+ [[ ${B_RESTRICT+set} == set ]] ||
+ unset RESTRICT
+ fi
+
#turn on glob expansion
set +f
@@ -600,10 +629,10 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
# In order to ensure correct interaction between ebuilds and
# eclasses, they need to be unset before this process of
# interaction begins.
- unset EAPI DEPEND RDEPEND PDEPEND BDEPEND
+ unset EAPI DEPEND RDEPEND PDEPEND BDEPEND PROPERTIES RESTRICT
unset INHERITED IUSE REQUIRED_USE ECLASS E_IUSE E_REQUIRED_USE
- unset E_DEPEND E_RDEPEND E_PDEPEND E_BDEPEND
- unset PROVIDES_EXCLUDE REQUIRES_EXCLUDE
+ unset E_DEPEND E_RDEPEND E_PDEPEND E_BDEPEND E_PROPERTIES
+ unset E_RESTRICT PROVIDES_EXCLUDE REQUIRES_EXCLUDE
if [[ $PORTAGE_DEBUG != 1 || ${-/x/} != $- ]] ; then
source "$EBUILD" || die "error sourcing ebuild"
@@ -640,9 +669,16 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
PDEPEND+="${PDEPEND:+ }${E_PDEPEND}"
BDEPEND+="${BDEPEND:+ }${E_BDEPEND}"
REQUIRED_USE+="${REQUIRED_USE:+ }${E_REQUIRED_USE}"
-
+
+ if ___eapi_has_accumulated_PROPERTIES; then
+ PROPERTIES+=${PROPERTIES:+ }${E_PROPERTIES}
+ fi
+ if ___eapi_has_accumulated_RESTRICT; then
+ RESTRICT+=${RESTRICT:+ }${E_RESTRICT}
+ fi
+
unset ECLASS E_IUSE E_REQUIRED_USE E_DEPEND E_RDEPEND E_PDEPEND
- unset E_BDEPEND __INHERITED_QA_CACHE
+ unset E_BDEPEND E_PROPERTIES E_RESTRICT __INHERITED_QA_CACHE
# alphabetically ordered by $EBUILD_PHASE value
case ${EAPI} in