summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-09 10:55:34 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-09 10:55:34 +0000
commit0d8c51c4d184c4c460608a28504d40623830e4a9 (patch)
tree191f11c1cbab6136781de9a74d504273b025846c
parente106418e38ade096b3705fef33ff38e8c51cbfcd (diff)
downloadportage-0d8c51c4d184c4c460608a28504d40623830e4a9.tar.gz
portage-0d8c51c4d184c4c460608a28504d40623830e4a9.tar.bz2
portage-0d8c51c4d184c4c460608a28504d40623830e4a9.zip
For bug #181387, fix an UnboundLocalError for the mymtime variable that is triggered by confmem.
svn path=/main/trunk/; revision=6778
-rw-r--r--pym/portage/dbapi/vartree.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 7122fcac1..1213712ef 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1777,12 +1777,14 @@ class dblink(object):
# handy variables; mydest is the target object on the live filesystems;
# mysrc is the source object in the temporary install dir
try:
- mydmode = os.lstat(mydest).st_mode
+ mydstat = os.lstat(mydest)
+ mydmode = mydstat.st_mode
except OSError, e:
if e.errno != errno.ENOENT:
raise
del e
#dest file doesn't exist
+ mydstat = None
mydmode = None
if stat.S_ISLNK(mymode):
@@ -1902,6 +1904,7 @@ class dblink(object):
mydestdir = os.path.dirname(mydest)
moveme = 1
zing = "!!!"
+ mymtime = None
if mydmode != None:
# destination file exists
if stat.S_ISDIR(mydmode):
@@ -1925,9 +1928,11 @@ class dblink(object):
""" An identical update has previously been
merged. Skip it unless the user has chosen
--noconfmem."""
- zing = "-o-"
moveme = cfgfiledict["IGNORE"]
cfgprot = cfgfiledict["IGNORE"]
+ if not moveme:
+ zing = "-o-"
+ mymtime = long(mydstat.st_mtime)
else:
moveme = 1
cfgprot = 1