Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 602962 - app-portage/gentoolkit-0.3.2-r1 "euse -I flag" errors if any enabled repos are lacking profiles/use.desc
Summary: app-portage/gentoolkit-0.3.2-r1 "euse -I flag" errors if any enabled repos ar...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-17 20:56 UTC by Ben Kohler
Modified: 2020-05-07 15:41 UTC (History)
2 users (show)

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


Attachments
proposed patch (gentoolkit-euse-usedesc.patch.txt,513 bytes, patch)
2020-02-28 12:35 UTC, Ben Kohler
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Kohler gentoo-dev 2016-12-17 20:56:39 UTC
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).

#
Comment 1 Ben Kohler gentoo-dev 2016-12-17 20:58:36 UTC
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.
Comment 2 matt black 2016-12-31 06:13:59 UTC
Bug still exists in gentoolkit-0.3.3
Comment 3 UlvHare 2019-05-23 07:17:07 UTC
Bug still exists in gentoolkit-0.4.2-r1 and 0.4.5
Comment 4 Ben Kohler gentoo-dev 2020-02-28 12:35:10 UTC
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?
Comment 5 Ben Kohler gentoo-dev 2020-03-16 14:24:35 UTC
Fixed in git