diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-10-18 19:33:04 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-10-18 19:33:04 +0000 |
commit | 2e790c87a42eca204d5b48fda404525cbec7d5da (patch) | |
tree | b6d88a24ea653a22ee86279ada8bdeaff95d3554 /pym | |
parent | cd1fc801e6982586a66ba57ca6a1ba9474b7d085 (diff) | |
download | portage-2e790c87a42eca204d5b48fda404525cbec7d5da.tar.gz portage-2e790c87a42eca204d5b48fda404525cbec7d5da.tar.bz2 portage-2e790c87a42eca204d5b48fda404525cbec7d5da.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. (trunk r8172)
svn path=/main/branches/2.1.2/; revision=8173
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py index cb8ac6aa1..932d7c4b8 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -7877,6 +7877,22 @@ class dblink: 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) @@ -7885,7 +7901,7 @@ class dblink: 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 |