summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-11 18:46:50 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-11 18:46:50 +0000
commitf16651bbec9d88e957e211ffe5bc79b728cc22f8 (patch)
treeab9166e141c6cb835c02ea593d086b0e0fbce60b
parentb0429ec2b4bbc64887eb09ab02a372e4bbd37efe (diff)
downloadportage-f16651bbec9d88e957e211ffe5bc79b728cc22f8.tar.gz
portage-f16651bbec9d88e957e211ffe5bc79b728cc22f8.tar.bz2
portage-f16651bbec9d88e957e211ffe5bc79b728cc22f8.zip
In config.setcpv() and load_infodir(), always set known good values
for CATEGORY and PF, since corruption of these can cause problems. svn path=/main/trunk/; revision=9832
-rw-r--r--pym/portage/__init__.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index fa2d79307..b87dc4c1a 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -1818,6 +1818,13 @@ class config(object):
os.path.join(infodir, "CATEGORY"), noiselevel=-1)
self.configdict["pkg"].update(backup_pkg_metadata)
retval = 0
+
+ # Always set known good values for these variables, since
+ # corruption of these can cause problems:
+ cat, pf = catsplit(self.mycpv)
+ self.configdict["pkg"]["CATEGORY"] = cat
+ self.configdict["pkg"]["PF"] = pf
+
return retval
def setcpv(self, mycpv, use_cache=1, mydb=None):
@@ -1955,8 +1962,13 @@ class config(object):
# Without this conditional, regenerate() would be called
# *every* time.
has_changed = True
- # CATEGORY is essential for doebuild calls
- self.configdict["pkg"]["CATEGORY"] = mycpv.split("/")[0]
+
+ # Always set known good values for these variables, since
+ # corruption of these can cause problems:
+ cat, pf = catsplit(self.mycpv)
+ self.configdict["pkg"]["CATEGORY"] = cat
+ self.configdict["pkg"]["PF"] = pf
+
if has_changed:
self.reset(keeping_pkg=1,use_cache=use_cache)