Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 41093 - 'equery list' fails with missing ebuilds
Summary: 'equery list' fails with missing ebuilds
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Karl Trygve Kalleberg (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-10 03:30 UTC by Andre Hinrichs
Modified: 2004-09-01 14:08 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch for equery (gentoolkit-0.2.0-pre8) to handle missing ebuild exceptions (equery.patch,1.39 KB, patch)
2004-04-20 01:06 UTC, Craig Lawson
Details | Diff
Patch for gentoolkit.py (gentoolkit-0.2.0-pre8) for package lookup (gentoolkit.patch,652 bytes, patch)
2004-04-21 15:06 UTC, Craig Lawson
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andre Hinrichs 2004-02-10 03:30:38 UTC
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"
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2004-03-13 03:03:43 UTC
It doesn't traceback any longer in pre7, but the "missing ebuild" message is a portage thing and hard to work around.
Comment 2 alex f 2004-03-20 12:02:40 UTC
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)
Comment 3 Craig Lawson 2004-04-20 01:02:06 UTC
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.
Comment 4 Craig Lawson 2004-04-20 01:06:08 UTC
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]
Comment 5 Craig Lawson 2004-04-21 15:06:29 UTC
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]
Comment 6 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2004-08-28 03:03:56 UTC
Will look at it.
Comment 7 Karl Trygve Kalleberg (RETIRED) gentoo-dev 2004-09-01 14:08:31 UTC
Fixed in CVS. Will be part of the next Gentoolkit release.