Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34877 - An "emerge --skipfirst --resume" failed with a Python error after an "emerge -uU world" interrupted because of lack of disk space. Includes fix.
Summary: An "emerge --skipfirst --resume" failed with a Python error after an "emerge ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2003-12-02 04:18 UTC by Yves-Eric Martin
Modified: 2011-10-30 22:19 UTC (History)
0 users

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 Yves-Eric Martin 2003-12-02 04:18:42 UTC
An "emerge -uU world" failed because of lack of disk space. I tried an "emerge -
-resume --skipfirst" to skip the big package, but got the following Python 
error:

Traceback (most recent call last): 
  File "/usr/bin/emerge", line 2086, in ? 
    del myresumeopts["--skipfirst"] 
TypeError: sequence index must be integer

It looks to me like line 2086 of /usr/bin/emerge should rather read:

    myresumeopts.remove("--skipfirst")

Replacing that line as shown above solved the problem.

Note: it seems like this line of /usr/bin/emerge is not executed under normal 
circumstances: I tried reproducing the problem by simply interrupting the first 
emerge with Ctrl-C, but then the problem did not occur. Portage probably messed 
up its internal state because of the lack of disk space, and ended up having to 
run that line.

Reproducible: Couldn't Reproduce
Steps to Reproduce:
1. emerge -uU world
2. Interruption because of lack of disk space
3. Clean up to recover disk space
4. emerge --resume --skipfirst
Actual Results:  
Traceback (most recent call last): 
  File "/usr/bin/emerge", line 2086, in ? 
    del myresumeopts["--skipfirst"] 
TypeError: sequence index must be integer

Expected Results:  
emerge should resume and skip the first package.

Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3, 2.4.20-gentoo-
r7)
=================================================================
System uname: 2.4.20-gentoo-r7 i686 Mobile Pentium II
Gentoo Base System version 1.4.3.10p1
distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[enabled]
ccache version 2.3 [enabled]
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -mcpu=pentium2 -march=pentium2 -pipe -fomit-frame-pointer -funroll-
loops -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -falign-functions=4 -
mmmx"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /var/qmail/control /usr/kde/2/share/config /usr/kde/3/share
/config /usr/X11R6/lib/X11/xkb /usr/kde/3.1/share/config /usr/share/config"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-O3 -mcpu=pentium2 -march=pentium2 -pipe -fomit-frame-pointer -
funroll-loops -fforce-addr -frerun-cse-after-loop -frerun-loop-opt -falign-
functions=4 -mmmx"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache autoaddcvs distcc sandbox userpriv strict"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu 
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 avi crypt encode foomaticdb gif jpeg libg++ libwww mad mikmod mpeg 
ncurses nls pdflib png quicktime spell truetype xml2 xmms xv zlib directfb 
gtkhtml alsa gdbm berkdb slang readline arts svga tcltk java guile X sdl gpm 
tcpd pam ssl perl python esd imlib oggvorbis gtk qt kde motif opengl ldap acpi 
acpi4linux canna cjk cscope curl dga fbcon fbdev gtk2 imap junit maildir 
memlimit oav pcmcia pic pnp samba tiff usb v4l vim-with-x -oss -apm -cups -
gnome -bonobo"
Comment 1 Yves-Eric Martin 2003-12-02 04:34:39 UTC
If the intent of the line at fault is to remove any "--skipfirst" from "myresumeopts", the following fix would be more robust:

while "--skipfirst" in myresumeopts: 
    myresumeopts.remove("--skipfirst")
Comment 2 Nicholas Jones (RETIRED) gentoo-dev 2003-12-10 04:53:36 UTC
Portage doesn't allow duplicates into the final myopts.
And I'm not exactly sure why your fix works and the del
doesn't. They have the same effect.
Comment 3 Yves-Eric Martin 2003-12-17 20:37:17 UTC
In the erroring line, it is not the 'del' that does not work, but the 'myresumeopts["--skipfirst"]'. This does not work because myresumeopts is a sequence, and sequence elements are accessed by their index (integer). The interpreter expects an integer between the '[]', but instead finds the string '"--skipfirst"', an therefore, it errors out with a TypeError.

The code could be written using a 'del' as follows, but it is quite ugly:

    del myresumeopts[myresumeopts.index("--skipfirst")]

Anyway, thank you for puting the corrected code into CVS.
Comment 4 Marius Mauch (RETIRED) gentoo-dev 2004-02-08 17:55:07 UTC
supposed to be fixed in 2.0.50 which is stable now. If this bug is not fixed please reopen.