Gentoo Archives: gentoo-dev

From: Matt Tucker <tuck@×××××××××××××.net>
To: Jeff Stuart <jstuart@×××××××××××××.net>
Cc: gentoo-dev@g.o
Subject: Re: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths
Date: Fri, 18 Apr 2003 18:12:29
Message-Id: 23830000.1050689547@nareau.whistlingfish.net
In Reply to: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths by Jeff Stuart
1 -- Jeff Stuart <jstuart@×××××××××××××.net> spake thusly:
2
3 > What I WANTED to do in the src_install was to check if gtk and/or
4 > gtk2 was in the USE flag. IF both, then it would copy both the gtk1
5 > and gtk2 theme for Geramik. If only gtk1, then it would copy just
6 > the gtk1 files and remove the gtk2 files. If GTK2 only, well... that
7 > would be an odd case. ;) Then I'd copy the gtk2 files, then grab the
8 > .png's from the gtk1 theme, and finally awk the gtkrc for gtk2 theme
9 > to point to the right pixmap.
10 >
11 > What I TRIED was the following:
12 <snip>
13 > And no matter WHAT I did including modifying my make.conf, passing
14 > env USE="-gtk2", etc. It STILL thought that both gtk1 AND gtk2 were
15 > set!!!! Why? :D
16 >
17 > Finally, would that be the proper use of the USE flags?
18
19 All of those should work fine:
20
21 $ export USE="gtk gtk2"
22 $ use() { local x; for x in ${USE}; do
23 > if [ "${x}" = "${1}" ]; then
24 > echo "${x}";
25 > return 0;
26 > fi;
27 > done;
28 > return 1;
29 > }
30 $ use gtk
31 gtk
32 $ [ "`use gtk`" -a "`use gtk2`" ] && echo true
33 true
34 $ USE="gtk"
35 $ use gtk2
36 $ [ "`use gtk`" -a "`use gtk2`" ] && echo true
37 $ [ "`use gtk`" -a ! "`use gtk2`" ] && echo true
38 true
39
40 Sure, this doesn't test actually setting your USE flags, but it does
41 test the [] functionality. You could try doing "echo $USE" before your
42 tests, just to make sure that you know what you're working with.
43
44 For what it's worth, I just tried setting USE="gtk gtk2" in my
45 make.conf, and then doing 'USE="-gtk2" ebuild ...' on the command line,
46 and everything worked as you would expect.
47
48
49 --
50 gentoo-dev@g.o mailing list