The 'equery list' command fails to work on packages where the ebuild scripts has been deleted. In my case this occures with gentoo-dev-sources because old versions are not deleted when a new version is installed. Reproducible: Always Steps to Reproduce: 1. install a package 2. wait a few days until this ebuild has been deleted or delete it manually 3. try 'equery list' on this package Actual Results: Script fails with the following error: Searching for package 'gentoo-dev-sources' in all categories among: * installed packages [I--] [ ] sys-kernel/gentoo-dev-sources-2.6.1-r1 (2.4.23-grsec-1.9.13) !!! aux_get(): ebuild for 'sys-kernel/gentoo-dev-sources-2.6.1' does not exist at: !!! /usr/portage/sys-kernel/gentoo-dev-sources/gentoo-dev-sources-2.6.1.ebuild Traceback (most recent call last): File "/usr/bin/equery", line 936, in ? if string.find(e[0], "Specific key requires operator") == 0: IndexError: tuple index out of range Expected Results: Should work even with missing ebuilds Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.4.22-gentoo-r5) ================================================================= System uname: 2.4.22-gentoo-r5 i686 Pentium III (Coppermine) Gentoo Base System version 1.4.3.13 distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled] Autoconf: sys-devel/autoconf-2.58 Automake: sys-devel/automake-1.7.7 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-O3 -march=i686 -funroll-loops -pipe" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3/share/config /usr/share/config /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /var/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" CXXFLAGS="-O3 -march=i686 -funroll-loops -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache distcc sandbox" GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/ http://ftp.snt.utwente.nl/pub/os/linux/gentoo" MAKEOPTS="-j3" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="" SYNC="rsync://192.168.68.1/gentoo-portage" USE="X Xaw3d aalib alsa apache2 apm arts avi berkdb bonobo cdr crypt cups curl dvd emacs encode esd flash foomaticdb gd gdbm ggi gif gnome gpm gtk gtk2 gtkhtml guile imlib java jpeg kde lcms ldap libg++ libwww mad mikmod motif mozilla mpeg mysql ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga tcltk tcpd tetex tiff truetype usb wmf x86 xml xml2 xmms xv zlib"
It doesn't traceback any longer in pre7, but the "missing ebuild" message is a portage thing and hard to work around.
Well, pre7 traces back as well for me. I stumbled over this bug while doing: $ equery -q list \* !!! aux_get(): ebuild for 'dev-util/subversion-0.26.0' does not exist at: !!! /usr/portage/dev-util/subversion/subversion-0.26.0.ebuild Traceback (most recent call last): File "/usr/bin/equery", line 949, in ? if e and type(e[0]) == types.ListType and \ IndexError: tuple index out of range 134 the aquivalent of 'qpkg -I' $ equery list gentoolkit Searching for package 'gentoolkit' in all categories among: * installed packages [I--] [ ] app-portage/gentoolkit-0.2.0_pre7 (0)
Does for me, too, in gentoolkit-0.2.0_pre8. The equery's depgraph function has the same problem. Although the missing ebuild message (as was stated) comes from the portage module, the unhandled exception can be dealt with in equery. The following patch does just that.
Created attachment 29681 [details, diff] Patch for equery (gentoolkit-0.2.0-pre8) to handle missing ebuild exceptions Patch catches KeyError exceptions raised by portage module when it discovers a missing ebuild. Although portage has already printed a warning (too bad), this patch allows equery to recover and continue rather than crash. To apply patch: 1. cd to same directory as equery file 2. "patch -p0 < [patch-file]
Created attachment 29777 [details, diff] Patch for gentoolkit.py (gentoolkit-0.2.0-pre8) for package lookup Fixes the gentoolkit module so that when retrieving environment variable data from an ebuild, it first checks portage's installed packages database. If the package is not installed, the data instead comes from the available packages database. Previous behavior was to only check the available packages database, and this was a problem when the package was so old that it's ebuild had been removed from the list of available packages. Other gentoolkit utilities affected by this change are: * etcat's graph (-g) function. Seems to work better with patch. * etcat's depends (-d) function. Broken before; no change. * equery's list function. No longer prints warning for missing ebuild. * equery's depgraph function. No longer prints warning for missing ebuild, *and* completes the entire tree. This patch is to be used with my previous patch for equery. To apply patch: 1. cd to same directory as gentoolkit.py file 2. "patch -p0 < [patch-file]
Will look at it.
Fixed in CVS. Will be part of the next Gentoolkit release.