Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 65571 - package size calculation out of bounds
Summary: package size calculation out of bounds
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-27 12:49 UTC by crusaderky
Modified: 2004-09-30 12:14 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 crusaderky 2004-09-27 12:49:33 UTC
#emerge -pve world
**CUT**
[ebuild  N    ] sys-cluster/lam-mpi-7.0.6  +crypt  5,617 kB
[ebuild  N    ] net-irc/xchat-2.0.10-r3  -debug +ipv6 +mmx +nls +perl +python +ssl +tcltk -xchatdccserver -xchatnogtk +xchattext  1,098 kB
[ebuild  N    ] net-analyzer/tcpdump-3.8.3-r1  -debug +ipv6 +ssl  553 kB

Traceback (most recent call last):
  File "/usr/bin/emerge", line 2583, in ?
    mydepgraph.display(mydepgraph.altlist())
  File "/usr/bin/emerge", line 1379, in display
    print "Total size of downloads: "+format_size(totalsize)
TypeError: cannot concatenate 'str' and 'long' objects
Comment 1 Sven Wegener gentoo-dev 2004-09-27 14:57:31 UTC
Please provide the output of emerge --info
Comment 2 crusaderky 2004-09-27 15:00:00 UTC
$ emerge info
Portage 2.0.50-r11 (default-x86-1.4, gcc-3.3.4, glibc-2.3.3.20040420-r1, 2.6.8-gentoo-r3)
=================================================================
System uname: 2.6.8-gentoo-r3 i686 AMD Athlon(TM) XP 2000+
Gentoo Base System version 1.4.16
Autoconf: sys-devel/autoconf-2.59-r4
Automake: sys-devel/automake-1.8.5-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O3 -pipe -march=athlon-xp -fforce-addr -fomit-frame-pointer -falign-functions=4 -mfpmath=sse"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/share/config:/usr/kde/3.3/env:/usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -pipe -march=athlon-xp -fforce-addr -fomit-frame-pointer -falign-functions=4 -mfpmath=sse"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache digest distcc fixpackages sandbox userpriv"
GENTOO_MIRRORS="http://gentoo.osuosl.org http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X X509 aalib alsa apache2 apm avi berkdb bitmap-fonts bonobo cdparanoia cdr chroot crypt cscope cups curl dga directfb doc dv dvb dvd dvdr encode erandom esd extensions faad fbcon flac flash foomaticdb gd gdbm ggi gif gimpprint gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml guile ieee1394 imap imlib innodb ipv6 java jikes joystick jpeg kde kerberos krb4 lcms ldap libcaca libg++ libwww linguas_it live lzo mad mcal md5sum memlimit mikmod mmx mng motif mozilla moznoirc mozp3p mozsvg mpeg mpi mysql ncurses network nls nptl nvidia odbc offensive oggvorbis opengl pam parse-clocks pdflib perl pic png ppds prelude python qt quicktime readline rtc samba scanner sdl skey slang slp sndfile snmp socks5 speex spell sqlite sse ssl svga tcltk tcpd tetex tga theora tiff truetype usb v4l v4l2 vim-with-x wmf wxwindows x86 xchattext xml xml2 xmms xprint xv xvid yazzlib"

Comment 3 Nicholas Jones (RETIRED) gentoo-dev 2004-09-29 17:38:09 UTC
In no case can that code ever return a long.
It explictly casts the concatenated types to strings.
I'd investigate your CFLAGS and remerge python.

def format_size(mysize):
  if type(mysize) not in [types.IntType,types.LongType]:
    return str(mysize)
  mystr=str(mysize/1024)
  mycount=len(mystr)
  while (mycount > 3):
    mycount-=3
    mystr=mystr[:mycount]+","+mystr[mycount:]
  return mystr+" kB"
Comment 4 crusaderky 2004-09-30 12:14:13 UTC
I've recompiled python and now it works.
I've never changed my CFLAGS in the past 6 months, anyway.