Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 44219 - euse should support per-package USE flags via /etc/portage/package.use
Summary: euse should support per-package USE flags via /etc/portage/package.use
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
: 174049 (view as bug list)
Depends on:
Blocks: 237964
  Show dependency tree
 
Reported: 2004-03-10 00:18 UTC by alex f
Modified: 2011-06-15 04:46 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
The new USE flags handler (eusepy,14.59 KB, text/plain)
2005-04-24 06:22 UTC, Guillaume
Details
Another crack at euse in python (euse.py,16.21 KB, text/plain)
2006-04-13 11:42 UTC, Mike
Details
a simple patch to to the existing euse to support per-package use flags (euse.diff,5.44 KB, patch)
2008-10-06 17:46 UTC, Jörg Walter
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description alex f 2004-03-10 00:18:58 UTC
The summary says it all. It would be helpful if showing, enabling and disabling per-package USE flags with euse would be possible. Of course 'euse -i USEFLAG' should show if USEFLAG is enabled globally or per-package as well. :)

Reproducible: Always
Steps to Reproduce:
Comment 1 Mike Nerone 2004-04-06 10:52:40 UTC
See Bug 3252
Comment 2 Mike Nerone 2004-04-06 11:00:13 UTC
Actually, I mean see Bug 13616. Basically, this per-package USE flags can already be done in /etc/portage/package.use, with lines formatted such as:

net-mail/evolution  -mozilla

Nifty!
Comment 3 alex f 2004-04-06 14:22:14 UTC
This bug is about euse supporting per-package useflags. I know they exist and are supported by portage (I use them). But euse (part of gentoolkit) does not support them yet. That is why I created this bug.
Comment 4 Aaron Peterson 2004-07-30 03:37:41 UTC
Ah, this is a request to show what packages use the flag...

ufed should be able to edit per package useflags too...

We know that per package suppored useflags are supported by:
************
/etc/portage/package.use

or something like that....

but... I don't really know....

my /etc/portage/package.use contains:

=kde-base/kdewebdev-3.3.0_beta1 debug
dev-libs/cyrus-sasl gdbm -berkdb

http://bugs.gentoo.org/show_bug.cgi?id=41658 is related, because we need to let people know about useflags.

Comment 5 John Nilsson 2005-01-02 08:21:23 UTC
As I'd like to see this too, I'll try:

The request is to make euse (the tool) add/remove flags from /etc/portage/package.use if the flags are listed in /usr/portage/profiles/use.local.desc instead of adding/removing them from /etc/make.conf

I'd suggest to make this behaviour optional.
Comment 6 alex f 2005-01-03 09:15:46 UTC
Why only for useflags from /usr/portage/profiles/use.local.desc? Suppose I want to:

euse -E gtk (enable gtk useflag globally)

and then

euse -D gtk net-p2p/mldonkey (disable gtk useflag for mldonkey in /etc/portage/package.use)
Comment 7 Guillaume 2005-04-24 06:22:38 UTC
Created attachment 57090 [details]
The new USE flags handler

I wrote a script to handle global AND local use flags. It's called eusepy,
because  it's like euse, but written in Python :)
I posted it at gentoo-submissions@gentoo.org more than a month ago, but I never
had an anwser.
It can enable/disable/clean USE flags in /etc/portage/package.use as well as in
/etc/make.conf.

Some examples of how to use it :
Enable a global flag:
# eusepy -e kde
=> kde (a global flag) is added to USE="..." in /etc/make.conf

Enable a local flag:
# eusepy -e sse2
=> sse2 (a local flag) is added in /etc/portage/package.use for ALL packages
who have it (currently mplayer, fftw and transcode).
If you want sse2 only for mplayer, you can run:
# eusepy -e mplayer:sse2
and sse2 will be set ONLY for mplayer in package.use

Enable a global flag only for 1 package:
# eusepy -e eclipse-sdk:kde
=> kde is added to /etc/portage/package.use for dev-util/eclipse-sdk only.

Disable an use flag:
# eusepy -d sse2
sse2 is disabled for ALL packages who have it on /etc/portage/package.use
# eusepy -d kde
kde is disabled in make.conf

