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

Bug 546726

Summary: =app-portage/gentoolkit- equery list exception when trying to use @set as pkgspec
Product: Gentoo Linux Reporter: Sergey S. Starikoff <Ikonta>
Component: Current packagesAssignee: Portage Tools Team <tools-portage>
Severity: normal CC: beelzebubbie.logs, esigra
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 346443    

Description Sergey S. Starikoff 2015-04-16 07:32:58 UTC
Trying to execute `equery list @system' (or @world) I've got a TypeError:
$ equery list @world
 * Searching for @world ...
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.3/equery", line 38, in <module>
  File "/usr/lib64/python3.3/site-packages/gentoolkit/equery/", line 357, in main
  File "/usr/lib64/python3.3/site-packages/gentoolkit/equery/", line 198, in main
    matches = query.smart_find(**QUERY_OPTS)
  File "/usr/lib64/python3.3/site-packages/gentoolkit/", line 164, in smart_find
    matches = self._do_set_lookup(show_progress=show_progress)
  File "/usr/lib64/python3.3/site-packages/gentoolkit/", line 366, in _do_set_lookup
  File "/usr/lib64/python3.3/site-packages/gentoolkit/", line 296, in _do_simple_lookup
    result = self.package_finder()
  File "/usr/lib64/python3.3/site-packages/gentoolkit/", line 211, in find_installed
    matches = portage.db[portage.root]["vartree"].dbapi.match(self.query)
  File "/usr/lib64/python3.3/site-packages/portage/dbapi/", line 533, in match
    self.cp_list(mydep.cp, use_cache=use_cache)))
  File "/usr/lib64/python3.3/site-packages/portage/dbapi/", line 136, in _iter_match
    cpv_iter = iter(match_from_list(atom, cpv_iter))
  File "/usr/lib64/python3.3/site-packages/portage/dep/", line 2092, in match_from_list
    if mydep == mycpv:
  File "/usr/lib64/python3.3/site-packages/gentoolkit/", line 69, in __eq__
    raise TypeError(err % (self.__class__, other.__class__))
TypeError: other isn't of <class 'gentoolkit.atom.Atom'> type, is <class 'portage.versions._pkg_str'>

Yes, I realize that use of @set as pkgname parameter isn't supported (though, it can be useful), but human-readable error message would be more appropriate than unhandled exception.

Also, 'equery list --help' provides format description:
Usage: list [options] pkgspec
But neither short help message, nor equery's manual page, nor nor portage or emerge manual pages provides info about _required_ argument 'pkgspec'.
Probably we should either change it to 'atom' or provide at least reference to a description of 'pkgspec' entry.

$ einfo 
Portage 2.2.14 (python 3.3.5-final-0, default/linux/amd64/13.0, gcc-4.8.4, glibc-2.20-r2, 3.18.9-aufs x86_64)
System uname: Linux-3.18.9-aufs-x86_64-AMD_Athlon-tm-_II_X2_250_Processor-with-gentoo-2.2
KiB Mem:     1794220 total,     29040 free
KiB Swap:    8000364 total,   7987460 free
Timestamp of tree: Mon, 13 Apr 2015 05:15:01 +0000
ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.2_p53
dev-java/java-config:     2.2.0
dev-lang/perl:            5.20.2
dev-lang/python:          2.7.9-r1, 3.3.5-r1
dev-util/pkgconfig:       0.28-r2
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.13.11
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6-r1, 1.13.4
sys-devel/binutils:       2.24-r3
sys-devel/gcc:            4.8.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.6
sys-devel/make:           4.1-r1
sys-kernel/linux-headers: 3.18 (virtual/os-headers)
sys-libs/glibc:           2.20-r2
Repositories: gentoo local_hdd
CFLAGS="-march=native -O2 -pipe"
CONFIG_PROTECT="/etc /etc/env.d /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O2 -pipe"
EMERGE_DEFAULT_OPTS="--ask --verbose --autounmask=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildsyspkg config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles merge-sync metadata-transfer news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="                     "
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
USE="X a52 ac3 acl alsa amd64 avi berkdb bold bzip2 cdr cli consolekit cracklib crypt cups cxx dbus djvu dri dvd flac fortran gdbm gif gtk iconv inotify jpeg jpeg2k libav lock mmx mmxext modules mp3 multilib ncurses nls nptl ogg openmp pam pcre pdf png policykit qt3support readline session sse sse2 ssl tcpd thunar tiff udev udisks unicode utf8 vorbis xcb xulrunner zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext popcnt sse sse2 sse3 sse4a" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="ru ru_RU" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby20" USERLAND="GNU" VIDEO_CARDS="radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Comment 1 Paul Varner (RETIRED) gentoo-dev 2015-06-02 20:49:01 UTC
Actually, equery list is supposed to support sets, so this is an actual bug in the set handling. I'm currently tracking what the bug actually is.
Comment 2 Paul Varner (RETIRED) gentoo-dev 2015-06-02 22:13:48 UTC
This is now fixed in git.  You can test with gentoolkit-9999

Working set support is actually quite cool, for example:

$ equery list @live-rebuild
 * Searching for @live-rebuild ...
[IP-] [  ] app-portage/epm-9999:0
[IP-] [  ] app-portage/esearch-9999:0
[IP-] [  ] app-portage/gentoolkit-9999:0
[IP-] [  ] app-portage/gentoolkit-dev-9999:0
[IP-] [  ] app-portage/layman-9999:0

$ equery list @unavailable
 * Searching for @unavailable ...
[I--] [??] sys-kernel/gentoo-sources-3.10.7:3.10.7
[I--] [??] sys-kernel/gentoo-sources-3.10.63:3.10.63
Comment 3 Juraj Variny 2016-01-26 23:33:48 UTC
Just ran into this, when it's going to be released?
(Sorry for stupid question. Maybe if you linked the git commit ID, I'd have figured it out myself.)
Comment 4 Paul Varner (RETIRED) gentoo-dev 2016-01-26 23:52:31 UTC
(In reply to Juraj Variny from comment #3)
> Just ran into this, when it's going to be released?

It is released in gentoolkit-0.3.1

However, revdep-rebuild changes to a new python version in that version so depending on why you are using ACCEPT_KEYWORDS="amd64", you may or may not want to keyword that package.