Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 491764

Summary: euse does not correctly handle package names containing numbers
Product: Portage Development Reporter: Yuri Shatroff <yks-uno>
Component: ToolsAssignee: Portage Tools Team <tools-portage>
Status: CONFIRMED ---    
Severity: normal CC: esigra, vikraman
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 346443    

Description Yuri Shatroff 2013-11-20 13:06:09 UTC
When invoking `euse -p` with a package name containing a number, e.g. sys-fs/lvm2, euse fails with an error: Invalid package atom.

# euse -p sys-fs/lvm2 thin
ERROR: Invalid package atom. Did you forget the leading '='?

Other gentoolkit tools e.g. equery, epkginfo do handle such names correctly.
Comment 1 Vikraman (RETIRED) gentoo-dev 2013-11-20 20:19:11 UTC
Looks like an issue with the regex. This fixes it:

diff --git i/bin/euse w/bin/euse
index 7d5c83a..e60cab0 100755
--- i/bin/euse
+++ w/bin/euse
@@ -1070,7 +1070,7 @@ scrub_use_flag() {
 modify_package() {
        get_useflags
 
-       local atom_re="^[<>]?=?([a-z][0-9a-z/-]+[a-z])(-[0-9pr._*-]+)?"
+       local atom_re="^[<>]?=?([a-z][0-9a-z/-]+[0-9a-z])(-[0-9pr._*-]+)?"
        local pkg=$(echo "${PACKAGE}" | sed -re "s/${atom_re}/\1/")
        local V=$(echo "${PACKAGE}" | sed -re "s/${atom_re}/\2/")
        local pkg_re="[<>]?=?${pkg}(-[\dpr._*-]+)?"
Comment 2 Vikraman (RETIRED) gentoo-dev 2013-11-20 20:40:08 UTC
Patch pushed to git.
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2013-11-21 01:53:14 UTC
fixed in commit: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=dc21831a9a058c8f3c110674c5d3dd0de757cb5c

It is available now in gentoolkit-9999.