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()
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
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) \
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')
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:
"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,
@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
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")