summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-18 19:30:53 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-18 19:30:53 +0000
commitca100dbad4dc17bd640419a1d3106f596f201757 (patch)
treebef9a106b32759ff2358cd4588721a14ff6aeccd /pym
parentd584c4b6509aab1bed3ca7bf2281f914f1ece8f0 (diff)
downloadportage-ca100dbad4dc17bd640419a1d3106f596f201757.tar.gz
portage-ca100dbad4dc17bd640419a1d3106f596f201757.tar.bz2
portage-ca100dbad4dc17bd640419a1d3106f596f201757.zip
Bug #195375 - Make dblink.treewalk() read inforoot/SLOT since
it differs from the expected SLOT value when when USE=multislot is enabled. A warning message will be shown if the slot differs and --quiet mode is not enabled. svn path=/main/trunk/; revision=8172
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/vartree.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 466a06dcc..cca5ca9a3 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1671,6 +1671,22 @@ class dblink(object):
noiselevel=-1)
return 1
+ inforoot_slot_file = os.path.join(inforoot, "SLOT")
+ try:
+ f = open(inforoot_slot_file)
+ try:
+ slot = f.read().strip()
+ finally:
+ f.close()
+ except OSError, e:
+ writemsg("!!! Error reading '%s': %s\n" % (inforoot_slot_file, e),
+ noiselevel=-1)
+ return 1
+
+ if slot != self.settings["SLOT"]:
+ writemsg("!!! WARNING: Expected SLOT='%s', got '%s'\n" % \
+ (self.settings["SLOT"], slot))
+
if not os.path.exists(self.dbcatdir):
os.makedirs(self.dbcatdir)
@@ -1679,7 +1695,7 @@ class dblink(object):
otherversions.append(v.split("/")[1])
slot_matches = self.vartree.dbapi.match(
- "%s:%s" % (self.mysplit[0], self.settings["SLOT"]))
+ "%s:%s" % (self.mysplit[0], slot))
if self.mycpv not in slot_matches and \
self.vartree.dbapi.cpv_exists(self.mycpv):
# handle multislot or unapplied slotmove