Gentoo Archives: gentoo-dev

From: Brian Harring <ferringb@×××××.com>
To: gentoo-dev@l.g.o
Cc: vapier@g.o, Brian Harring <ferringb@×××××.com>
Subject: [gentoo-dev] [PATCH] eutils: Warn on built_with_use usage
Date: Sun, 16 Sep 2012 07:52:04
Message-Id: 1347781864-29497-1-git-send-email-ferringb@gmail.com
1 At this point, the functionality built_with_use provides should
2 be covered near or more likely, in full, but USE deps in EAPI2 and
3 EAPI4; thus warn on usage.
4
5 While this may be a bit annoying, this is the only major consumer
6 left at this point that knows about /var/db/pkg layout; once that's
7 gone, alternative VDB formats can occur (meaning faster package
8 manager operations, or at least the potential if implemented sanely).
9
10 This patch is a rough first stab at the wording (english isn't
11 exactly my forte) to use for warning; better/clearer warning text
12 would be appreciated.
13 ---
14 eutils.eclass | 13 +++++++++++++
15 1 file changed, 13 insertions(+)
16
17 diff --git a/eutils.eclass b/eutils.eclass
18 index 8bfc2bc..7f5a616 100644
19 --- a/eutils.eclass
20 +++ b/eutils.eclass
21 @@ -1196,7 +1196,9 @@ built_with_use() {
22 fi
23
24 local missing_action="die"
25 + local missing_was_set=false
26 if [[ $1 == "--missing" ]] ; then
27 + missing_was_set=true
28 missing_action=$2
29 shift ; shift
30 case ${missing_action} in
31 @@ -1205,6 +1207,17 @@ built_with_use() {
32 esac
33 fi
34
35 + if ! has $EAPI 0 1 2 3; then
36 + eqawarn "built_with_use should not be used in $EAPI; use USE deps."
37 + elif has $EAPI 2 3; then
38 + if [[ $hidden == yes ]] || $missing_was_set; then
39 + eqawarn "built_with_use in EAPI=$EAPI without --missing or --hidden usage, should use USE deps instead."
40 + else
41 + eqawarn "built_with_use should not be used; upgrade to EAPI=4 instead"
42 + fi
43 + fi
44 +
45 +
46 local opt=$1
47 [[ ${opt:0:1} = "-" ]] && shift || opt="-a"
48
49 --
50 1.7.12

Replies

Subject Author
[gentoo-dev] Re: [PATCH] eutils: Warn on built_with_use usage Mike Frysinger <vapier@g.o>