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

Bug 109261

Summary: portage-2.0.53_rc5 emaint error on --check
Product: Gentoo Linux Reporter: Sandro Bonazzola (RETIRED) <sanchan>
Component: [OLD] Core systemAssignee: Portage team <dev-portage>
Status: VERIFIED FIXED    
Severity: major    
Priority: High    
Version: 2005.1   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 108082    
Attachments: Grab str(option) in exclusive()

Description Sandro Bonazzola (RETIRED) gentoo-dev 2005-10-14 04:07:41 UTC
step to reproduce:
~ # emaint --help
usage: emaint [options] all | world

options:
  -h, --help   show this help message and exit
  -c, --check  check for problems
  -f, --fix    attempt to fix problems

~ # emaint --check world
Attempting to fix world

~ # emaint --fix world
Attempting to fix world

Initially I've tought it could be a simple problem, something like 'same output
message for --check and --fix'. But looking inside emaint I found:

[quote]
if action == "-c/--check":
	status = "Checking %s for problems"
	func = "check"
else:
	status = "Attempting to fix %s"
	func = "fix"
[/quote]

I've tought it could be an OptionParser bug. So I've modified emaint to be sure:
[patch]
--- /usr/sbin/emaint    2005-10-11 20:09:26.000000000 +0200
+++ emaint      2005-10-14 10:28:23.000000000 +0200
@@ -91,7 +91,7 @@
 else:
        tasks = [modules[args[0]]]
 
-
+print action
 if action == "-c/--check":
        status = "Checking %s for problems"
        func = "check
[/patch]

but now:

~ # ./emaint --check world
-c/--check
Attempting to fix world

so action is '-c/--check'
but the if doesn't think so.
So, it's a serious problem.

trying with a
print repr(action)
I've : <Option at 0x-4812de54: -c/--check>

so action is actually an Option

trying with a
print repr(action.action)
I've: 'callback'

So it seems something like a circular reference introduced somewhere in the code.
Any idea?
Here is my actual emerge --info:



Gentoo Base System version 1.12.0_pre8
Portage 2.0.53_rc5 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r2,
2.6.13-gentoo-r3 i686)
=================================================================
System uname: 2.6.13-gentoo-r3 i686 Celeron (Coppermine)
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
dev-lang/python:     2.4.2
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS=" -march=pentium3 -O2 -pipe -fforce-addr -fomit-frame-pointer -ffast-math
-ftracer -fprefetch-loop-arrays -mfpmath=sse "
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/jetty/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c
/etc/env.d"
CXXFLAGS="  -march=pentium3 -O2 -pipe -fforce-addr -fomit-frame-pointer
-ffast-math -ftracer -fprefetch-loop-arrays -mfpmath=sse  -O2
-fvisibility-inlines-hidden "
DISTDIR="/home/ftp/distfiles"
FEATURES="autoconfig buildsyspkg collision-protect confcache cvs distlocks elog
maketest parallel-fetching sandbox sfperms strict test userpriv usersandbox"
GENTOO_MIRRORS="ftp://mirror.switch.ch/mirror/gentoo/
http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/
http://gentoo.osuosl.org/ ftp://ftp.solnet.ch/mirror/Gentoo"
LANG="it_IT.utf8"
LC_ALL="it_IT.utf8"
LDFLAGS=" -Wl,-O3 "
LINGUAS="it"
MAKEOPTS="-j1"
PKGDIR="/home/ftp/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X aac aalib acl acpi acpi4linux alsa apache2 arts audiofile avi berkdb
bitmap-fonts bzip2 bzlib caps cdparanoia chroot clamav crypt cups curl dba dio
directfb divx4linux emboss encode erandom esd faac faad fam fbcon ffmpeg firefox
flac foomaticdb gcc-libffi gd gdbm ggi gif gimpprint glibc-omitfp gmp gnokii
gnome gnomedb gnutls gphoto2 gpm graphviz gs gstreamer gtk gtk2 guile iconv
imagemagick imlib imlib2 innodb ipv6 irda ithreads java javacomm javascript jbig
jikes jpeg jpeg2k junit justify jython kde kdeenablefinal lcms libclamav libg++
libwww linuxthreads-tls lzo mad mailwrapper mbox md5sum mdb mikmod mime mjpeg
mmap mmx mmx2 mmxext mng motif mozcalendar mozdevelop moznoirc mozsvg mp3 mpeg
mpi mpm-worker mysql ncurses nls no-old-linux no-suexec no_wxgtk1 noantlr nobcel
nobeanutils nobsf nobsh nocommonslogging nocommonsnet nojdepend nojsch nomac
norhino noxalan noxerces nptl nptlonly oav objc odbc offensive ofx ogg oggvorbis
opengl pam pcmcia pcsc-lite pdflib perl php plotutils png pnp posix ppds pwdb
python qt quicktime readline rtc samba scanner sdl shared sharedmem slang
smartcard sms snmp softquota speex spell spl sse ssl svg svga tcltk tcpd test
tetex theora threads tidy tiff timidity truetype truetype-fonts trusted
type1-fonts unicode usb userlocales utf8 vcd vda vorbis win32codecs wmf
wsconvert xine xinerama xml xml2 xmms xpm xsl xv xvid yahoo zlib linguas_it
userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET
Comment 1 Jason Stubbs (RETIRED) gentoo-dev 2005-10-14 05:12:18 UTC
Created attachment 70652 [details, diff]
Grab str(option) in exclusive()

OptionParser is proving to be more trouble that it's worth. (But it was my
fault this time) :/
Comment 2 Sandro Bonazzola (RETIRED) gentoo-dev 2005-10-14 13:05:05 UTC
I can confirm that the submitted patch solve this bug,
Comment 3 Jason Stubbs (RETIRED) gentoo-dev 2005-10-19 07:46:55 UTC
Released in 2.0.53_rc6 
Comment 4 Sandro Bonazzola (RETIRED) gentoo-dev 2005-10-20 04:10:56 UTC
Verified, works fine for me, closing.