consistently use CACHE_PATH with target_root, this commit needs a separate soon to...
authorFabian Groffen <grobian@gentoo.org>
Sat, 5 Sep 2009 10:25:30 +0000 (10:25 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 5 Sep 2009 10:25:30 +0000 (10:25 -0000)
svn path=/main/trunk/; revision=14188

pym/_emerge/BlockerCache.py
pym/_emerge/actions.py
pym/portage/__init__.py
pym/portage/dbapi/bintree.py
pym/portage/dbapi/vartree.py
pym/portage/glsa.py

index 7b797ebbd5936727e4d4113bd95a26b65380f645..2af47ca858200fc646d99e02c8fdad4cf6703ee7 100644 (file)
@@ -37,7 +37,7 @@ class BlockerCache(portage.cache.mappings.MutableMapping):
                self._vardb = vardb
                self._virtuals = vardb.settings.getvirtuals()
                self._cache_filename = os.path.join(myroot,
-                       portage.CACHE_PATH.lstrip(os.path.sep), "vdb_blockers.pickle")
+                       portage.CACHE_PATH, "vdb_blockers.pickle")
                self._cache_version = "1"
                self._cache_data = None
                self._modified = set()
index c87665ed2987a21721baaed5ce0a75914e3010a0..399ff10017936e349e002c18974b69370ef6fc67 100644 (file)
@@ -2594,7 +2594,7 @@ def load_emerge_config(trees=None):
                        settings = trees[myroot]["vartree"].settings
                        break
 
-       mtimedbfile = os.path.join("/", portage.CACHE_PATH.lstrip(os.path.sep), "mtimedb")
+       mtimedbfile = os.path.join(os.path.sep, settings['ROOT'], portage.CACHE_PATH, "mtimedb")
        mtimedb = portage.MtimeDB(mtimedbfile)
        portage.output._init(config_root=settings['PORTAGE_CONFIGROOT'])
        return settings, trees, mtimedb
index c9ae08f440f22bb59d4105fee56ee26f68a301e7..4b79d6802de2ba25f7978b58f0cab799e1840b2b 100644 (file)
@@ -2198,12 +2198,12 @@ class config(object):
                if not os.access(self["ROOT"], os.W_OK):
                        return
 
-               #                                     gid, mode, mask, preserve_perms
+               #                                gid, mode, mask, preserve_perms
                dir_mode_map = {
-                       "tmp"             : (                      -1, 01777,  0,  True),
-                       "var/tmp"         : (                      -1, 01777,  0,  True),
-                       PRIVATE_PATH      : (             portage_gid, 02750, 02,  False),
-                       CACHE_PATH.lstrip(os.path.sep) : (portage_gid,  0755, 02,  False)
+                       "tmp"             : (         -1, 01777,  0,  True),
+                       "var/tmp"         : (         -1, 01777,  0,  True),
+                       PRIVATE_PATH      : (portage_gid, 02750, 02,  False),
+                       CACHE_PATH        : (portage_gid,  0755, 02,  False)
                }
 
                for mypath, (gid, mode, modemask, preserve_perms) \
@@ -8811,8 +8811,8 @@ class _MtimedbProxy(proxy.objectproxy.ObjectProxy):
        def _get_target(self):
                global mtimedb, mtimedbfile, _mtimedb_initialized
                if not _mtimedb_initialized:
-                       mtimedbfile = os.path.join("/",
-                               CACHE_PATH.lstrip(os.path.sep), "mtimedb")
+                       mtimedbfile = os.path.join(os.path.sep,
+                               CACHE_PATH, "mtimedb")
                        mtimedb = MtimeDB(mtimedbfile)
                        _mtimedb_initialized = True
                name = object.__getattribute__(self, '_name')
index f40583e0b0582ef6a919bbb662d3c86e179b43ed..a3b1236b9699afe8f53737e63c270d221b7451da 100644 (file)
@@ -660,7 +660,7 @@ class binarytree(object):
                        from portage.const import CACHE_PATH
                        from urlparse import urlparse
                        urldata = urlparse(base_url)
-                       pkgindex_file = os.path.join(CACHE_PATH, "binhost",
+                       pkgindex_file = os.path.join(self.settings["ROOT"], CACHE_PATH, "binhost",
                                urldata[1] + urldata[2], "Packages")
                        pkgindex = self._new_pkgindex()
                        try:
index 23710cd2e6df388c7096ece6906afd48318cfded..15ec5b7983976f95cbe15df2abda642c9a1b5938 100644 (file)
@@ -814,9 +814,9 @@ class vardbapi(dbapi):
                        "repository", "RESTRICT" , "SLOT", "USE"])
                self._aux_cache_obj = None
                self._aux_cache_filename = os.path.join(self.root,
-                       CACHE_PATH.lstrip(os.path.sep), "vdb_metadata.pickle")
+                       CACHE_PATH, "vdb_metadata.pickle")
                self._counter_path = os.path.join(root,
-                       CACHE_PATH.lstrip(os.path.sep), "counter")
+                       CACHE_PATH, "counter")
 
                try:
                        self.plib_registry = PreservedLibsRegistry(self.root,
index db297995df1b294a12477e5ec63f01e712855239..6dc73ac67eb38a6564a5d7d9d7272be15929a7c6 100644 (file)
@@ -33,7 +33,7 @@ def get_applied_glsas(settings):
        @rtype:         list
        @return:        list of glsa IDs
        """
-       return grabfile(os.path.join(os.sep, settings["ROOT"], CACHE_PATH.lstrip(os.sep), "glsa"))
+       return grabfile(os.path.join(os.sep, settings["ROOT"], CACHE_PATH, "glsa"))
 
 
 # TODO: use the textwrap module instead
@@ -655,7 +655,7 @@ class Glsa:
                if not self.isApplied():
                        checkfile = codecs.open(
                                _unicode_encode(os.path.join(os.sep, self.config["ROOT"],
-                               CACHE_PATH.lstrip(os.sep), "glsa"),
+                               CACHE_PATH, "glsa"),
                                encoding=_encodings['fs'], errors='strict'), 
                                mode='a+', encoding=_encodings['content'], errors='strict')
                        checkfile.write(self.nr+"\n")