Gentoo Archives: gentoo-dev

From: Alistair Bush <ali_bush@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in app-cdr/cdrdao: ChangeLog cdrdao-1.2.2-r3.ebuild
Date: Mon, 11 May 2009 11:29:19
Message-Id: 4A080C06.6020209@gentoo.org
In Reply to: [gentoo-dev] Re: [gentoo-commits] gentoo-x86 commit in app-cdr/cdrdao: ChangeLog cdrdao-1.2.2-r3.ebuild by Ryan Hill
1 >
2 > You can't test FEATURES in an ebuild. It's portage-specific.
3 >
4
5 To 1) try and turn this thread into something a little more constructive
6 and a little less childish; and 2) help improve the tree. I present one
7 of the offending ebuilds dev-java/commons-io
8
9 Without posting the whole file here it is
10
11 src_test() {
12 if has userpriv ${FEATURES}; then
13 ANT_OPTS="-Djava.io.tmpdir=${T} -Duser.home=${T}" \
14 ANT_TASKS="ant-junit" \
15 eant test \
16 -Dgentoo.classpath="$(java-pkg_getjars junit)" \
17 -Dlibdir="libdir" \
18 -Djava.io.tmpdir="${T}"
19 else
20 elog "Tests fail unless userpriv is enabled because they
21 test for"
22 elog "file permissions which doesn't work when run as root."
23 fi
24 }
25
26 I would assume it would be better to directly test whether the user is
27 root, than test that userpriv is set?
28
29 Alistair

Replies