Incorrect parsing of the package atom in euse, if the digit is at the end of the package name. Reproducible: Always Steps to Reproduce: euse -p sys-fs/lvm2 -D thin Actual Results: Adding "sys-fs/lvm2[-thin]" use flag in "/etc/portage/package.use" Expected Results: ERROR: Invalid package atom. Did you forget the leading '='? Maybe this fix, but I'm not sure that it will not break something else. --- /usr/bin/euse 2013-12-02 08:45:48.000000000 +0600 +++ /usr/bin/euse 2014-01-12 22:56:23.793372987 +0600 @@ -1015,7 +1015,7 @@ # Environment: # PACKAGE - Package atom for which to remove flag scrub_use_flag() { - local atom_re="^[<>]?=?([a-z][\da-z/-]+[a-z])(-[0-9pr._*-]+)?" + local atom_re="^[<>]?=?([a-z][\da-z/-]+[0-9a-z])(-[0-9pr._*-]+)?" local filename=${1} # Ignore leading - on flag local flag=${2#*-} @@ -1074,7 +1074,7 @@ 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._*-]+)?"
*** Bug 507356 has been marked as a duplicate of this bug. ***
In addition to not having a number at the end, it also does not account for: having + on the end (i.e. x11-libs/gtk+ ) containing a _ in the package name (i.e. net-wireless/wpa_supplicant) Perhaps a way too hook into the portage API would be better? Something with portageq perhaps?