summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-14 00:03:00 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-14 00:03:00 +0000
commit4fceedd88f5ebc30004e59658d58b007e18189ee (patch)
tree6020a939f8b674bd1f7e1f17e801f93ff4d64705
parentc2226633c2b25efc82024a071c18e9b17a71c21a (diff)
downloadportage-4fceedd88f5ebc30004e59658d58b007e18189ee.tar.gz
portage-4fceedd88f5ebc30004e59658d58b007e18189ee.tar.bz2
portage-4fceedd88f5ebc30004e59658d58b007e18189ee.zip
Fix buggy logic in WorldSet.load() that causes it to discard all of
it's atoms in some cases (leading to loss of the whole world file). svn path=/main/trunk/; revision=9881
-rw-r--r--pym/portage/sets/files.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pym/portage/sets/files.py b/pym/portage/sets/files.py
index 3abb3f88b..f08a7d423 100644
--- a/pym/portage/sets/files.py
+++ b/pym/portage/sets/files.py
@@ -185,6 +185,7 @@ class WorldSet(EditablePackageSet):
def load(self):
atoms = []
nonatoms = []
+ atoms_changed = False
# load atoms and non-atoms from different files so the worldfile is
# backwards-compatible with older versions and other PMs, even though
# it's supposed to be private state data :/
@@ -205,11 +206,12 @@ class WorldSet(EditablePackageSet):
data = {}
atoms = data.keys()
self._mtime = mtime
+ atoms_changed = True
try:
mtime = os.stat(self._filename2).st_mtime
except (OSError, IOError):
mtime = None
- if (not self._loaded or self._mtime2 != mtime):
+ if (not self._loaded or self._mtime2 != mtime or atoms_changed):
try:
data, errors = self.loader2.load()
for fname in errors:
@@ -222,7 +224,8 @@ class WorldSet(EditablePackageSet):
data = {}
nonatoms = data.keys()
self._mtime2 = mtime
- if self._atoms != atoms or self._nonatoms != nonatoms:
+ atoms_changed = True
+ if atoms_changed:
self._setAtoms(atoms+nonatoms)
def _ensure_dirs(self):