# Save current environment and touch a success file. (echo for success)
umask 002
set | @EGREP@ -v "^SANDBOX_" > "${T}/environment" 2>/dev/null
- chown @portageuser@:@portagegroup@ "${T}/environment" &>/dev/null
+ chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/environment" &>/dev/null
chmod g+w "${T}/environment" &>/dev/null
fi
local file s
local count=0
- find "${D}/" -user @portageuser@ | while read file; do
+ find "${D}/" -user ${PORTAGE_USER:-portage} | while read file; do
count=$(( $count + 1 ))
if [ -L "${file}" ]; then
lchown ${PORTAGE_INST_UID:-0} "${file}"
fi
done
if (( $count > 0 )); then
- ewarn "$count files were installed with user @portageuser@!"
+ ewarn "$count files were installed with user ${PORTAGE_USER:-portage}!"
fi
count=0
- find "${D}/" -group @portagegroup@ | while read file; do
+ find "${D}/" -group ${PORTAGE_GROUP:-portage}| while read file; do
count=$(( $count + 1 ))
if [ -L "${file}" ]; then
lchgrp ${PORTAGE_INST_GID:-0} "${file}"
fi
done
if (( $count > 0 )); then
- ewarn "$count files were installed with group @portagegroup@!"
+ ewarn "$count files were installed with group ${PORTAGE_GROUP:-portage}!"
fi
unset -f stat_perms
# Disable auto-use
USE_ORDER="env:pkg:conf:defaults"
+# Default portage user/group
+PORTAGE_USER="@portageuser@"
+PORTAGE_GROUP="@portagegroup@"
+
# Default ownership of installed files.
PORTAGE_INST_UID="@rootuid@"
+PORTAGE_INST_USER="@rootuser@"
PORTAGE_INST_GID="@wheelgid@"
# Default PATH for ebuild env
newld=specials["LDPATH"]
if (oldld!=newld):
#ld.so.conf needs updating and ldconfig needs to be run
- myfd = atomic_ofstream(os.path.join(root, portage_const.EPREFIX, "etc", "ld.so.conf"))
+ myfd = atomic_ofstream(os.path.join(root+portage_const.EPREFIX, "etc", "ld.so.conf"))
myfd.write("# ld.so.conf autogenerated by env-update; make all changes to\n")
myfd.write("# contents of "+portage_const.EPREFIX+"/etc/env.d directory\n")
for x in specials["LDPATH"]:
# Update prelink.conf if we are prelink-enabled
if prelink_capable:
- newprelink = atomic_ofstream(os.path.join(root, portage_const.EPREFIX, "etc", "prelink.conf"))
+ newprelink = atomic_ofstream(os.path.join(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")
# due to how it's coded... Don't overwrite this so we can use it.
mysettings["PORTAGE_DEBUG"]=str(debug)
- mysettings["ROOT"] = os.path.normpath(myroot+portage_const.EPREFIX)
+ mysettings["ROOT"] = normalize_path(myroot+portage_const.EPREFIX)
mysettings["STARTDIR"] = getcwd()
mysettings["EBUILD"] = ebuild_path
os.umask(0)
if not os.path.exists(root+portage_const.EPREFIX+"/tmp"):
writemsg(">>> "+root+portage_const.EPREFIX+"/tmp doesn't exist, creating it...\n")
- os.mkdir(root+portage_const.EPREFIX+"/tmp",01777)
+ os.makedirs(root+portage_const.EPREFIX+"/tmp",01777)
if not os.path.exists(root+portage_const.EPREFIX+"/var/tmp"):
writemsg(">>> "+root+portage_const.EPREFIX+"/var/tmp doesn't exist, creating it...\n")
try: