Code: Select all
myUSE=$(grep 'USE=".*"' /etc/portage/make.conf | tr -d '#USE="-')
myARR=( $myUSE )
#echo ${myARR[@]}
for i in ${myARR[@]};do
quse $i > /dev/null && echo $i seems valid || echo $i seems invalid
done

It is not a good idea to put use flags in make.conf. My USE var in make.conf contains exactly 3 entries at the moment, all of them with - in front. Inspired by your post I reviewed them and concluded I didn't need another 5 of them, one being -cdr which turned out to not be a global one, having a different meaning for one package. The rest are all in /etc/portage/package.useRayDude wrote:You know, over the years USE flags come and go. I add one that was asked for and years later it disappears, but it's still in my make.conf.
Is there an easy way to validate my USE flags?

Hi Georgi.logrusx wrote: It is not a good idea to put use flags in make.conf. My USE var in make.conf contains exactly 3 entries at the moment, all of them with - in front. Inspired by your post I reviewed them and concluded I didn't need another 5 of them, one being -cdr which turned out to not be a global one, having a different meaning for one package. The rest are all in /etc/portage/package.use
Keep them in /etc/portage/package.use, this way you'll know they won't affect other packages.
Best Regards,
Georgi
Code: Select all
lenny ~ # ls /etc/portage/package.use/
avahi cross-aarch64-unknown-linux-gnu freetype libdrm libsdl2 pulseaudio qtpositioning zlib
boost dnsmasq gnutls libpcre2 libvpx pyside2 spice-gtk
chrony ffmpeg kicad libplacebo nettle qemu texlive-core
cogl file libdbusmenu libreoffice pipewire qtmultimedia wxGTKThanks for telling me about portpeek. I ran it and am getting reams of errors.CaptainBlood wrote:app-portage/portpeek maintains /etc/portage/package.*
I don't recall it will do anything in make.conf
It should be easy to check adding a dummy flag to USE="..." in /etc/portage/make.conf
Thks 4 ur attention, interest & support.
Thanks much!alamahant wrote:I just wrote a few commands.
Try something likeCode: Select all
myUSE=$(grep 'USE=".*"' /etc/portage/make.conf | tr -d '#USE="-') myARR=( $myUSE ) #echo ${myARR[@]} for i in ${myARR[@]};do quse $i > /dev/null && echo $i seems valid || echo $i seems invalid done
Code: Select all
#!/bin/bash
myUSE=$(emerge --info | grep -oP 'USE="\K[^"]+')
myARR=( $myUSE )
#echo "myuse is ${myARR[@]}"
for i in ${myARR[@]};do
quse $i > /dev/null || echo $i seems invalid
doneCode: Select all
64bit X a52 aac aalib acl acpi activities alsa amd64 ao aspell audio audiofile autostart avahi avi bash-completion bittorrent bluetooth bluray boost botan branding bzip2 cairo caps cdda cddb cdio cdparanoia cdr cdrom cdsound cec cgi clang cleartype cli cmake connection-sharing corefonts crypt css csv cups curl cxx dbus declarative device-mapper dri dts dv dvd dvdr egl elogind encode exif extras faac faad fat fax fbcon ffmpeg fftw fits flac fontconfig fontforge fortran ftp fuse games gd gdbm gecko gif gimp git glib gnome gphoto2 gpm gtk gtk2 gui hal hpcups hpijs html http httpd iconv icu id3 id3tag imagecache imap inotify iproute2 ipv6 irda ithreads jack jadetex java jpeg jpeg2k kde kwallet lame lcms libass libnotify libtirpc live logrotate logviewer lua lzo mad maildir matroska mikmod mim minizip mjpeg mng mod modplug mozilla mp3 mp4 mpd mpeg mplayer multilib multimedia musicbrainz mysql ncurses net network networkmanager nfs nfsv4 nftables nls nptl nsplugin nss ogg ogg123 ogm openal opengl openmp oxygen pam pango pcre pdf perl phonon php pipewire plasma png policykit posix postscript ppds profile pulseaudio pvr python qemu qml qt5 quicktime rar raw rdp readline real rendering resolvconf rtmp rtsp sasl scanner screencast sdl sdl-image seccomp semantic-desktop server session sftp sms sound spell split-usr sql ssl startup-notification stream suid svg syslog taglib tcl test-rust theora thesaurus threads tidy tiff tinfo tk truetype twolame udev udisks unicode unzip upnp upower usb v4l v4l2 vcd vhost-net vhosts video vnc vorbis vpx vulkan wav wavpack wayland webcam webserver widgets wma wxwidgets x264 x265 xattr xcb xcomposite xft xml xml2 xmltv xv xvid yahoo zeroconf zip zlibCode: Select all
#!/bin/bash
myUSE=$(emerge --info | grep -oP 'USE="\K[^"]+')
myARR=( $myUSE )
#echo "initial USE = ${myARR[@]}"
for i in ${myARR[@]};do
quse $i > /dev/null || myUSE=${myUSE//$i/}
done
echo "optimized USE = $(echo $myUSE | xargs)"Per man portage, you can use wildcards in package.use. In the extreme case, you can write */* doc to enable USE=doc on everything, as if you had USE="doc" in make.conf. That is arguably slightly better than putting it in make.conf, since it means all your settings are in one place (package.use) instead of split between that and make.conf. You can also do less extreme globs, like games-action/* doc to install documentation for all your games, but not for any of your development libraries.RayDude wrote:However, it seems ridiculous to list qt5 for every package that needs it in package.use.
Is there some usage model of USE that I don't know about?
I have. -qt5RayDude wrote:
I mean, do you really have no global USE in your make.conf?
This is not the way to go. When you're being asked for something, by default you add it in package.use. Of course you add things like qt5 in make.conf unless it's about a couple of packages. But that usually happens when you've already emerged those packages with the use flag disabled. If they were new to emerge, portage would've emerged them with the appropriate use flags. For cases like that I use USE=... on the command line. Portage won't do it on its own otherwise because it doesn't know what you want. But when you instruct it to do so it'll keep the settings as they are to satisfy the dependency graph.RayDude wrote: I add one that was asked for
When portage asks me to add a USE for a package requirement, I always put it in /etc/portage/package.use/This is not the way to go. When you're being asked for something, by default you add it in package.use.
I get what you are saying, but I don't understand the advantage of putting it in package.use as a */* versus in make.conf as a global.Hu wrote:Per man portage, you can use wildcards in package.use. In the extreme case, you can write */* doc to enable USE=doc on everything, as if you had USE="doc" in make.conf. That is arguably slightly better than putting it in make.conf, since it means all your settings are in one place (package.use) instead of split between that and make.conf. You can also do less extreme globs, like games-action/* doc to install documentation for all your games, but not for any of your development libraries.RayDude wrote:However, it seems ridiculous to list qt5 for every package that needs it in package.use.
Is there some usage model of USE that I don't know about?
Start by commenting out the USE line in your make.conf and run emerge -DUav @world, see where it goes from there. For example I had added vaapi and vdpau in my make.conf and when I commented it out, it turned out only 4 packages in total were affected.RayDude wrote: I'm just not sure how I should transition my global USE to package.use.
What do you mean by that?RayDude wrote: Again. I'm just not understanding the underlying principals for using USE variables.
Okay. I'll do that when I have some free time.logrusx wrote:Start by commenting out the USE line in your make.conf and run emerge -DUav @world, see where it goes from there. For example I had added vaapi and vdpau in my make.conf and when I commented it out, it turned out only 4 packages in total were affected.RayDude wrote: I'm just not sure how I should transition my global USE to package.use.
If it's too much to handle at once, start be commenting out use flags one by one or in groups. For example, comment out half the use flags and see where it goes.
What do you mean by that?RayDude wrote: Again. I'm just not understanding the underlying principals for using USE variables.
Best Regards,
Georgi
Thanks.pietinger wrote:RayDude,
A (very) long time ago it was only possible to set the use flags in make.conf. But this has a disadvantage: If a certain use-flag is understood by several applications, but should not apply to all of them, then you would still have to use different names ... mysql1 mysql2 mysql3 ... not very elegant. So Gentoo has created the possibility to allow use-flags only for a specific application.
The best example where you really need it is: "static". You don't want to build all applications this way, but if you need "busybox" for your initramfs you probably want to build it WITH "static".
(Example: https://wiki.gentoo.org/wiki/Early_User ... quirements )
For all use-flags that apply globally, you can still set them in make.conf (I do it this way too).
Use flags are not system generic. I'm not sure if they ever were. I think back when I used Gentoo before 2010, make.conf was still the only place to set them, but they were not system generic, they were applied to individual packages. They control build configuration options. They control dependencies. For example when you enable gtk4 on something it'll require gtk4 to be installed and will link against it. Think the options you pass to configure scripts. They can also control other tasks in the build/install process. They can control application of patches for example. Portage takes actions according to their presence.RayDude wrote:
To me, USE is set to tell Gentoo what options I want for building the world. Things like plasma, wayland, alsa, etc. That's why USE was set in the make.conf file, right?
If you guys are telling me that I should control the USE on a per package basis, the implication is that USE variables are more package specific than system generic.
The disadvantage is for example you asking how to clean themRayDude wrote:What is the disadvantage to setting USE in make.conf? Why is that bad?
Yeah, so once you enable gtk4 for one package on your system it pulls gtk4 in. At this point, it kinda makes sense to let all other packages that can use gtk4 to link against it too, don't you think?They control dependencies. For example when you enable gtk4 on something it'll require gtk4 to be installed and will link against it.
If using gtk4 makes sense, it's already the default. If you want to make it global for whatever reason - go ahead. Guaranteed, such an approach will bring you surprises.szatox wrote:Yeah, so once you enable gtk4 for one package on your system it pulls gtk4 in. At this point, it kinda makes sense to let all other packages that can use gtk4 to link against it too, don't you think?They control dependencies. For example when you enable gtk4 on something it'll require gtk4 to be installed and will link against it.
Hu wrote:As a counterexample with regard to gtk+, at one time net-analyzer/nmap accepted USE=gtk to build a GUI, in addition to the CLI. For users who only need the CLI, disabling USE=gtk skipped building a program they would not use. It looks like it no longer recognizes that flag. I have not used nmap since before that was changed, so I only noticed this removal when writing this post.
Code: Select all
- - zenmap : Install the GTK+ based nmap GUI, zenmap