Enable several use flags at once:
# eusepy -e kde sse2 mplayer:avi

Clean a use flag:
# eusepy -c kde

see eusepy -h for the manual :)

the files affected are /etc/make.conf and /etc/portage/package.use
eusepy make .bak file backups.

Use at your own risk =)

It does not support the euse ability to show in where files each USE flag is
enabled.

And please forgive my low English language skill, as it isn't my natural
language.
Comment 8 Marius Mauch (RETIRED) gentoo-dev 2005-04-27 05:12:23 UTC
"I posted it at gentoo-submissions@gentoo.org more than a month ago, but I never
had an anwser."
I'm pretty sure that alias is dead and buried for a very long time by now.
Don't think I'll replace the current euse with your script, but rather only reimplement this new feature in it (whenever I get some time and motivation).
Comment 9 Jakub Moc (RETIRED) gentoo-dev 2006-03-16 05:06:25 UTC
*** Bug 126404 has been marked as a duplicate of this bug. ***
Comment 10 Mike 2006-04-13 11:42:05 UTC
Created attachment 84578 [details]
Another crack at euse in python

I also took a crack at this in python before checking for bugs and realizing this was already here.  It adds the functionality to enable/disable per package support in package.use using a new -k, --package <pkg> argument.  I also added flags for -i/-a for use.defaults and auto-use flags enabled based on packages installed.  There's still the problem with cascading profiles and overlays.  This is my first attempt at working with portage, so I'd consider this a first step if it gets used.  Sorry if you've already got this implemented in bash.
Comment 11 Jakub Moc (RETIRED) gentoo-dev 2007-04-10 17:24:56 UTC
*** Bug 174049 has been marked as a duplicate of this bug. ***
Comment 12 Jörg Walter 2008-10-06 17:46:00 UTC
Created attachment 167475 [details, diff]
a simple patch to to the existing euse to support per-package use flags

Here is a small patch that adds the requires functionality to the existing euse shell script. Applies cleanly against gentoolkit from portage and SVN trunk.

It works like this: Any command line argument that looks like a package specifier (sys-devel/gcc or \>=gcc-4) switches euse in package.use mode. As a convenience, short package names may be prefixed by a slash to disambiguate them from a use flag (e.g., /gcc). Short package names will be resolved to their full name.

All packages specified will have the requested use flag changes made in a clean fashion:
 - lines in package.use not matching the package(s) will not be modified
 - order is preserved
 - duplicate entries for one of the selected packages will be consolidated into one entry
 - if an entry has no use flags left (by using -P), the entry will be removed

Examples:

Disable the gcj and gtk flags for all versions of gcc:
  euse -D /gcc gcj gtk

Disable nls and X for some packages (no matter that some don't have X in their IUSE):
  euse -D /coreutils /util-linux /groff nls X

Make a gcc 3 installation rather minimal, since no one but qemu needs it anymore:
  euse -D \<gcc-4
Comment 13 Douglas Anderson 2009-02-19 09:04:51 UTC
(In reply to comment #12)

This is an interesting patch and a good idea. Unfortunately it doesn't take into account the fact that package.use can be a directory containing an arbitrary number of files, so it would need a bit more logic to handle that. Read the "/etc/portage" section in man portage.

Also I think this: 
> euse -D /coreutils /util-linux /groff nls X
is a bit hacky looking, personally. I think a better solution would be a -p, --packages option that takes a comma-separated list or package names, something like:

euse -D X   # disable flag X globally
euse -p coreutils,util-linux,groff -D X   # disable X for only certain packages

If you need this functionality now, flagedit supports it.
Comment 14 Jared Hancock 2009-08-09 21:50:44 UTC
I've done a lot of work for per-package use flags under bug #259318
Comment 15 Jared Hancock 2011-04-25 02:28:59 UTC
Can you verify this is implemented in gentoolkit-0.3.0?
Comment 16 Paul Varner (RETIRED) gentoo-dev 2011-06-15 04:46:16 UTC
This should be fixed in gentoolkit-0.3.0.4, if it isn't please reopen or file a new bug.