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

Bug 568752

Summary: app-portage/gentoolkit-0.3.1 revdep-rebuild fails with "ValueError: too many values to unpack (expected 5)"
Product: Gentoo Linux Reporter: Marco Napetti <marco.napetti>
Component: Current packagesAssignee: Portage Tools Team <tools-portage>
Status: RESOLVED FIXED    
Severity: normal CC: jstein, jwbraun, mgorny
Priority: Normal Keywords: InVCS
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Marco Napetti 2015-12-19 11:14:02 UTC
After upgrade to new python revdep-rebuild, if fails everytime with:

 * This is the new python coded version
 * Please report any bugs found using it.
 * The original revdep-rebuild script is installed as revdep-rebuild.sh
 * Please files bugs at: https://bugs.gentoo.org/
Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/revdep-rebuild", line 40, in <module>
    success = rebuild.main(rebuild.parse_options())
  File "/usr/lib64/python3.4/site-packages/gentoolkit/revdep_rebuild/rebuild.py", line 151, in main
    _libs_to_check=_libs_to_check)
  File "/usr/lib64/python3.4/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 346, in analyse
    logger, searchbits)
  File "/usr/lib64/python3.4/site-packages/gentoolkit/revdep_rebuild/analyse.py", line 47, in scan_files
    filename, sfilename, soname, needed, bits = parts
ValueError: too many values to unpack (expected 5)

It happens with both python2.7 and python3.4

Reproducible: Always

Steps to Reproduce:
1.launch revdep-rebuild
2.
3.



emerge --info gentoolkit
Portage 2.2.26 (python 3.4.3-final-0, default/linux/amd64/13.0/desktop/plasma, gcc-5.3.0, glibc-2.22-r1, 4.3.2-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.3.2-gentoo-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_6000+-with-gentoo-2.2
KiB Mem:     2055456 total,    134256 free
KiB Swap:    8393924 total,   7893572 free
Timestamp of repository gentoo: Sat, 19 Dec 2015 09:00:01 +0000
sh bash 4.3_p42
ld ld di GNU (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.22.0::gentoo
dev-lang/python:          2.7.11-r1::gentoo, 3.4.3-r6::gentoo
dev-util/cmake:           3.4.1::gentoo
dev-util/pkgconfig:       0.29::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.19.1::gentoo
sys-apps/sandbox:         2.10::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.14.1-r1::gentoo, 1.15-r1::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            5.3.0::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.3::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

bliss-overlay
    location: /var/lib/layman/bliss-overlay
    sync-type: laymansync
    sync-uri: https://github.com/fearedbliss/bliss-overlay.git
    masters: gentoo
    priority: 50

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: git://anongit.gentoo.org/proj/kde.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: git://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA skype-4.0.0.7-copyright AdobeFlash-11.x google-chrome Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -pipe -O2"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -pipe -O2"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --quiet-build=y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="it_IT.UTF-8"
LC_ALL="it_IT.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/home/portage"
USE="X a52 aac acl acpi alsa amd64 berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpm gtk iconv ipv6 jpeg kipi lcms ldap libnotify mad mmx mmxext mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qml qt3support qt5 readline sdl seccomp semantic-desktop session spell sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vorbis widgets wxwidgets x264 xattr xcb xcomposite xinerama xml xscreensaver xv xvid zlib" ABI_X86="64 32" ALSA_CARDS="emu10k1" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_core authn_dbd authn_dbm authn_default authn_file authz_dbm authz_core authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif slotmem_shm so speling status socache_shmcb unique_id unixd userdir usertrack vhost_alias" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 sse3" DVB_CARDS="tda10046" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="it" LIRC_DEVICES="livedrive_midi" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby22" SANE_BACKENDS="epson2" USERLAND="GNU" VIDEO_CARDS="radeon r600" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

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

app-portage/gentoolkit-0.3.1::gentoo was built with the following:
USE="" ABI_X86="64" PYTHON_TARGETS="python2_7 python3_4 -pypy -python3_3 -python3_5"
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2015-12-19 16:09:28 UTC
That is a strange one.  Especially since we explicitly tell scanelf to use a format with 5 items in it.

We have a spot just before the line that gave you that error that checks for the line having less than 5 parts.

Can you please edit that file:

/usr/lib64/python3.4/site-packages/gentoolkit/revdep_rebuild/analyse.py

		if len(parts) < 5:
			logger.error("\tscan_files(); error processing lib: %s" % line)
			logger.error("\tscan_files(); parts = %s" % str(parts))
			continue
		filename, sfilename, soname, needed, bits = parts


Please change line 43 "if len(parts) < 5:" to "if len(parts) != 5:"

then re-run and post the lines that it reports are in error.

That should fix it from tracebacking for you, it will just report that line in error and continue with the rebuild.  I've had empty results, but never a result that had more than 5 parts before, so didn't account for that possibility.
Comment 2 Zac Medico gentoo-dev 2015-12-19 17:48:29 UTC
(In reply to Brian Dolbec from comment #1)
> That is a strange one.  Especially since we explicitly tell scanelf to use a
> format with 5 items in it.

It's possible for %F to contain spaces, so that's probably it. We should probably use a different delimiter in for format string, like '%F;%f;%S;%n;%M' or something like that.
Comment 3 Brian Dolbec (RETIRED) gentoo-dev 2015-12-20 01:59:55 UTC
yeah, that makes sense.  I'll still leave it as "len(parts) != 5"  to spit out anything that doesn't match the expected output.
Comment 4 Brian Dolbec (RETIRED) gentoo-dev 2015-12-20 02:08:10 UTC
OK, I've pushed the fix for this in commit:
https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=1fbd7ec8a46c359c5ef98168156a91ba05cf6a6f

Please emerge gentoolkit-9999 to test if this indeed does fix it for you.  I have nothing installed in my system that can trigger this bug.
Comment 5 Marco Napetti 2015-12-24 10:21:52 UTC
I edited /usr/lib64/python3.4/site-packages/gentoolkit/revdep_rebuild/analyse.py as requested, the problem seems to be given by a bliss overlay's ebuild, media-tv/plex-media-server.

The new output is pasted here: http://pastebin.com/bfyZZNSS
Comment 6 Marco Napetti 2015-12-24 10:38:16 UTC
After upgrading to =app-portage/gentoolkit-9999 the problem disappeared.
Comment 7 Brian Dolbec (RETIRED) gentoo-dev 2015-12-24 12:57:15 UTC
Yeah, 9999 has 2 bug fixes since the 0.3.1 release.  This fix which Zac pointed out the correct fix and one for the ebuild.

It is safe to continue with the 9999 version until the next 0.3.x release.  It will only contain bugfixes.  There is no other development work being done on the code for the time being.