summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-11 18:48:33 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-11 18:48:33 +0000
commit3d47b3670efb1a0e9de20cbca4bb68a2def9c70c (patch)
tree0228d2cf45ab6e93782f2f8efb053b6fd7db75c6 /pym
parent145e756567e4caf443e6b6a27ec2d91c6731cb86 (diff)
downloadportage-3d47b3670efb1a0e9de20cbca4bb68a2def9c70c.tar.gz
portage-3d47b3670efb1a0e9de20cbca4bb68a2def9c70c.tar.bz2
portage-3d47b3670efb1a0e9de20cbca4bb68a2def9c70c.zip
In config.setcpv() and load_infodir(), always set known good values
for CATEGORY and PF, since corruption of these can cause problems. (trunk r9832) svn path=/main/branches/2.1.2/; revision=9833
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 94309a7c9..082655930 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1879,6 +1879,13 @@ class config:
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):
@@ -2016,8 +2023,13 @@ class config:
# 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)