Gentoo Archives: gentoo-dev

From: "Marty E. Plummer" <hanetzer@×××××××××.com>
To: gentoo-dev@l.g.o
Cc: gentoo-java@l.g.o
Subject: Re: [gentoo-dev] Re: [PATCH] ant-tasks.eclass: use eapi7-ver
Date: Tue, 22 May 2018 07:05:12
Message-Id: 20180522070423.u5azbl57ct2jnrks@proprietary-killer
In Reply to: Re: [gentoo-dev] Re: [PATCH] ant-tasks.eclass: use eapi7-ver by "Marty E. Plummer"
1 On Tue, May 22, 2018 at 01:59:51AM -0500, Marty E. Plummer wrote:
2 > On Tue, May 22, 2018 at 08:27:27AM +0200, Ulrich Mueller wrote:
3 > > >>>>> On Mon, 21 May 2018, Marty E Plummer wrote:
4 > >
5 > > > On Tue, May 22, 2018 at 05:57:35AM +0200, Micha?? G??rny wrote:
6 > >
7 > > [Please check you mailer configuration. It's sending MIME, but
8 > > charset=us-ascii cannot represent these chars.]
9 > >
10 > > >> Always check for old EAPIs, instead of expecting people to keep updating
11 > > >> this forever.
12 > > >>
13 > > > Would you prefer something like
14 > > > [[ ${EAPI} ~= [0-6] ]] && inherit eapi7-ver, then?
15 > >
16 > > The regexp operator is =~ not ~=. Also it will match partial
17 > > expressions, so it will fail in EAPI 10.
18 > >
19 > Fair, I knew it was something like that. Also, by the time EAPI 10 hits
20 > this section of code should have been long culled since eapi7-ver's
21 > functions are 'native' in EAPI 7.
22 > > Use this instead: [[ ${EAPI:-0} == [0123456] ]]
23 > >
24 > Fair enough, that should do the trick and keep everyone happy in the
25 > long run.
26 > > Ulrich
27
28 How's this?
29 ---
30 eclass/ant-tasks.eclass | 11 ++++++-----
31 1 file changed, 6 insertions(+), 5 deletions(-)
32
33 diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass
34 index e008e6eaea8..31683e68243 100644
35 --- a/eclass/ant-tasks.eclass
36 +++ b/eclass/ant-tasks.eclass
37 @@ -16,7 +16,8 @@
38 JAVA_ANT_DISABLE_ANT_CORE_DEP=true
39 # rewriting build.xml for are the testcases has no reason atm
40 JAVA_PKG_BSFIX_ALL=no
41 -inherit versionator java-pkg-2 java-ant-2
42 +inherit java-pkg-2 java-ant-2
43 +[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
44
45 EXPORT_FUNCTIONS src_unpack src_compile src_install
46
47 @@ -60,12 +61,12 @@ if [[ ${PV} == *beta2* ]]; then
48 MY_PV=${PV/_beta2/beta}
49 UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src"
50 GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
51 - ANT_TASK_PV=$(get_version_component_range 1-3)
52 + ANT_TASK_PV=$(ver_cut 1-3)
53 elif [[ ${PV} == *_rc* ]]; then
54 MY_PV=${PV/_rc/RC}
55 UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles"
56 GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles"
57 - ANT_TASK_PV=$(get_version_component_range 1-3)
58 + ANT_TASK_PV=$(ver_cut 1-3)
59 else
60 # default for final releases
61 MY_PV=${PV}
62 @@ -101,7 +102,7 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then
63 fi
64
65 # we need direct blockers with old ant-tasks for file collisions - bug #252324
66 -if version_is_at_least 1.7.1 ; then
67 +if ver_test -ge 1.7.1; then
68 DEPEND+=" !dev-java/ant-tasks"
69 fi
70
71 @@ -167,7 +168,7 @@ ant-tasks_src_install() {
72 java-pkg_register-ant-task --version "${ANT_TASK_PV}"
73
74 # create the compatibility symlink
75 - if version_is_at_least 1.7.1_beta2; then
76 + if ver_test -ge 1.7.1_beta2; then
77 dodir /usr/share/ant/lib
78 dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar
79 fi
80 --
81 2.17.0

Replies

Subject Author
Re: [gentoo-dev] Re: [PATCH] ant-tasks.eclass: use eapi7-ver Ulrich Mueller <ulm@g.o>