pym/portage/sets/files.py: use WORLD_FILE instead of manual reconstruction
authorFabian Groffen <grobian@gentoo.org>
Sat, 5 Sep 2009 11:13:33 +0000 (11:13 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 5 Sep 2009 11:13:33 +0000 (11:13 -0000)
pym/portage/const.py: introduce WORLD_SETS_FILE variable
pym/portage/sets/files.py: use new WORLD_SETS_FILE var
pym/_emerge/unmerge.py: likewise

svn path=/main/trunk/; revision=14197

pym/_emerge/unmerge.py
pym/portage/const.py
pym/portage/sets/files.py

index 2c9e7576e9b5db31a0ff329db44d1fb2a264eeff..cfa57bbc7105d4b844555de8f9fbb095cfd4caf4 100644 (file)
@@ -340,9 +340,8 @@ def unmerge(root_config, myopts, unmerge_action,
                                                continue
                                        unknown_sets.add(s)
                                        out = portage.output.EOutput()
-                                       out.eerror(("Unknown set '@%s' in " + \
-                                               "%svar/lib/portage/world_sets") % \
-                                               (s, root_config.root))
+                                       out.eerror(("Unknown set '@%s' in %s%s") % \
+                                               (s, root_config.root, portage.const.WORLD_SETS_FILE))
                                        continue
 
                                # only check instances of EditablePackageSet as other classes are generally used for
index a6ac8e8c231ff8fad498527baf0617dea6b2a691..e0c34e4942ae04503571c941f11bb25062a72d37 100644 (file)
@@ -48,6 +48,7 @@ CACHE_PATH               = "var/cache/edb"
 DEPCACHE_PATH            = CACHE_PATH + "/dep"  # FIXME: does not seem to use ROOT when used
 PRIVATE_PATH             = "var/lib/portage"
 WORLD_FILE               = PRIVATE_PATH + "/world"
+WORLD_SETS_FILE          = PRIVATE_PATH + "/world_sets"
 CONFIG_MEMORY_FILE       = PRIVATE_PATH + "/config"
 NEWS_LIB_PATH            = "var/lib/gentoo"
 
index 7c5a6c76663b5be90daf2a80682c0413f89852b3..13c8508e0ad191030be4a4f52a815c7cb2e4b394 100644 (file)
@@ -11,7 +11,7 @@ from portage import _encodings
 from portage import _unicode_decode
 from portage import _unicode_encode
 from portage.util import grabfile, write_atomic, ensure_dirs, normalize_path
-from portage.const import PRIVATE_PATH, USER_CONFIG_PATH
+from portage.const import USER_CONFIG_PATH, WORLD_FILE, WORLD_SETS_FILE
 from portage.localization import _
 from portage.locks import lockfile, unlockfile
 from portage import portage_gid
@@ -213,11 +213,11 @@ class WorldSet(EditablePackageSet):
                # most attributes exist twice as atoms and non-atoms are stored in 
                # separate files
                self._lock = None
-               self._filename = os.path.join(os.sep, root, PRIVATE_PATH), "world")
+               self._filename = os.path.join(os.sep, root, WORLD_FILE)
                self.loader = ItemFileLoader(self._filename, self._validate)
                self._mtime = None
                
-               self._filename2 = os.path.join(os.sep, root, PRIVATE_PATH), "world_sets")
+               self._filename2 = os.path.join(os.sep, root, WORLD_SETS_FILE)
                self.loader2 = ItemFileLoader(self._filename2, self._validate2)
                self._mtime2 = None