public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Matt Tucker <tuck@whistlingfish.net>
To: Jeff Stuart <jstuart@computer-city.net>
Cc: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] USE variables in ebuilds and using them for multiple install paths
Date: Fri, 18 Apr 2003 11:12:27 -0700	[thread overview]
Message-ID: <23830000.1050689547@nareau.whistlingfish.net> (raw)
In-Reply-To: <20030418093613.2dc30270.jstuart@computer-city.net>

-- Jeff Stuart <jstuart@computer-city.net> 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:
<snip>
> 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


  reply	other threads:[~2003-04-18 18:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-18 13:36 [gentoo-dev] USE variables in ebuilds and using them for multiple install paths Jeff Stuart
2003-04-18 18:12 ` Matt Tucker [this message]
2003-04-19 11:18 ` foser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23830000.1050689547@nareau.whistlingfish.net \
    --to=tuck@whistlingfish.net \
    --cc=gentoo-dev@gentoo.org \
    --cc=jstuart@computer-city.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox