From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5723 invoked by uid 1002); 18 Apr 2003 18:12:29 -0000 Mailing-List: contact gentoo-dev-help@gentoo.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Received: (qmail 6234 invoked from network); 18 Apr 2003 18:12:29 -0000 Date: Fri, 18 Apr 2003 11:12:27 -0700 From: Matt Tucker To: Jeff Stuart cc: gentoo-dev@gentoo.org Message-ID: <23830000.1050689547@nareau.whistlingfish.net> In-Reply-To: <20030418093613.2dc30270.jstuart@computer-city.net> References: <20030418093613.2dc30270.jstuart@computer-city.net> X-Mailer: Mulberry/3.0.1 (Linux/x86) Mail-Copies-To: nobody MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: Re: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths X-Archives-Salt: 910021d9-b38a-4109-a3fd-d56535b4f3f1 X-Archives-Hash: ac8a4f7b31b29a97821dec5b04b25c88 -- Jeff Stuart spake thusly: > What I WANTED to do in the src_install was to check if gtk and/or > gtk2 was in the USE flag. IF both, then it would copy both the gtk1 > and gtk2 theme for Geramik. If only gtk1, then it would copy just > the gtk1 files and remove the gtk2 files. If GTK2 only, well... that > would be an odd case. ;) Then I'd copy the gtk2 files, then grab the > .png's from the gtk1 theme, and finally awk the gtkrc for gtk2 theme > to point to the right pixmap. > > What I TRIED was the following: > And no matter WHAT I did including modifying my make.conf, passing > env USE="-gtk2", etc. It STILL thought that both gtk1 AND gtk2 were > set!!!! Why? :D > > Finally, would that be the proper use of the USE flags? All of those should work fine: $ export USE="gtk gtk2" $ use() { local x; for x in ${USE}; do > if [ "${x}" = "${1}" ]; then > echo "${x}"; > return 0; > fi; > done; > return 1; > } $ use gtk gtk $ [ "`use gtk`" -a "`use gtk2`" ] && echo true true $ USE="gtk" $ use gtk2 $ [ "`use gtk`" -a "`use gtk2`" ] && echo true $ [ "`use gtk`" -a ! "`use gtk2`" ] && echo true true Sure, this doesn't test actually setting your USE flags, but it does test the [] functionality. You could try doing "echo $USE" before your tests, just to make sure that you know what you're working with. For what it's worth, I just tried setting USE="gtk gtk2" in my make.conf, and then doing 'USE="-gtk2" ebuild ...' on the command line, and everything worked as you would expect. -- gentoo-dev@gentoo.org mailing list