DEPRECATED_PROFILE_FILE, USER_VIRTUALS_FILE, EBUILD_SH_ENV_FILE, \
INVALID_ENV_FILE, CUSTOM_MIRRORS_FILE, CONFIG_MEMORY_FILE,\
INCREMENTALS, EAPI, MISC_SH_BINARY, REPO_NAME_LOC, REPO_NAME_FILE, \
- EPREFIX
+ EPREFIX, EPREFIX_LSTRIP
from portage.data import ostype, lchown, userland, secpass, uid, wheelgid, \
portage_uid, portage_gid, userpriv_groups
prev_mtimes = mtimedb["ldpath"]
if env is None:
env = os.environ
- envd_dir = os.path.join(target_root + EPREFIX, "etc", "env.d")
+ envd_dir = os.path.join(target_root, EPREFIX_LSTRIP, "etc", "env.d")
portage.util.ensure_dirs(envd_dir, mode=0755)
fns = listdir(envd_dir, EmptyOnError=1)
fns.sort()
they won't be overwritten by this dict.update call."""
env.update(myconfig)
- ldsoconf_path = os.path.join(target_root + EPREFIX, "etc", "ld.so.conf")
+ ldsoconf_path = os.path.join(target_root, EPREFIX_LSTRIP, "etc", "ld.so.conf")
try:
myld = open(ldsoconf_path)
myldlines=myld.readlines()
# Update prelink.conf if we are prelink-enabled
if prelink_capable:
newprelink = atomic_ofstream(
- os.path.join(target_root + EPREFIX, "etc", "prelink.conf"))
+ os.path.join(target_root, EPREFIX_LSTRIP, "etc", "prelink.conf"))
newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n")
newprelink.write("# contents of "+EPREFIX+"/etc/env.d directory\n")
mtime_changed = False
lib_dirs = set()
for lib_dir in portage.util.unique_array(specials["LDPATH"]+['usr/lib','usr/lib64','usr/lib32','lib','lib64','lib32']):
- x = os.path.join(target_root + EPREFIX, lib_dir.lstrip(os.sep))
+ x = os.path.join(target_root, EPREFIX_LSTRIP, lib_dir.lstrip(os.sep))
try:
newldpathtime = long(os.stat(x).st_mtime)
lib_dirs.add(normalize_path(x))
# an older package installed ON TOP of a newer version will cause ldconfig
# to overwrite the symlinks we just made. -X means no links. After 'clean'
# we can safely create links.
- writemsg(">>> Regenerating %s/etc/ld.so.cache...\n" % (target_root+EPREFIX))
+ writemsg(">>> Regenerating %s/etc/ld.so.cache...\n" % (target_root + EPREFIX_LSTRIP))
if makelinks:
os.system("cd / ; %s -r '%s'" % (ldconfig, target_root))
else:
os.system("cd / ; %s -X -r '%s'" % (ldconfig, target_root))
elif ostype in ("FreeBSD","DragonFly"):
writemsg(">>> Regenerating %svar/run/ld-elf.so.hints...\n" % \
- target_root+EPREFIX)
+ target_root + EPREFIX_LSTRIP)
os.system(("cd / ; %s -elf -i " + \
"-f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'") % \
- (ldconfig, target_root+EPREFIX, target_root+EPREFIX))
+ (ldconfig, target_root + EPREFIX_LSTRIP, target_root + EPREFIX_LSTRIP))
del specials["LDPATH"]
cenvnotice += "# GO INTO "+EPREFIX+"/etc/csh.cshrc NOT "+EPREFIX+"/etc/csh.env\n\n"
#create /etc/profile.env for bash support
- outfile = atomic_ofstream(os.path.join(target_root + EPREFIX, "etc", "profile.env"))
+ outfile = atomic_ofstream(os.path.join(target_root, EPREFIX_LSTRIP, "etc", "profile.env"))
outfile.write(penvnotice)
env_keys = [ x for x in env if x != "LDPATH" ]
outfile.close()
#create /etc/csh.env for (t)csh support
- outfile = atomic_ofstream(os.path.join(target_root + EPREFIX, "etc", "csh.env"))
+ outfile = atomic_ofstream(os.path.join(target_root, EPREFIX_LSTRIP, "etc", "csh.env"))
outfile.write(cenvnotice)
for x in env_keys:
outfile.write("setenv %s '%s'\n" % (x, env[x]))
config_root = normalize_path(os.path.abspath(
config_root)).rstrip(os.path.sep) + os.path.sep
- check_var_directory("PORTAGE_CONFIGROOT", config_root + EPREFIX)
+ check_var_directory("PORTAGE_CONFIGROOT", config_root + EPREFIX_LSTRIP)
self.depcachedir = DEPCACHE_PATH
del rawpuseforce
try:
- self.mygcfg = getconfig(os.path.join(config_root + EPREFIX, "etc", "make.globals"))
+ self.mygcfg = getconfig(os.path.join(config_root, EPREFIX_LSTRIP, "etc", "make.globals"))
if self.mygcfg is None:
self.mygcfg = {}
target_root = normalize_path(os.path.abspath(
target_root)).rstrip(os.path.sep) + os.path.sep
- check_var_directory("ROOT", target_root + EPREFIX)
+ check_var_directory("ROOT", target_root + EPREFIX_LSTRIP)
env_d = getconfig(
- os.path.join(target_root + EPREFIX, "etc", "profile.env"), expand=False)
+ os.path.join(target_root, EPREFIX_LSTRIP, "etc", "profile.env"), expand=False)
# env_d will be None if profile.env doesn't exist.
if env_d:
self.configdict["env.d"].update(env_d)
self.backup_changes("ROOT")
self["EPREFIX"] = EPREFIX
self.backup_changes("EPREFIX")
- self["EROOT"] = normalize_path(target_root + EPREFIX) + os.sep
+ self["EROOT"] = target_root + EPREFIX_LSTRIP + os.path.sep
self.backup_changes("EROOT")
self.pusedict = {}
"""
Create a few directories that are critical to portage operation
"""
- if not os.access(self["ROOT"] + EPREFIX, os.W_OK):
+ if not os.access(self["ROOT"] + EPREFIX_LSTRIP, os.W_OK):
return
dir_mode_map = {
# We grab the latest profile.env here since it changes frequently.
self.configdict["env.d"].clear()
env_d = getconfig(
- os.path.join(self["ROOT"] + EPREFIX, "etc", "profile.env"), expand=False)
+ os.path.join(self["ROOT"], EPREFIX_LSTRIP, "etc", "profile.env"), expand=False)
if env_d:
# env_d will be None if profile.env doesn't exist.
self.configdict["env.d"].update(env_d)
# due to how it's coded... Don't overwrite this so we can use it.
mysettings["PORTAGE_DEBUG"] = "1"
- mysettings["EPREFIX"] = EPREFIX.rstrip(os.sep)
+ mysettings["EPREFIX"] = EPREFIX.rstrip(os.path.sep)
mysettings["ROOT"] = myroot
- mysettings["EROOT"] = normalize_path(myroot + mysettings["EPREFIX"]) + os.sep
+ mysettings["EROOT"] = myroot + mysettings["EPREFIX"].lstrip(os.path.sep) + os.path.sep
mysettings["STARTDIR"] = getcwd()
mysettings["PORTAGE_REPO_NAME"] = ""
#set up KV variable -- DEP SPEEDUP :: Don't waste time. Keep var persistent.
if (mydo!="depend") or not mysettings.has_key("KV"):
- mykv,err1=ExtractKernelVersion(os.path.join(myroot + EPREFIX, "usr/src/linux"))
+ mykv,err1=ExtractKernelVersion(os.path.join(myroot, EPREFIX_LSTRIP, "usr/src/linux"))
if mykv:
# Regular source tree
mysettings["KV"]=mykv
def merge(mycat, mypkg, pkgloc, infloc, myroot, mysettings, myebuild=None,
mytree=None, mydbapi=None, vartree=None, prev_mtimes=None):
- if not os.access(myroot+EPREFIX.lstrip("/"), os.W_OK):
+ if not os.access(myroot + EPREFIX_LSTRIP, os.W_OK):
writemsg("Permission denied: access('%s', W_OK)\n" %
- (myroot+EPREFIX.lstrip("/")), noiselevel=-1)
+ (myroot + EPREFIX_LSTRIP), noiselevel=-1)
return errno.EACCES
mylink = dblink(mycat, mypkg, myroot, mysettings, treetype=mytree,
vartree=vartree)