Merged from trunk -r14186:14191
authorFabian Groffen <grobian@gentoo.org>
Sat, 5 Sep 2009 11:00:20 +0000 (11:00 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 5 Sep 2009 11:00:20 +0000 (11:00 -0000)
   | 14187   | Fix usage of VDB_PATH                                        |
   | grobian |                                                              |

   | 14188   | consistently use CACHE_PATH with target_root, this commit    |
   | grobian | needs a separate soon to be done commit of                   |
   |         | pym/portage/const.py to work correctly                       |

   | 14189   | PRIVATE_PATH has no leading slash (like all other uses of    |
   | grobian | this var assume)                                             |

   | 14190   | add note that this file does not seem to deal with ROOT at   |
   | grobian | all                                                          |

   | 14191   | DEPRECATED_PROFILE_FILE is derived from PROFILE_PATH which   |
   | grobian | has no leading slash                                         |

svn path=/main/branches/prefix/; revision=14195

bin/archive-conf
bin/ebuild
bin/regenworld
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
pym/portage/sets/files.py

index 429b22692e8c196a1f20d29680b4524122cea47a..3e4dc7b0c90797a8c8b019cf360aa38baa30cf0d 100755 (executable)
@@ -56,7 +56,7 @@ def archive_conf():
         md5_match_hash[conf] = ''
 
     # Find all the CONTENT files in VDB_PATH.
-    content_files += os.popen(FIND_EXTANT_CONTENTS % (portage.root+portage.VDB_PATH)).readlines()
+    content_files += os.popen(FIND_EXTANT_CONTENTS % (os.path.join(portage.root, portage.VDB_PATH))).readlines()
 
     # Search for the saved md5 checksum of all the specified config files
     # and see if the current file is unmodified or not.
index 4f882047120844dbb0548d0b62dbee8286dfa410..2c1ae95e3bf927a3480794894c4a720d3b4c041f 100755 (executable)
@@ -137,7 +137,7 @@ if not portage.catpkgsplit(cpv):
        print "!!! %s does not follow correct package syntax." % (cpv)
        sys.exit(1)
 
-if ebuild.startswith(portage.root + portage.const.VDB_PATH):
+if ebuild.startswith(os.path.join(portage.root, portage.const.VDB_PATH)):
        mytree = "vartree"
 
        portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv)
index 3d7d9b9ad285b26b4fef9af12f02c3d70394da90..2d21c8e27135ca21cc40c38c5463235f2f2cffc0 100755 (executable)
@@ -3,6 +3,8 @@
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
+# NOTE: this file does not respect ROOT
+
 import sys
 # for an explanation on this logic, see pym/_emerge/__init__.py 
 from os import environ as ose
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 82545cbc6bd9b076cf35b44e7df016616cdfbc1a..1fc509114fdc5126a85eeee6a3ea90f778e20f83 100644 (file)
@@ -2642,7 +2642,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 5e00b13ba561e46d50c147a89d66070637cc1f69..fd958d170c1f91e88129f2e1882f19e05389d637 100644 (file)
@@ -2213,12 +2213,12 @@ class config(object):
                if not os.access(self["ROOT"] + EPREFIX_LSTRIP, os.W_OK):
                        return
 
-               #                                     gid, mode, mask, preserve_perms
+               #                                gid, mode, mask, preserve_perms
                dir_mode_map = {
-                       EPREFIX_LSTRIP+"/tmp" : (                  -1, 01777,  0,  True),
-                       EPREFIX_LSTRIP+"/var/tmp" : (              -1, 01777,  0,  True),
-                       EPREFIX_LSTRIP+"/"+PRIVATE_PATH :(portage_gid, 02750, 02,  False),
-                       CACHE_PATH.lstrip(os.path.sep) : (portage_gid,  0755, 02,  False)
+                       EPREFIX_LSTRIP+"/tmp"           : (         -1, 01777,  0,  True),
+                       EPREFIX_LSTRIP+"/var/tmp"       : (         -1, 01777,  0,  True),
+                       EPREFIX_LSTRIP+"/"+PRIVATE_PATH : (portage_gid, 02750, 02,  False),
+                       CACHE_PATH        : (portage_gid,  0755, 02,  False)
                }
 
                for mypath, (gid, mode, modemask, preserve_perms) \
@@ -8533,7 +8533,7 @@ def deprecated_profile_check(settings=None):
        if settings is not None:
                config_root = settings["PORTAGE_CONFIGROOT"]
        deprecated_profile_file = os.path.join(config_root,
-               DEPRECATED_PROFILE_FILE.lstrip(os.sep))
+               DEPRECATED_PROFILE_FILE)
        if not os.access(deprecated_profile_file, os.R_OK):
                return False
        dcontent = codecs.open(_unicode_encode(deprecated_profile_file,
@@ -8873,8 +8873,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 aeb088e83510aa1d3082e50af029c3dd3abbfacc..8fbe0c977d6593516127c7acfa83f8e6739871b7 100644 (file)
@@ -663,7 +663,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 bb3795193b3782816026eecb6e2468a6417cff7e..7399d1ca86a3a7836e4240c7301938bf2e315876 100644 (file)
@@ -1522,9 +1522,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,
@@ -1785,7 +1785,7 @@ class vardbapi(dbapi):
                        return list(self._iter_match(mydep,
                                self.cp_list(mydep.cp, use_cache=use_cache)))
                try:
-                       curmtime = os.stat(self.root+VDB_PATH+"/"+mycat).st_mtime
+                       curmtime = os.stat(os.path.join(self.root, VDB_PATH, mycat)).st_mtime
                except (IOError, OSError):
                        curmtime=0
 
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")
index 62d7f07573927c2b591faa43b26ba9538abeadfb..18283fd19df22c204271c0a4d7ad2a5a0a085bc7 100644 (file)
@@ -212,11 +212,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, EPREFIX_LSTRIP, PRIVATE_PATH.lstrip(os.sep), "world")
+               self._filename = os.path.join(os.sep, root, EPREFIX_LSTRIP, PRIVATE_PATH, "world")
                self.loader = ItemFileLoader(self._filename, self._validate)
                self._mtime = None
                
-               self._filename2 = os.path.join(os.sep, root, EPREFIX_LSTRIP,  PRIVATE_PATH.lstrip(os.sep), "world_sets")
+               self._filename2 = os.path.join(os.sep, root, EPREFIX_LSTRIP,  PRIVATE_PATH, "world_sets")
                self.loader2 = ItemFileLoader(self._filename2, self._validate2)
                self._mtime2 = None