Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 303145 - Prefix portage vercmp causes a traceback when comparing a -r0 revision
Summary: Prefix portage vercmp causes a traceback when comparing a -r0 revision
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-01 20:23 UTC by Paul Varner (RETIRED)
Modified: 2010-02-04 19:26 UTC (History)
0 users

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


Attachments
vercmp patch for prefix portage (portage.vercmp.patch,447 bytes, patch)
2010-02-02 20:20 UTC, Paul Varner (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Varner (RETIRED) gentoo-dev 2010-02-01 20:23:08 UTC
I ran in to this with equery list -p '*', but I have narrowed it down to the following python code snippet.

$ python
Python 2.6.4 (r264:75706, Jan 26 2010, 17:21:13)
[GCC 4.2.1 (Apple Inc. build 5574)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from portage.versions import vercmp
>>> vercmp('2', '2-r0')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pvarner/Library/Gentoo/usr/lib/portage/pym/portage/versions.py", line 225, in vercmp
    if r1 == r2 and (r3 != 0 or r4 != 0):
UnboundLocalError: local variable 'r3' referenced before assignment
>>> vercmp('2-r0', '2')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/pvarner/Library/Gentoo/usr/lib/portage/pym/portage/versions.py", line 225, in vercmp
    if r1 == r2 and (r3 != 0 or r4 != 0):
UnboundLocalError: local variable 'r4' referenced before assignment
>>>

I will see if I can can come up with a patch if nobody beats me to it.


Reproducible: Always




Portage 2.2.00.15274-prefix (prefix/darwin/macos/10.6/x64, gcc-4.2.1, unavailable, 10.2.0 i386)
=================================================================
System uname: Darwin-10.2.0-i386-64bit
Timestamp of tree: Mon, 01 Feb 2010 15:35:17 +0000
distcc 2.18.5-Apple.1 i386-apple-darwin10.0 (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     4.0_p37
dev-lang/python:     2.6.4
sys-devel/autoconf:  2.63-r01.1
sys-devel/automake:  1.10.2-r00.1, 1.11.1
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:   2.2.6b
ACCEPT_KEYWORDS="~x64-macos ~x86-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-apple-darwin10"
CFLAGS="-O2 -pipe -march=nocona"
CHOST="x86_64-apple-darwin10"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=nocona"
DISTDIR="/Users/pvarner/Library/Gentoo/usr/portage/distfiles"
FEATURES="assume-digests collision-protect distlocks fixpackages news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS=""
PKGDIR="/Users/pvarner/Library/Gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/Users/pvarner/Library/Gentoo/"
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="/Users/pvarner/Library/Gentoo/var/tmp"
PORTDIR="/Users/pvarner/Library/Gentoo/usr/portage"
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="aqua coreaudio cracklib cxx mmx mmxext modules ncurses nls objc objc++ prefix readline sse sse2 ssl unicode x64-macos zlib" 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="Darwin" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Paul Varner (RETIRED) gentoo-dev 2010-02-02 20:20:50 UTC
Created attachment 218219 [details, diff]
vercmp patch for prefix portage

This patch fixes the issue.
Comment 2 Fabian Groffen gentoo-dev 2010-02-04 07:52:08 UTC
patch looks good, I'll apply and release asap (hopefully tonight)!
Comment 3 Fabian Groffen gentoo-dev 2010-02-04 19:25:26 UTC
thanks, released
Comment 4 Fabian Groffen gentoo-dev 2010-02-04 19:26:08 UTC
(as 2.2.00.15320)