commit:     bfda0d2bd4ba03a4e77f488ec3fd4f9c6c351662
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Apr 27 18:11:11 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Apr 30 02:40:10 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=bfda0d2b

Enable FEATURES=strict-keepdir behavior for new EAPIs

Suggested-by: Pacho Ramos <pacho <AT> gentoo.org>
Bug: https://bugs.gentoo.org/651678
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 bin/eapi.sh                         | 4 ++++
 bin/install-qa-check.d/95empty-dirs | 4 +++-
 man/make.conf.5                     | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index 455bc9b0d..4eafc1c87 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -247,3 +247,7 @@ ___eapi_bash_4_2() {
 ___eapi_has_ENV_UNSET() {
        [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-progress|6)$ 
]]
 }
+
+___eapi_has_strict_keepdir() {
+       [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|5|5-progress|6|7)$ ]]
+}

diff --git a/bin/install-qa-check.d/95empty-dirs 
b/bin/install-qa-check.d/95empty-dirs
index 8599db395..34a1daf21 100644
--- a/bin/install-qa-check.d/95empty-dirs
+++ b/bin/install-qa-check.d/95empty-dirs
@@ -17,7 +17,9 @@ find_empty_dirs() {
        local warn_dirs=()
        local d striparg=
 
-       [[ ${FEATURES} == *strict-keepdir* ]] && striparg=-delete
+       if ___eapi_has_strict_keepdir || [[ ${FEATURES} == *strict-keepdir* ]]; 
then
+               striparg=-delete
+       fi
 
        while IFS= read -r -d $'\0' d; do
                [[ ${d} == ${ED%/}/var/* ]] && warn_dirs+=( "${d}" )

diff --git a/man/make.conf.5 b/man/make.conf.5
index 0ad3e2f7d..4c9f00675 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -649,6 +649,7 @@ dangerous (like missing or incorrect digests for ebuilds).
 .B strict-keepdir
 Have portage strictly require keepdir calls in ebuilds.  Empty
 directories installed without explicit keepdir will be removed.
+This feature is automatically enabled for \fBEAPI 8\fR and later.
 .TP
 .B stricter
 Have portage react strongly to conditions that may conflict with system

Reply via email to