Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 11767 - fails when run on a non-initialized system?
Summary: fails when run on a non-initialized system?
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: x86 Linux
: High minor
Assignee: Nicholas Jones (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-08 07:32 UTC by Torgeir Hansen
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 Torgeir Hansen 2002-12-08 07:32:18 UTC
in portage.py, do_vartree(), it reads
        if virts:
                myvkeys=virts.keys()
                for x in myvkeys:
                        vkeysplit=x.split("/")
                        if not virts_p.has_key(vkeysplit[1]):
                                virts_p[vkeysplit[1]]=virts[x]
        del x

note the missing indent of 'del x', for me this renders this error message when
trying a emerge sync:

----
indy:~# emerge sync
>>> Note: /etc/make.profile isn't available; an 'emerge sync' will probably fix
this.
Traceback (most recent call last):
  File "/usr/bin/emerge", line 6, in ?
    import os,sys,portage,xpak,string,re,commands,time,threading,shutil,traceback
  File "/usr/lib/python2.2/site-packages/portage.py", line 4154, in ?
    do_vartree()
  File "/usr/lib/python2.2/site-packages/portage.py", line 4147, in do_vartree
    del x
UnboundLocalError: local variable 'x' referenced before assignment
indy:~#
---
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2002-12-09 05:41:27 UTC
What stage file are you using?
Where did you get it?
What version of portage? 'emerge info'
Comment 2 Torgeir Hansen 2002-12-09 05:54:30 UTC
This occured while attempting to get portage working on a debian system while
trying to start up a mips-port of gentoo,hence the 'minor' severity - no less a
bug :)

it exists in 2.0.44 and above at least, probably more versions too :)

x is not defined if "if virts:" doesen't happen (no virts?, not that I have a
clue wtf. this func actually does)

just add a tab and it'll be fine!
Comment 3 SpanKY gentoo-dev 2003-02-25 15:05:30 UTC
latest portage.py has this: 
        if virts: 
                myvkeys=virts.keys() 
                for x in myvkeys: 
                        vkeysplit=x.split("/") 
                        if not virts_p.has_key(vkeysplit[1]): 
                                virts_p[vkeysplit[1]]=virts[x] 
        try: 
                del x