summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-10 21:23:00 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-10 21:23:00 +0000
commitd2a287ccbf1ffc0c042103587d758be6d35c74a4 (patch)
tree812526ded6e2adb7286e4e62598af3fb3536c46b /pym
parent98c18f9fc84c59ba45695f104927150b67d113e0 (diff)
downloadportage-d2a287ccbf1ffc0c042103587d758be6d35c74a4.tar.gz
portage-d2a287ccbf1ffc0c042103587d758be6d35c74a4.tar.bz2
portage-d2a287ccbf1ffc0c042103587d758be6d35c74a4.zip
Add more self.modifying() checks in order to detect modifcations to locked config objects.
svn path=/main/trunk/; revision=4652
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 1aa41ae88..99e65b101 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1406,6 +1406,7 @@ class config:
raise Exception, "Configuration is locked."
def backup_changes(self,key=None):
+ self.modifying()
if key and self.configdict["env"].has_key(key):
self.backupenv[key] = copy.deepcopy(self.configdict["env"][key])
else:
@@ -1413,6 +1414,7 @@ class config:
def reset(self,keeping_pkg=0,use_cache=1):
"reset environment to original settings"
+ self.modifying()
self.configdict["env"].clear()
self.configdict["env"].update(self.backupenv)
@@ -1426,6 +1428,7 @@ class config:
self.regenerate(use_cache=use_cache)
def load_infodir(self,infodir):
+ self.modifying()
if self.configdict.has_key("pkg"):
for x in self.configdict["pkg"].keys():
del self.configdict["pkg"][x]
@@ -1495,6 +1498,7 @@ class config:
self.reset(keeping_pkg=1,use_cache=use_cache)
def setinst(self,mycpv,mydbapi):
+ self.modifying()
if len(self.virtuals) == 0:
self.getvirtuals()
# Grab the virtuals this package provides and add them into the tree virtuals.
@@ -1518,7 +1522,7 @@ class config:
def regenerate(self,useonly=0,use_cache=1):
-
+ self.modifying()
if self.already_in_regenerate:
# XXX: THIS REALLY NEEDS TO GET FIXED. autouse() loops.
writemsg("!!! Looping in regenerate.\n",1)
@@ -1747,6 +1751,7 @@ class config:
return stack_dictlist([ptVirtuals, self.treeVirtuals, self.dirVirtuals])
def __delitem__(self,mykey):
+ self.modifying()
for x in self.lookuplist:
if x != None:
if mykey in x: