When using "euse -I qt5" for example, if any enabled overlays/repos are lacking a use.desc file, there's a grep which fails, thowing an error and preventing later overlays from being checked. # euse -I qt5 global use flags (searching: qt5) ************************************************************ grep: /var/db/iamben-overlay/profiles/use.desc: No such file or directory no matching entries found local use flags (searching: qt5) ************************************************************ [+ D ] qt5 (media-video/vlc): Builds a Qt5 based frontend, a graphical interface (overrides qt4). # If I create an empty file there, the error goes away and it also is then able to find the later repo's (::gentoo's) use.desc successfully. # touch /var/db/iamben-overlay/profiles/use.desc # euse -I qt5 global use flags (searching: qt5) ************************************************************ [+ D ] /usr/portage/profiles/use.desc:qt5 - Add support for the Qt 5 application and UI framework Installed packages matching this USE flag: app-crypt/pinentry-1.0.0 app-crypt/qca-2.1.1-r1 app-text/poppler-0.49.0 dev-libs/libdbusmenu-qt-0.9.3_pre20160218 dev-util/cmake-3.7.1 media-libs/phonon-4.9.0 media-video/vlc-2.2.4 net-analyzer/wireshark-2.2.3 net-libs/telepathy-qt-0.9.7 net-wireless/wpa_supplicant-2.6-r1 sys-auth/polkit-qt-0.112.0-r1 local use flags (searching: qt5) ************************************************************ [+ D ] qt5 (media-video/vlc): Builds a Qt5 based frontend, a graphical interface (overrides qt4). #
On this version the failing grep is on line 845: if desc=$(grep "^${1} *-" ${PORTAGE_REPO_PATHS[@]/%//profiles/use.desc}); then Of course it will need to be silenced with 2>/dev/null. But also the code needs to continue checking later repos after one such failure, I'm not quite able to understand how this piece of code works to make that happen.
Bug still exists in gentoolkit-0.3.3
Bug still exists in gentoolkit-0.4.2-r1 and 0.4.5
Created attachment 616414 [details, diff] proposed patch What I found is that euse does a rough grep on a generated list of $repo/profiles/use.desc for all repos, without checking if they all exist. If any one of them in the list passed to grep is missing, the grep returns failure, even if there was a match in one of the other files that does exist. With this patch we move the grep out of the 'if' statement and then just test against the resulting list (not the return code of grep). Can you guys test & review?
Fixed in git