Enable FEATURES=strict-keepdir behavior for new EAPIs

Suggested-by: Pacho Ramos <pacho@gentoo.org>
Bug: https://bugs.gentoo.org/651678
Signed-off-by: Zac Medico <zmedico@gentoo.org>
diff --git a/bin/eapi.sh b/bin/eapi.sh
index 455bc9b..4eafc1c 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -247,3 +247,7 @@
 ___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 8599db3..34a1daf 100644
--- a/bin/install-qa-check.d/95empty-dirs
+++ b/bin/install-qa-check.d/95empty-dirs
@@ -17,7 +17,9 @@
 	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 0ad3e2f..4c9f006 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -649,6 +649,7 @@
 .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