Bug 188678 - app-portage/gentoolkit: equery reports packages keyword masked if KEYWORDS="-*", even if KEYWORDS="${ARCH}" is also present
Bug#: 188678 Product:  Portage Development Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: tools-portage@gentoo.org Reported By: carenas@sajinet.com.pe
Component: Tools
URL: 
Summary: app-portage/gentoolkit: equery reports packages keyword masked if KEYWORDS="-*", even if KEYWORDS="${ARCH}" is also present
Keywords:  InSVN
Status Whiteboard: 
Opened: 2007-08-13 03:16 0000
Description:   Opened: 2007-08-13 03:16 0000
several core (and not so core) ebuilds have a KEYWORDS entry like (as copied
from sys-libs/glibc-2.5-r4)

KEYWORDS="-* alpha amd64 arm hppa ia64 mips ppc ppc64 ~s390 sh sparc x86"

so that all supported architectures had to be unmasked explicitly, but the
logic used in equery's _get_mask_status gets confused by the use of "-*" and
indicates the package is otherwise keyword masked


Reproducible: Always

Steps to Reproduce:
1. using "amd64" or "x86" (as an example, but ~amd64 or others could be used as
well with different packages)
2. equery -N list | grep glibc
3. look at the MASK status (second field in square brackets)

Actual Results:  
$ equery -N list | grep glibc
[I--] [ -] sys-libs/glibc-2.5-r4 (2.2)

Expected Results:  
$ ./equery -N list | grep glibc
[I--] [  ] sys-libs/glibc-2.5-r4 (2.2)

present in both "amd64" and "~amd64" as well as the HEAD of the svn version

------- Comment #1 From Carlo Marcelo Arenas Belon 2007-08-13 03:22:50 0000 -------
Created an attachment (id=127920) [details]
a patch to HEAD in svn (currently version 431) with a fix 

tested in "amd64", but most likely working for all other ARCH.

a more complete patch should ideally also invert the order of the "-*" check so
that it is clear that it is used as a last resource.

the construction with "pkgmask = pkmask + 0" is not really doing anything but
was added as it helped keep the change minimal and was self documenting but
could be replaced with some refactored logic and some comments instead for code
efficiency

------- Comment #2 From Carlo Marcelo Arenas Belon 2007-08-13 04:06:03 0000 -------
Created an attachment (id=127921) [details]
a patch to the stable amd64 version (based on 0.2.3-r1) with a slightly
refactored logic

tested in "amd64" and with slight modifications (a patch name change since the
epatch uses ${PV} to keep consistency with what is used in 0.2.3-r1) also in
"~amd64"

------- Comment #3 From Carlo Marcelo Arenas Belon 2007-09-16 03:58:45 0000 -------
gentoolkit-0.2.4_pre7 still affected by this bug,

these problem was apparently reported in bug 121220 for gentoolkit-0.2.1

------- Comment #4 From Carlo Marcelo Arenas Belon 2007-09-16 04:40:26 0000 -------
Created an attachment (id=131030) [details]
if package is marked stable, skip looking for masking hints

applies against current HEAD in svn (version 440) and also to current unstable
package: gentoolkit-0.2.4_pre7

------- Comment #5 From Paul Varner 2007-09-18 21:51:58 0000 -------
$ svn commit -m "Apply patch from Carlo Marcelo Arenas Belon to fix incorrect
display of masking status in equery list command. (Bug #188678)"
Sending        ChangeLog
Sending        src/equery/equery
Transmitting file data ..
Committed revision 443.

------- Comment #6 From Paul Varner 2007-09-27 00:19:58 0000 -------
Fixed in gentoolkit-0.2.4_rc1

------- Comment #7 From Michael A. Smith 2008-02-29 22:02:40 0000 -------
*** Bug 121220 has been marked as a duplicate of this bug. ***