Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: "Andreas K. Hüttel" <dilfridge@g.o>
Cc: gentoo-dev@l.g.o, Doug Freed <dwfreed@×××.edu>
Subject: Re: [gentoo-dev] [PATCH 1/5] depend.apache.eclass: Replace build_with_use with has_version
Date: Fri, 09 Dec 2016 06:09:25
Message-Id: 20161209070908.21881afc.mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/5] depend.apache.eclass: Replace build_with_use with has_version by "Andreas K. Hüttel"
1 On Thu, 8 Dec 2016 21:36:28 +0100
2 Andreas K. Hüttel <dilfridge@g.o> wrote:
3
4 > From: Doug Freed <dwfreed@×××.edu>
5 >
6 > ---
7 > eclass/depend.apache.eclass | 6 +++---
8 > 1 file changed, 3 insertions(+), 3 deletions(-)
9 >
10 > diff --git a/eclass/depend.apache.eclass b/eclass/depend.apache.eclass
11 > index b69c2ec..a7d206f 100644
12 > --- a/eclass/depend.apache.eclass
13 > +++ b/eclass/depend.apache.eclass
14 > @@ -290,7 +290,7 @@ has_apache() {
15 > has_apache_threads() {
16 > debug-print-function $FUNCNAME $*
17 >
18 > - if ! built_with_use www-servers/apache threads; then
19 > + if ! has_version 'www-servers/apache[threads]'; then
20 > return
21 > fi
22 >
23 > @@ -313,14 +313,14 @@ has_apache_threads() {
24 > has_apache_threads_in() {
25 > debug-print-function $FUNCNAME $*
26 >
27 > - if ! built_with_use www-servers/apache threads; then
28 > + if ! has_version 'www-servers/apache[threads]'; then
29 > return
30 > fi
31 >
32 > local myforeign="$1"
33 > local myflag="${2:-threads}"
34 >
35 > - if ! built_with_use ${myforeign} ${myflag}; then
36 > + if ! has_version "${myforeign}[${myflag}]"; then
37 > echo
38 > eerror "You need to enable USE flag '${myflag}' in ${myforeign} to"
39 > eerror "build a thread-safe version of ${CATEGORY}/${PN} for use"
40
41 I don't think it's valid for EAPI 0/1. You should probably move the
42 EAPI 1 ban first, to avoid keeping half-broken state between commits,
43 and add an explicit die call here for EAPI 0. It's better if ebuild
44 dies with explanation rather than unreliably fails with invalid
45 has_version syntax.
46
47 --
48 Best regards,
49 Michał Górny
50 <http://dev.gentoo.org/~mgorny/>

Replies