Flagedit
From Gentoo Linux Wiki
Contents |
[edit] What is Flagedit?
Flagedit is a simple application for setting useflags and keywords on a global or per-package basis. It's also a great timesaver.
[edit] Installing flagedit
emerge -av app-portage/flagedit
That's it! It'll pull in some dependencies, might take a while on some old machines since there are quite a few perl modules it depends on.
[edit] Using flagedit
[edit] Globally
In the simplest case
flagedit
This lists all the global useflags (the combination of make.conf and your relevant make.profile). It's intelligent and works out everything properly, make.conf flags take priority over make.defaults.
Assuming you liked gnome and wanted to add it to make.conf, you would just do this
flagedit +gnome
And you'd probably want to remove kde from your flags.
flagedit -kde
Or as one command
flagedit -kde +gnome
Already a great timesaver huh?
[edit] Locally
For this example we'll choose gaim
emerge -pvO gaim
On my system I get this:
[ebuild R ] net-im/gaim-2.0.0_beta6 USE="crypt custom-cflags gtk msn nls perl spell ssl xscreensaver -avahi -bonjour -cjk -console -dbus -debug -doc -eds -gadu -gnutls -groupwise -gstreamer -meanwhile -mono -qq -sasl -silc -startup-notification -tcl -tk" 0 kB
Now those option are ideal for me, but some of you might want gadugadu support, and perhaps evolution integration (eds)
flagedit net-im/gaim gadu eds
Notice that the + is implicit now we're setting flags locally, we could prefix it with a plus if we so desired however.
Good practice would say that if we wanted to remove a flag from a package and that flag isn't in make.conf or make.profile, we should just do this
flagedit net-im/gaim %msn
Since it's not a global flag, this removes it from the package by resetting it to the default.
On the other hand, I have nls in my make.conf and while I'd be stupid to remove it for the gaim package, I could do that like this:
flagedit net-im/gaim -nls
[edit] Unkeywording packages
Flagedit can also edit keywords, either locally or for a given package. Here's how we'd set ACCEPT_KEYWORDS in make.conf to include ~x86.
flagedit -- +~x86
Magic. But it's typically more useful if you're running a stable system and want to un-keymask a specific package
flagedit net-im/gaim -- +~x86
Finally you can mix keywords and useflags
flagedit net-im/gaim +eds -msn -- -~x86
However, consider unmasking one package per version. Otherwise your system might become unstable and break at a subsequent emerge -DNu world.
flagedit =media-video/recordmydesktop-0.3.5.1 -- ~x86
Personally, I find it useful to use flagedit in combination with eix. Using eix, first find the exact package name and version. Then, it is easy to accomodate the flagedit syntax.
[edit] Conclusions
So flagedit is a great timesaver, no more editing package.use or package.unmask
[edit] Notes
There is also a great application for editing use flags. It is called ufed. It shows table with flags, there descriptions and in which file they are set. It allows to search and set/unset use flags. I like this app very much.
There is also another great application for editing use flags. It is called profuse. It comes with console and graphical interface (gtk2). It gives more information than ufed about flags, especially the local use flags. It allows to search and set/unset use flags
