Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 317899 - gentoolkit-0.3.0_rc10-r1: equery -q size '*' traceback
Summary: gentoolkit-0.3.0_rc10-r1: equery -q size '*' traceback
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
: 335813 (view as bug list)
Depends on:
Blocks: 237964
  Show dependency tree
 
Reported: 2010-04-30 13:35 UTC by Igor Poboiko
Modified: 2010-11-22 22:03 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Igor Poboiko 2010-04-30 13:35:13 UTC
# equery -q size '*' >size
Traceback (most recent call last):
  File "/usr/bin/equery", line 38, in <module>
    equery.main()
  File "/usr/lib/python2.6/site-packages/gentoolkit/equery/__init__.py", line 345, in main
    loaded_module.main(module_args)
  File "/usr/lib/python2.6/site-packages/gentoolkit/equery/size.py", line 192, in main
    display_size(matches)
  File "/usr/lib/python2.6/site-packages/gentoolkit/equery/size.py", line 82, in display_size
    size, files, uncounted = pkg.size()
  File "/usr/lib/python2.6/site-packages/gentoolkit/package.py", line 343, in size
    file_inode = st.st_ino
UnboundLocalError: local variable 'st' referenced before assignment


Possible fix:
===
--- package.py.old      2010-04-30 16:29:08.000000000 +0300
+++ package.py  2010-04-30 16:21:57.000000000 +0300
@@ -337,7 +337,7 @@
                        try:
                                st = os.lstat(f)
                        except OSError:
-                               pass
+                               continue
 
                        # Remove hardlinks by checking for duplicate inodes. Bug #301026.
                        file_inode = st.st_ino



Reproducible: Always

Steps to Reproduce:
1. Run "equery -q size '*'"
2.
3. 

Actual Results:  
It crashes with this traceback

Expected Results:  
It shows size of all installed packages

$ emerge --info app-portage/gentoolkit
Portage 2.2_rc67 (default/linux/x86/10.0/desktop, gcc-4.3.3, glibc-2.11.1-r0, 2.6.33-gentoo-r1dv1400 i686)
=================================================================
                        System Settings
=================================================================
System uname: Linux-2.6.33-gentoo-r1dv1400-i686-Intel-R-_Celeron-R-_CPU_540_@_1.86GHz-with-gentoo-2.0.1
Timestamp of tree: Fri, 30 Apr 2010 07:30:02 +0000
app-shells/bash:     4.1_p5
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r1, 3.1.2-r2
dev-util/cmake:      2.8.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.8.5-r3, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1
sys-devel/gcc:       4.3.3-r2, 4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.33
ACCEPT_KEYWORDS="x86 ~x86"
ACCEPT_LICENSE="* -@EULA LOKI-EULA Q3AEULA sun-bcla-java-vm dlj-1.1 PUEL skype-eula"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe -ggdb"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /usr/share/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/splash /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=i686 -pipe -ggdb"
DISTDIR="/home/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://gentoo.iteam.net.ua/ http://mirror.leaseweb.com/gentoo/ ftp://de-mirror.org/distro/gentoo/"
LANG="ru_RU.UTF-8"
LC_ALL=""
LDFLAGS="-Wl,--as-needed"
LINGUAS="ru en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage /var/lib/layman/kde /var/lib/layman/roslin /var/lib/layman/rion"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr chm cli consolekit cracklib crypt ctype cups curl cxx dbus dcc_video dell djvu dri dts dvd dvdr emboss encode exif fam fbcon fbcondecor ffmpeg filter firefox flac fortran gdbm geoip gif glib gpm gstreamer hal handbook iconv icq imagemagick ipv6 jabber jpeg jpeg2k kde kipi kontact lame laptop lcms libnotify mad mikmod mjpeg mng modules mp3 mp4 mpeg mudflap mysql ncurses networkmanager nls nptl nptlonly ntfs ogg opengl openmp openssl oscar pam pango pcre pdf perl phonon pm-utils png policykit ppds pppd python qt-webkit qt3support qt4 readline reflection resolvconf samba sdl semantic-desktop session skype smbclient spell spl sql sqlite ssl startup-notification subversion svg sysfs taglib tcpd theora threads tiff truetype unicode usb utf8 v4l v4l2 vcd vim-syntax vnc vorbis wav webkit wicd wifi win32codecs wma x264 x86 xcb xml xmp xorg xscreensaver xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 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" ELIBC="glibc" INPUT_DEVICES="synaptics evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LINGUAS="ru en" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="nvidia" 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" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

app-portage/gentoolkit-0.3.0_rc10-r1 was built with the following:
USE=""
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2010-05-04 00:06:33 UTC
looks like there are 2 places to replace the 'pass' statement with 'continue'.

Also I noticed that there were a great number of pkgs that came up with 0 total files,...

So far I've traced it to an empty dblink.getcontents(), but testing it in a live python console seems to work for the same package.
Comment 2 Brian Dolbec (RETIRED) gentoo-dev 2010-05-04 07:25:32 UTC
It turned out, the 2nd problem was a regression due to the recent change I made in cpv.py to fix bug 316961  It seems that since pkgsplit returned a revision always (default is '-r0'), the version did not match due to the -r0.


brian@big_daddy ~/Dev/genscripts/gentoolkit $ svn commit pym/gentoolkit/package.py
Authentication realm: <https://genscripts.googlecode.com:443> Google Code Subversion Repository
Password for 'brian.dolbec': 
Sending        pym/gentoolkit/package.py
Transmitting file data .
Committed revision 432.

Fixed in the development repo, this fix should be included in the next _rc candidate.
Comment 3 Thomas Capricelli 2010-08-15 12:59:57 UTC
i have the same problem here:

equery size '*'
...
 * dev-cpp/pangomm-2.26.2
         Total files : 85
         Total size  : 1.05 MiB
Traceback (most recent call last):
  File "/usr/bin/equery", line 38, in <module>
    equery.main()
  File "/usr/lib64/python2.6/site-packages/gentoolkit/equery/__init__.py", line 345, in main
    loaded_module.main(module_args)
  File "/usr/lib64/python2.6/site-packages/gentoolkit/equery/size.py", line 192, in main
    display_size(matches)
  File "/usr/lib64/python2.6/site-packages/gentoolkit/equery/size.py", line 82, in display_size
    size, files, uncounted = pkg.size()
  File "/usr/lib64/python2.6/site-packages/gentoolkit/package.py", line 343, in size
    file_inode = st.st_ino
UnboundLocalError: local variable 'st' referenced before assignment
Comment 4 Zac Medico gentoo-dev 2010-09-06 17:33:17 UTC
*** Bug 335813 has been marked as a duplicate of this bug. ***
Comment 5 Paul Varner (RETIRED) gentoo-dev 2010-11-22 21:50:15 UTC
Released in gentoolkit-0.3.0_rc11
Comment 6 Thomas Capricelli 2010-11-22 22:03:49 UTC
Confirmed, thanks a lot!