At this point, the functionality built_with_use provides should
be covered near or more likely, in full, but USE deps in EAPI2 and
EAPI4; thus warn on usage.

While this may be a bit annoying, this is the only major consumer
left at this point that knows about /var/db/pkg layout; once that's
gone, alternative VDB formats can occur (meaning faster package
manager operations, or at least the potential if implemented sanely).

This patch is a rough first stab at the wording (english isn't
exactly my forte) to use for warning; better/clearer warning text
would be appreciated.
---
 eutils.eclass | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/eutils.eclass b/eutils.eclass
index 8bfc2bc..7f5a616 100644
--- a/eutils.eclass
+++ b/eutils.eclass
@@ -1196,7 +1196,9 @@ built_with_use() {
        fi
 
        local missing_action="die"
+       local missing_was_set=false
        if [[ $1 == "--missing" ]] ; then
+               missing_was_set=true
                missing_action=$2
                shift ; shift
                case ${missing_action} in
@@ -1205,6 +1207,17 @@ built_with_use() {
                esac
        fi
 
+       if ! has $EAPI 0 1 2 3; then
+               eqawarn "built_with_use should not be used in $EAPI; use USE 
deps."
+       elif has $EAPI 2 3; then
+               if [[ $hidden == yes ]] || $missing_was_set; then
+                       eqawarn "built_with_use in EAPI=$EAPI without --missing 
or --hidden usage, should use USE deps instead."
+               else
+                       eqawarn "built_with_use should not be used; upgrade to 
EAPI=4 instead"
+               fi
+       fi
+
+
        local opt=$1
        [[ ${opt:0:1} = "-" ]] && shift || opt="-a"
 
-- 
1.7.12


Reply via email to