if prev_mtimes is None:
global mtimedb
prev_mtimes = mtimedb["ldpath"]
- envd_dir = os.path.join(target_root, "etc", "env.d")
+ envd_dir = os.path.join(target_root, portage_const.EPREFIX, "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, "etc", "ld.so.conf")
+ ldsoconf_path = os.path.join(target_root, portage_const.EPREFIX, "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, "etc", "prelink.conf"))
+ os.path.join(target_root, portage_const.EPREFIX, "etc", "prelink.conf"))
newprelink.write("# prelink.conf autogenerated by env-update; make all changes to\n")
newprelink.write("# contents of "+portage_const.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, lib_dir.lstrip(os.sep))
+ x = os.path.join(target_root, portage_const.EPREFIX, lib_dir.lstrip(os.sep))
try:
newldpathtime = os.stat(x)[stat.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 %setc/ld.so.cache...\n" % target_root)
+ writemsg(">>> Regenerating %setc/ld.so.cache...\n" %
+ target_root+portage_const.EPREFIX)
if makelinks:
- commands.getstatusoutput("cd / ; /sbin/ldconfig -r '%s'" % target_root)
+ commands.getstatusoutput("cd / ; "+portage_const.EPREFIX+"/sbin/ldconfig -r '%s'" % target_root)
else:
- commands.getstatusoutput("cd / ; /sbin/ldconfig -X -r '%s'" % target_root)
+ commands.getstatusoutput("cd / ; "+portage_const.EPREFIX+"/sbin/ldconfig -X -r '%s'" % target_root)
elif ostype in ("FreeBSD","DragonFly"):
- writemsg(">>> Regenerating %svar/run/ld-elf.so.hints...\n" % target_root)
+ writemsg(">>> Regenerating %svar/run/ld-elf.so.hints...\n" %
+ target_root+portage_const.EPREFIX)
commands.getstatusoutput(
- "cd / ; /sbin/ldconfig -elf -i -f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'" % \
- (target_root, target_root))
+ "cd / ; "+portage_const.EPREFIX+"/sbin/ldconfig -elf -i -f '%svar/run/ld-elf.so.hints' '%setc/ld.so.conf'" % \
+ (target_root+portage_const.EPREFIX, target_root+portage_const.EPREFIX))
del specials["LDPATH"]
cenvnotice += "# GO INTO "+portage_const.EPREFIX+"/etc/csh.cshrc NOT "+portage_const.EPREFIX+"/etc/csh.env\n\n"
#create /etc/profile.env for bash support
- outfile = atomic_ofstream(os.path.join(target_root, "etc", "profile.env"))
+ outfile = atomic_ofstream(os.path.join(target_root, portage_const.EPREFIX, "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, "etc", "csh.env"))
+ outfile = atomic_ofstream(os.path.join(target_root, portage_const.EPREFIX, "etc", "csh.env"))
outfile.write(cenvnotice)
for x in env_keys:
outfile.write("setenv %s '%s'\n" % (x, env[x]))
def _init_dirs(self):
"""Create tmp, var/tmp and var/lib/portage (relative to $ROOT)."""
- if not os.access(self["ROOT"], os.W_OK):
+ if not os.access(self["ROOT"] + os.sep + portage_const.EPREFIX, os.W_OK):
return
dir_mode_map = {
mysettings["HOME"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "homedir")
mysettings["WORKDIR"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "work")
- mysettings["D"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image") + os.sep
+ mysettings["EDEST"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image") + os.sep
+ mysettings["D"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image", mysettings["EPREFIX"]) + os.sep
mysettings["T"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "temp")
mysettings["PORTAGE_BASHRC"] = os.path.join(
raise ValueError
self.myroot=myroot
- protect_obj = portage_util.ConfigProtect(myroot,
+ protect_obj = portage_util.ConfigProtect(myroot
+ + os.path.sep + portage_const.EPREFIX,
mysettings.get("CONFIG_PROTECT","").split(),
mysettings.get("CONFIG_PROTECT_MASK","").split())
self.updateprotect = protect_obj.updateprotect
def mergeme(self,srcroot,destroot,outfile,secondhand,stufftomerge,cfgfiledict,thismtime):
from os.path import sep, join
- prefix = normqlize_path(portage_const.EPREFIX)
+ prefix = normalize_path(portage_const.EPREFIX)
# grobian: is this sane/still necessart?
#if srcroot.endswith(prefix):
# # Trim prefix from srcroot