target="${1}"
linkname="${2}"
-[[ ${target:0:1} == "/" ]] && target="${PREFIX}${target}"
+[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
exec ln -snf "${target}" "${D}/${linkname}"
OCC="$CC"
OCXX="$CXX"
-source ${PREFIX}/etc/profile.env &>/dev/null
+source ${EPREFIX}/etc/profile.env &>/dev/null
if [ -f "${PORTAGE_BASHRC}" ]; then
# If $- contains x, then tracing has already enabled elsewhere for some
# reason. We preserve it's state so as not to interfere.
with_bindir() {
local mybindir
if [ -z "${1}" ]; then
- if [ ! -z "${PREFIX}" ]; then
- mybindir="${PREFIX}/bin"
+ if [ ! -z "${EPREFIX}" ]; then
+ mybindir="${EPREFIX}/bin"
else
mybindir="/bin"
fi
else
- if [ ! -z "${PREFIX}" ]; then
- mybindir="${PREFIX}${1}"
+ if [ ! -z "${EPREFIX}" ]; then
+ mybindir="${EPREFIX}${1}"
else
mybindir="${1}"
fi
with_datadir() {
local mydatadir
if [ -z "${1}" ]; then
- if [ ! -z "${PREFIX}" ]; then
- mydatadir="${PREFIX}/usr/share"
+ if [ ! -z "${EPREFIX}" ]; then
+ mydatadir="${EPREFIX}/usr/share"
else
mydatadir=/usr/share
fi
else
- if [ ! -z "${PREFIX}" ]; then
- mydatadir="${PREFIX}${1}"
+ if [ ! -z "${EPREFIX}" ]; then
+ mydatadir="${EPREFIX}${1}"
else
mydatadir="${1}"
fi
with_infodir() {
local myinfodir
if [ -z "${1}" ]; then
- if [ ! -z "${PREFIX}" ]; then
- myinfodir="${PREFIX}/usr/share/info"
+ if [ ! -z "${EPREFIX}" ]; then
+ myinfodir="${EPREFIX}/usr/share/info"
else
myinfodir=/usr/share/info
fi
else
- if [ ! -z "${PREFIX}" ]; then
- myinfodir="${PREFIX}${1}"
+ if [ ! -z "${EPREFIX}" ]; then
+ myinfodir="${EPREFIX}${1}"
else
myinfodir="${1}"
fi
with_mandir() {
local mymandir
if [ -z "${1}" ]; then
- if [ ! -z "${PREFIX}" ]; then
- mymandir="${PREFIX}/usr/share/man"
+ if [ ! -z "${EPREFIX}" ]; then
+ mymandir="${EPREFIX}/usr/share/man"
else
mymandir=/usr/share/man
fi
else
- if [ ! -z "${PREFIX}" ]; then
- mymandir="${PREFIX}${1}"
+ if [ ! -z "${EPREFIX}" ]; then
+ mymandir="${EPREFIX}${1}"
else
mymandir="${1}"
fi
with_prefix() {
local myprefix
if [ -z "${1}" ]; then
- if [ ! -z "${PREFIX}" ]; then
- myprefix="${PREFIX}/usr"
+ if [ ! -z "${EPREFIX}" ]; then
+ myprefix="${EPREFIX}/usr"
else
myprefix=/usr
fi
else
- if [ ! -z "${PREFIX}" ]; then
- myprefix="${PREFIX}${1}"
+ if [ ! -z "${EPREFIX}" ]; then
+ myprefix="${EPREFIX}${1}"
else
myprefix="${1}"
fi
with_sysconfdir() {
local myconfdir
if [ -z "${1}" ]; then
- if [ ! -z "${PREFIX}" ]; then
- myconfdir="${PREFIX}/etc"
+ if [ ! -z "${EPREFIX}" ]; then
+ myconfdir="${EPREFIX}/etc"
else
myconfdir=/etc
fi
else
- if [ ! -z "${PREFIX}" ]; then
- myconfdir="${PREFIX}${1}"
+ if [ ! -z "${EPREFIX}" ]; then
+ myconfdir="${EPREFIX}${1}"
else
myconfdir="${1}"
fi
with_localstatedir() {
local mylocalstatedir
if [ -z "${1}" ]; then
- if [ ! -z "${PREFIX}" ]; then
- mylocalstatedir="${PREFIX}/var/lib"
+ if [ ! -z "${EPREFIX}" ]; then
+ mylocalstatedir="${EPREFIX}/var/lib"
else
mylocalstatedir="/var/lib"
fi
else
- if [ ! -z "${PREFIX}" ]; then
- mylocalstatedir="${PREFIX}${1}"
+ if [ ! -z "${EPREFIX}" ]; then
+ mylocalstatedir="${EPREFIX}${1}"
else
mylocalstatedir="${1}"
fi
ECONF_SOURCE="."
fi
if [ -x "${ECONF_SOURCE}/configure" ]; then
- if [ -e ${PREFIX}/usr/share/gnuconfig/ ]; then
+ if [ -e ${EPREFIX}/usr/share/gnuconfig/ ]; then
for x in $(find "${WORKDIR}" -type f '(' -name config.guess -o -name config.sub ')') ; do
- echo " * econf: updating ${x/${WORKDIR}\/} with ${PREFIX}/usr/share/gnuconfig/${x##*/}"
- cp -f ${PREFIX}/usr/share/gnuconfig/${x##*/} ${x}
+ echo " * econf: updating ${x/${WORKDIR}\/} with ${EPREFIX}/usr/share/gnuconfig/${x##*/}"
+ cp -f ${EPREFIX}/usr/share/gnuconfig/${x##*/} ${x}
done
fi
CONF_PREFIX=${pref}
[ "${CONF_PREFIX:0:1}" != "/" ] && CONF_PREFIX="/${CONF_PREFIX}"
else
- CONF_PREFIX="${PREFIX}/usr"
+ CONF_PREFIX="${EPREFIX}/usr"
fi
export CONF_PREFIX
[ "${CONF_LIBDIR:0:1}" != "/" ] && CONF_LIBDIR="/${CONF_LIBDIR}"
fi
echo ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \
- --prefix=${PREFIX}/usr \
+ --prefix=${EPREFIX}/usr \
--host=${CHOST} \
- --mandir=${PREFIX}/usr/share/man \
- --infodir=${PREFIX}/usr/share/info \
- --datadir=${PREFIX}/usr/share \
- --sysconfdir=${PREFIX}/etc \
- --localstatedir=${PREFIX}/var/lib \
+ --mandir=${EPREFIX}/usr/share/man \
+ --infodir=${EPREFIX}/usr/share/info \
+ --datadir=${EPREFIX}/usr/share \
+ --sysconfdir=${EPREFIX}/etc \
+ --localstatedir=${EPREFIX}/var/lib \
"$@" \
${LOCAL_EXTRA_ECONF}
if ! ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \
- --prefix=${PREFIX}/usr \
+ --prefix=${EPREFIX}/usr \
--host=${CHOST} \
- --mandir=${PREFIX}/usr/share/man \
- --infodir=${PREFIX}/usr/share/info \
- --datadir=${PREFIX}/usr/share \
- --sysconfdir=${PREFIX}/etc \
- --localstatedir=${PREFIX}/var/lib \
+ --mandir=${EPREFIX}/usr/share/man \
+ --infodir=${EPREFIX}/usr/share/info \
+ --datadir=${EPREFIX}/usr/share \
+ --sysconfdir=${EPREFIX}/etc \
+ --localstatedir=${EPREFIX}/var/lib \
"$@" \
${LOCAL_EXTRA_ECONF}; then
fi
if hasq distcc ${FEATURES} &>/dev/null; then
- if [ -d ${PREFIX}/usr/lib/distcc/bin ]; then
+ if [ -d ${EPREFIX}/usr/lib/distcc/bin ]; then
#We can enable distributed compile support
if [ -z "${PATH/*distcc*/}" ]; then
# Remove the other reference.
remove_path_entry "distcc"
fi
- export PATH="${PREFIX}/usr/lib/distcc/bin:${PATH}"
+ export PATH="${EPREFIX}/usr/lib/distcc/bin:${PATH}"
[ ! -z "${DISTCC_LOG}" ] && addwrite "$(dirname ${DISTCC_LOG})"
elif which distcc &>/dev/null; then
export CC="distcc $CC"
remove_path_entry "ccache"
fi
- if [ -d ${PREFIX}/usr/lib/ccache/bin ]; then
- export PATH="${PREFIX}/usr/lib/ccache/bin:${PATH}"
- elif [ -d ${PREFIX}/usr/bin/ccache ]; then
- export PATH="${PREFIX}/usr/bin/ccache:${PATH}"
+ if [ -d ${EPREFIX}/usr/lib/ccache/bin ]; then
+ export PATH="${EPREFIX}/usr/lib/ccache/bin:${PATH}"
+ elif [ -d ${EPREFIX}/usr/bin/ccache ]; then
+ export PATH="${EPREFIX}/usr/bin/ccache:${PATH}"
fi
- [ -z "${CCACHE_DIR}" ] && export CCACHE_DIR="${PREFIX}/var/tmp/ccache"
+ [ -z "${CCACHE_DIR}" ] && export CCACHE_DIR="${EPREFIX}/var/tmp/ccache"
addread "${CCACHE_DIR}"
addwrite "${CCACHE_DIR}"
xtermTitle(mystr)
try:
#seems odd opening a file each write...
- elog = portage_const.PREFIX+"/var/log/emerge.log"
+ elog = portage_const.EPREFIX+"/var/log/emerge.log"
if not os.path.exists(elog):
mylogfile=open(elog, "w")
os.chmod(elog, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)
def getportageversion():
try:
import re
- profilever = os.path.normpath("///"+os.readlink(portage_const.PREFIX+"/etc/make.profile"))
+ profilever = os.path.normpath("///"+os.readlink(portage_const.EPREFIX+"/etc/make.profile"))
basepath = os.path.normpath("///"+portage.settings["PORTDIR"]+"/profiles")
if re.match(basepath,profilever):
profilever = profilever[len(basepath)+1:]
updatecache_flg = True
tmpservertimestampfile = None
elif syncuri[:8]=="rsync://":
- if not os.path.exists(portage_const.PREFIX+"/usr/bin/rsync"):
+ if not os.path.exists(portage_const.EPREFIX+"/usr/bin/rsync"):
print "!!! rsync does not exist, so rsync support is disabled."
print "!!! Type \"emerge net-misc/rsync\" to enable rsync support."
sys.exit(1)
if "--quiet" not in myopts:
print ">>> Checking server timestamp ..."
- rsynccommand = " ".join([portage_const.PREFIX,"/usr/bin/rsync",
+ rsynccommand = " ".join([portage_const.EPREFIX,"/usr/bin/rsync",
portage.settings["PORTAGE_RSYNC_EXTRA_OPTS"],
" ".join(rsync_opts)])
print getportageversion()
print "================================================================="
print "System uname: "+unameout
- if os.path.exists(portage_const.PREFIX+"/etc/gentoo-release"):
- os.system("cat "+portage_const.PREFIX+"/etc/gentoo-release")
+ if os.path.exists(portage_const.EPREFIX+"/etc/gentoo-release"):
+ os.system("cat "+portage_const.EPREFIX+"/etc/gentoo-release")
else:
print "Unknown Host Operating System"
echo ">>> Regenerating ${ROOT}etc/ld.so.cache..."
if [[ ${MAKELINKS} -eq 0 ]] ; then
- (cd / ; ${PREFIX}/sbin/ldconfig -X -r ${ROOT} >& /dev/null)
+ (cd / ; ${EPREFIX}/sbin/ldconfig -X -r ${ROOT} >& /dev/null)
else
- (cd / ; ${PREFIX}/sbin/ldconfig -r ${ROOT} >& /dev/null)
+ (cd / ; ${EPREFIX}/sbin/ldconfig -r ${ROOT} >& /dev/null)
fi
cat << EOF > ${PROFILEENV}
export PORTAGE_CALLER="etc-update"
-eval $(python -c 'import portage_const;print "export PREFIX="+portage_const.PREFIX;print "export PORTAGE_BIN_PATH="+portage_const.PORTAGE_BIN_PATH;')
+eval $(python -c 'import portage_const;print "export PREFIX="+portage_const.EPREFIX;print "export PORTAGE_BIN_PATH="+portage_const.PORTAGE_BIN_PATH;')
if type -p gsed >/dev/null ; then
function sed() { gsed "$@"; }
# First strip off comment lines, then grab the configuration
# item. If there's more than one of the same configuration item,
# then allow the last setting to take precedence.
- cut -d'#' -f1-1 ${PREFIX}/etc/etc-update.conf | \
+ cut -d'#' -f1-1 ${EPREFIX}/etc/etc-update.conf | \
sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p" |sed -e '$p;d'
}
if [ ! -e "${rpath}/${rfile}" ] || [ ! -e "${rpath}/${rfile:10}" ]; then
MATCHES=0
else
- diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | ${PREFIX}/bin/grep -E '^[+-]' | ${PREFIX}/bin/grep -E -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | ${PREFIX}/bin/grep -E -qv '^[-+][\t ]*$'
+ diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | ${EPREFIX}/bin/grep -E '^[+-]' | ${EPREFIX}/bin/grep -E -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | ${EPREFIX}/bin/grep -E -qv '^[-+][\t ]*$'
MATCHES=$?
fi
elif [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
eerror "${FUNCNAME}: IMAGE is unset"
return 1
else
- IMAGE="${IMAGE}/${PREFIX}"
+ IMAGE="${IMAGE}/${EPREFIX}"
fi
# remove man pages, info pages, docs if requested
for f in man info doc; do
if hasq no${f} $FEATURES; then
- INSTALL_MASK="${INSTALL_MASK} ${PREFIX}/usr/share/${f}"
+ INSTALL_MASK="${INSTALL_MASK} ${EPREFIX}/usr/share/${f}"
fi
done
fi
# total suid control.
if hasq suidctl $FEATURES; then
- sfconf=${PREFIX}/etc/portage/suidctl.conf
+ sfconf=${EPREFIX}/etc/portage/suidctl.conf
echo ">>> Preforming suid scan in ${IMAGE}"
for i in $(find ${IMAGE}/ -type f \( -perm -4000 -o -perm -2000 \) ); do
if [ -s "${sfconf}" ]; then
# SELinux file labeling (needs to always be last in dyn_preinst)
# only attempt to label if setfiles is executable
# and 'context' is available on selinuxfs.
- if [ -f /selinux/context -a -x ${PREFIX}/usr/sbin/setfiles -a -x ${PREFIX}/usr/sbin/selinuxconfig ]; then
+ if [ -f /selinux/context -a -x ${EPREFIX}/usr/sbin/setfiles -a -x ${EPREFIX}/usr/sbin/selinuxconfig ]; then
echo ">>> Setting SELinux security labels"
(
- eval "$(${PREFIX}/usr/sbin/selinuxconfig)" || \
+ eval "$(${EPREFIX}/usr/sbin/selinuxconfig)" || \
die "Failed to determine SELinux policy paths.";
addwrite /selinux/context;
- ${PREFIX}/usr/sbin/setfiles "${file_contexts_path}" -r "${IMAGE}" "${IMAGE}";
+ ${EPREFIX}/usr/sbin/setfiles "${file_contexts_path}" -r "${IMAGE}" "${IMAGE}";
) || die "Failed to set SELinux security labels."
else
# nonfatal, since merging can happen outside a SE kernel
[[ " ${FEATURES} " != *" installsources "* ]] && return 0
- if [[ -x "${PREFIX}/usr/bin/debugedit" ]] ; then
- debugedit -b "${WORKDIR}" -d "${PREFIX}"/usr/src/debug/${PF} -l "${T}"/debug.sources "${x}"
+ if [[ -x "${EPREFIX}/usr/bin/debugedit" ]] ; then
+ debugedit -b "${WORKDIR}" -d "${EPREFIX}"/usr/src/debug/${PF} -l "${T}"/debug.sources "${x}"
if [[ -s ${T}/debug.sources ]] ; then
[[ -d ${D}/usr/src/debug/${PF} ]] || mkdir -p "${D}/usr/src/debug/${PF}"
cat "${T}"/debug.sources | (cd "${WORKDIR}"; LANG=C sort -z -u | xargs -0 -- cp --parents -p --target-directory="${D}/usr/src/debug/${PF}" )
fails[mykey].append(x+"/"+y+".ebuild: "+keyword+"("+prof[0]+") "+repr(mydep[1]))
# this check needs work, it won't catch (\ndie)
- if not os.system(portage_const.PREFIX+"/usr/bin/grep -E '^[^#]*\([^)]*\<die\>' "+checkdir+"/"+y+".ebuild >/dev/null 2>&1"):
+ if not os.system(portage_const.EPREFIX+"/usr/bin/grep -E '^[^#]*\([^)]*\<die\>' "+checkdir+"/"+y+".ebuild >/dev/null 2>&1"):
stats["ebuild.nesteddie"]=stats["ebuild.nesteddie"]+1
fails["ebuild.nesteddie"].append(x+"/"+y+".ebuild")
# uselist checks - global
del mymissing
retval=["",""]
print "Performing a "+green("cvs -n up")+" with a little magic grep to check for updates."
- retval=getstatusoutput("cvs -n up 2>&1 | "+portage_const.PREFIX+"/bin/grep -E '^[^\?] .*' | "+portage_const.PREFIX+"/bin/grep -E -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'")
+ retval=getstatusoutput("cvs -n up 2>&1 | "+portage_const.EPREFIX+"/bin/grep -E '^[^\?] .*' | "+portage_const.EPREFIX+"/bin/grep -E -v '^. .*/digest-[^/]+|^cvs server: .* -- ignored$'")
mylines=string.split(retval[1], "\n")
for x in mylines:
headerstring="'\$(Header|Id)"
headerstring+=".*\$'"
for myfile in myupdates:
- myout=getstatusoutput(portage_const.PREFIX+"/bin/grep -E -q "+headerstring+" "+myfile)
+ myout=getstatusoutput(portage_const.EPREFIX+"/bin/grep -E -q "+headerstring+" "+myfile)
if myout[0]==0:
myheaders.append(myfile)
# PORTAGE_TMPDIR is the location portage will use for compilations and
# temporary storage of data. This can get VERY large depending upon
# the application being installed.
-PORTAGE_TMPDIR="${PREFIX}/var/tmp"
+PORTAGE_TMPDIR="${EPREFIX}/var/tmp"
#
# PORTDIR is the location of the portage tree. This is the repository
# for all profile information as well as all ebuilds. If you change
-# this, you must update your ${PREFIX}"/etc/make.profile symlink
+# this, you must update your ${EPREFIX}"/etc/make.profile symlink
# accordingly.
-PORTDIR="${PREFIX}/usr/portage"
+PORTDIR="${EPREFIX}/usr/portage"
#
# DISTDIR is where all of the source code tarballs will be placed for
# emerges. The source code is maintained here unless you delete
# providing a directory. Permissions will be modified as needed IF the
# directory exists, otherwise logging will be disabled. NNNN is the
# increment at the time the log is created. Logs are thus sequential.
-PORT_LOGDIR="${PREFIX}/var/log/portage"
+PORT_LOGDIR="${EPREFIX}/var/log/portage"
#
# PORTDIR_OVERLAY is a directory where local ebuilds may be stored without
# concern that they will be deleted by rsync updates. Default is not
# defined.
-PORTDIR_OVERLAY="${PREFIX}/usr/local/portage"
+PORTDIR_OVERLAY="${EPREFIX}/usr/local/portage"
# Fetching files
# ==============
# alternate ownloaders -- note that you need to merge these programs first.
#
# curl groks urls
-FETCHCOMMAND="${PREFIX}/usr/bin/curl -f --connect-timeout 15 -# -o \${DISTDIR}/\${FILE} \${URI}"
-RESUMECOMMAND="${PREFIX}/usr/bin/curl -f --connect-timeout 15 -# -C - -o \${DISTDIR}/\${FILE} \${URI}"
+FETCHCOMMAND="${EPREFIX}/usr/bin/curl -f --connect-timeout 15 -# -o \${DISTDIR}/\${FILE} \${URI}"
+RESUMECOMMAND="${EPREFIX}/usr/bin/curl -f --connect-timeout 15 -# -C - -o \${DISTDIR}/\${FILE} \${URI}"
# Default wget fetch command (5 tries, passive ftp for firewall compatibility)
-#FETCHCOMMAND="${PREFIX}/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
-#RESUMECOMMAND="${PREFIX}/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
+#FETCHCOMMAND="${EPREFIX}/usr/bin/wget -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
+#RESUMECOMMAND="${EPREFIX}/usr/bin/wget -c -t 5 --passive-ftp \${URI} -P \${DISTDIR}"
#
# Using wget, ratelimiting downloads
-#FETCHCOMMAND="${PREFIX}/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
-#RESUMECOMMAND="${PREFIX}/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
+#FETCHCOMMAND="${EPREFIX}/usr/bin/wget -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
+#RESUMECOMMAND="${EPREFIX}/usr/bin/wget -c -t 5 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
#
# Lukemftp (BSD ftp):
-#FETCHCOMMAND="${PREFIX}/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}"
-#RESUMECOMMAND="${PREFIX}/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}"
+#FETCHCOMMAND="${EPREFIX}/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}"
+#RESUMECOMMAND="${EPREFIX}/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}"
#
# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval.
# The list is a space separated list which is read left to right. If you use
# 2G, and will be set if not defined otherwise and ccache is in features.
# Portage will set the default ccache dir if it is not present in the
# user's environment, for userpriv it sets: ${PORTAGE_TMPDIR}/ccache
-# (${PREFIX}/var/tmp/ccache), and for regular use the default is /root/.ccache.
+# (${EPREFIX}/var/tmp/ccache), and for regular use the default is /root/.ccache.
# Sizes are specified with 'G' 'M' or 'K'.
# '2G' for 2 gigabytes, '2048M' for 2048 megabytes (same as 2G).
#CCACHE_SIZE="512M"
# consideration. This may cause dependency failures if you are not careful.
# The file format is one pattern per line, blanks and ';' or '#' lines are
# comments. See 'man rsync' for more details on the exclude-from format.
-#RSYNC_EXCLUDEFROM=${PREFIX}/etc/portage/rsync_excludes
+#RSYNC_EXCLUDEFROM=${EPREFIX}/etc/portage/rsync_excludes
# logging related variables:
# PORTAGE_ELOG_CLASSES: selects messages to be logged, possible values are:
def env_update(makelinks=1):
global root
- if not os.path.exists(root+portage_const.PREFIX+"/etc/env.d"):
+ if not os.path.exists(root+portage_const.EPREFIX+"/etc/env.d"):
prevmask=os.umask(0)
- os.makedirs(root+portage_const.PREFIX+"/etc/env.d",0755)
+ os.makedirs(root+portage_const.EPREFIX+"/etc/env.d",0755)
os.umask(prevmask)
- fns=listdir(root+portage_const.PREFIX+"/etc/env.d",EmptyOnError=1)
+ fns=listdir(root+portage_const.EPREFIX+"/etc/env.d",EmptyOnError=1)
fns.sort()
pos=0
while (pos<len(fns)):
# don't process backup files
if x[-1]=='~' or x[-4:]==".bak":
continue
- myconfig=getconfig(root+portage_const.PREFIX+"/etc/env.d/"+x)
+ myconfig=getconfig(root+portage_const.EPREFIX+"/etc/env.d/"+x)
if myconfig==None:
- writemsg("!!! Parsing error in "+str(root)+portage_const.PREFIX+"/etc/env.d/"+str(x)+"\n")
+ writemsg("!!! Parsing error in "+str(root)+portage_const.EPREFIX+"/etc/env.d/"+str(x)+"\n")
#parse error
continue
# process PATH, CLASSPATH, LDPATH
for myenv in myconfig.keys():
env[myenv]=myconfig[myenv]
- if os.path.exists(root+portage_const.PREFIX+"/etc/ld.so.conf"):
- myld=open(root+portage_const.PREFIX+"/etc/ld.so.conf")
+ if os.path.exists(root+portage_const.EPREFIX+"/etc/ld.so.conf"):
+ myld=open(root+portage_const.EPREFIX+"/etc/ld.so.conf")
myldlines=myld.readlines()
myld.close()
oldld=[]
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.PREFIX, "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.PREFIX+"/etc/env.d directory\n")
+ myfd.write("# contents of "+portage_const.EPREFIX+"/etc/env.d directory\n")
for x in specials["LDPATH"]:
myfd.write(x+"\n")
myfd.close()
# Update prelink.conf if we are prelink-enabled
if prelink_capable:
- newprelink = atomic_ofstream(os.path.join(root, portage_const.PREFIX, "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.PREFIX+"/etc/env.d directory\n")
+ newprelink.write("# contents of "+portage_const.EPREFIX+"/etc/env.d directory\n")
- for x in map(lambda x: os.path.join(portage_const.PREFIX,x), ["bin","sbin","usr/bin","usr/sbin","lib","usr/lib"]):
+ for x in map(lambda x: os.path.join(portage_const.EPREFIX,x), ["bin","sbin","usr/bin","usr/sbin","lib","usr/lib"]):
newprelink.write("-l "+x+"\n");
for x in specials["LDPATH"]+specials["PATH"]+specials["PRELINK_PATH"]:
if not x:
if not mtimedb.has_key("ldpath"):
mtimedb["ldpath"]={}
- for x in map(lambda x: portage_const.PREFIX+x, specials["LDPATH"]+['/usr/lib','/lib']):
+ for x in map(lambda x: portage_const.EPREFIX+x, specials["LDPATH"]+['/usr/lib','/lib']):
try:
newldpathtime=os.stat(x)[stat.ST_MTIME]
except SystemExit, e:
# we can safely create links.
writemsg(">>> Regenerating "+str(root)+"etc/ld.so.cache...\n")
if makelinks:
- commands.getstatusoutput("cd / ; "+portage_const.PREFIX+"/sbin/ldconfig -r "+root)
+ commands.getstatusoutput("cd / ; "+portage_const.EPREFIX+"/sbin/ldconfig -r "+root)
else:
- commands.getstatusoutput("cd / ; "+portage_const.PREFIX+"/sbin/ldconfig -X -r "+root)
+ commands.getstatusoutput("cd / ; "+portage_const.EPREFIX+"/sbin/ldconfig -X -r "+root)
elif ostype in ("FreeBSD","DragonFly"):
writemsg(">>> Regenerating "+str(root)+"var/run/ld-elf.so.hints...\n")
- commands.getstatusoutput("cd / ; "+portage_const.PREFIX+"/sbin/ldconfig -elf -i -f "+str(root)+portage_const.PREFIX+"/var/run/ld-elf.so.hints "+str(root)+portage_const.PREFIX+"/etc/ld.so.conf")
+ commands.getstatusoutput("cd / ; "+portage_const.EPREFIX+"/sbin/ldconfig -elf -i -f "+str(root)+portage_const.EPREFIX+"/var/run/ld-elf.so.hints "+str(root)+portage_const.EPREFIX+"/etc/ld.so.conf")
commands.getstatusoutput("cd / ; /sbin/ldconfig -elf -i -f "+str(root)+"var/run/ld-elf.so.hints "+str(root)+"etc/ld.so.conf")
del specials["LDPATH"]
penvnotice = "# THIS FILE IS AUTOMATICALLY GENERATED BY env-update.\n"
penvnotice += "# DO NOT EDIT THIS FILE. CHANGES TO STARTUP PROFILES\n"
cenvnotice = penvnotice[:]
- penvnotice += "# GO INTO "+portage_const.PREFIX+"/etc/profile NOT "+portage_const.PREFIX+"/etc/profile.env\n\n"
- cenvnotice += "# GO INTO "+portage_const.PREFIX+"/etc/csh.cshrc NOT "+portage_const.PREFIX+"/etc/csh.env\n\n"
+ penvnotice += "# GO INTO "+portage_const.EPREFIX+"/etc/profile NOT "+portage_const.EPREFIX+"/etc/profile.env\n\n"
+ 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(root, portage_const.PREFIX, "etc", "profile.env"))
+ outfile = atomic_ofstream(os.path.join(root, portage_const.EPREFIX, "etc", "profile.env"))
outfile.write(penvnotice)
for path in specials.keys():
outfile.close()
#create /etc/csh.env for (t)csh support
- outfile = atomic_ofstream(os.path.join(root, portage_const.PREFIX, "etc", "csh.env"))
+ outfile = atomic_ofstream(os.path.join(root, portage_const.EPREFIX, "etc", "csh.env"))
outfile.write(cenvnotice)
for path in specials.keys():
break
if mykey == "CONFIG_PROTECT_MASK":
- match += " "+portage_const.PREFIX+"/etc/env.d"
+ match += " "+portage_const.EPREFIX+"/etc/env.d"
return match
# 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.PREFIX)
+ mysettings["ROOT"] = os.path.normpath(myroot+portage_const.EPREFIX)
mysettings["STARTDIR"] = getcwd()
mysettings["EBUILD"] = ebuild_path
mysettings["PN"] = mysplit[0]
mysettings["PV"] = mysplit[1]
mysettings["PR"] = mysplit[2]
- mysettings["PREFIX"] = portage_const.PREFIX
+ mysettings["PREFIX"] = portage_const.EPREFIX
if portage_util.noiselimit < 0:
mysettings["PORTAGE_QUIET"] = "1"
mysettings["WORKDIR"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "work")
mysettings["EDEST"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image") + os.sep
- mysettings["D"] = os.path.normpath(mysettings["EDEST"]+portage_const.PREFIX)
+ mysettings["D"] = os.path.normpath(mysettings["EDEST"]+portage_const.EPREFIX)
mysettings["T"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "temp")
mysettings["PORTAGE_BASHRC"] = EBUILD_SH_ENV_FILE
raise ValueError
self.myroot=myroot
- self.mergedir = os.path.normpath(myroot+os.path.sep+portage_const.PREFIX)
+ self.mergedir = os.path.normpath(myroot+os.path.sep+portage_const.EPREFIX)
self.updateprotect()
self.contentscache=[]
return 0
def mergeme(self,srcroot,destroot,outfile,secondhand,stufftomerge,cfgfiledict,thismtime):
- prefix=os.path.normpath(portage_const.PREFIX)
+ prefix=os.path.normpath(portage_const.EPREFIX)
os.path.normpath(os.path.sep+srcroot)
if srcroot.endswith(prefix):
# Trim prefix from srcroot
#create tmp and var/tmp if they don't exist; read config
os.umask(0)
-if not os.path.exists(root+portage_const.PREFIX+"/tmp"):
- writemsg(">>> "+root+portage_const.PREFIX+"/tmp doesn't exist, creating it...\n")
- os.mkdir(root+portage_const.PREFIX+"/tmp",01777)
-if not os.path.exists(root+portage_const.PREFIX+"/var/tmp"):
- writemsg(">>> "+root+portage_const.PREFIX+"/var/tmp doesn't exist, creating it...\n")
+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)
+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:
- os.mkdir(root+portage_const.PREFIX+"/var",0755)
+ os.mkdir(root+portage_const.EPREFIX+"/var",0755)
except (OSError,IOError):
pass
try:
- os.mkdir(root+portage_const.PREFIX+"/var/tmp",01777)
+ os.mkdir(root+portage_const.EPREFIX+"/var/tmp",01777)
except SystemExit, e:
raise
except:
- writemsg("portage: couldn't create "+root+portage_const.PREFIX+"/var/tmp; exiting.\n")
+ writemsg("portage: couldn't create "+root+portage_const.EPREFIX+"/var/tmp; exiting.\n")
sys.exit(1)
-if not os.path.exists(root+portage_const.PREFIX+"/var/lib/portage"):
- writemsg(">>> "+root+portage_const.PREFIX+"/var/lib doesn't exist, creating it...\n")
+if not os.path.exists(root+portage_const.EPREFIX+"/var/lib/portage"):
+ writemsg(">>> "+root+portage_const.EPREFIX+"/var/lib doesn't exist, creating it...\n")
try:
- os.mkdir(root+portage_const.PREFIX+"/var",0755)
+ os.mkdir(root+portage_const.EPREFIX+"/var",0755)
except (OSError,IOError):
pass
try:
- os.mkdir(root+portage_const.PREFIX+"/var/lib",0755)
+ os.mkdir(root+portage_const.EPREFIX+"/var/lib",0755)
except (OSError,IOError):
pass
try:
- os.mkdir(root+portage_const.PREFIX+"/var/lib/portage",0755)
+ os.mkdir(root+portage_const.EPREFIX+"/var/lib/portage",0755)
except SystemExit, e:
raise
except:
- writemsg("portage: couldn't create "+root+portage_const.PREFIX+"/var/lib/portage; exiting.\n")
+ writemsg("portage: couldn't create "+root+portage_const.EPREFIX+"/var/lib/portage; exiting.\n")
sys.exit(1)
if not os.path.exists(root+portage_const.PORTAGE_BASE+""):
writemsg(">>> "+root+portage_const.PORTAGE_BASE+" doesn't exist, creating it...\n")
try:
- os.mkdir(root+portage_const.PREFIX+"/var",0755)
+ os.mkdir(root+portage_const.EPREFIX+"/var",0755)
except (OSError,IOError):
pass
try:
# START OF CONSTANTS -- START OF CONSTANTS -- START OF CONSTANTS -- START OF
# ===========================================================================
-VDB_PATH = PREFIX+"/var/db/pkg"
-PRIVATE_PATH = PREFIX+"/var/lib/portage"
-CACHE_PATH = PREFIX+"/var/cache/edb"
+VDB_PATH = EPREFIX+"/var/db/pkg"
+PRIVATE_PATH = EPREFIX+"/var/lib/portage"
+CACHE_PATH = EPREFIX+"/var/cache/edb"
DEPCACHE_PATH = CACHE_PATH+"/dep"
-USER_CONFIG_PATH = PREFIX+"/etc/portage"
+USER_CONFIG_PATH = EPREFIX+"/etc/portage"
MODULES_FILE_PATH = USER_CONFIG_PATH+"/modules"
CUSTOM_PROFILE_PATH = USER_CONFIG_PATH+"/profile"
PORTAGE_BASE_PATH = PORTAGE_BASE
PORTAGE_BIN_PATH = PORTAGE_BASE_PATH+"/bin"
PORTAGE_PYM_PATH = PORTAGE_BASE_PATH+"/pym"
-PROFILE_PATH = PREFIX+"/etc/make.profile"
+PROFILE_PATH = EPREFIX+"/etc/make.profile"
LOCALE_DATA_PATH = PORTAGE_BASE_PATH+"/locale"
EBUILD_SH_BINARY = PORTAGE_BIN_PATH+"/ebuild.sh"
PRELINK_BINARY = "prelink"
WORLD_FILE = PRIVATE_PATH + "/world"
-MAKE_CONF_FILE = PREFIX+"/etc/make.conf"
+MAKE_CONF_FILE = EPREFIX+"/etc/make.conf"
MAKE_DEFAULTS_FILE = PROFILE_PATH + "/make.defaults"
DEPRECATED_PROFILE_FILE = PROFILE_PATH+"/deprecated"
USER_VIRTUALS_FILE = USER_CONFIG_PATH+"/virtuals"
# all vars that are to wind up in portage_const must have their name listed in __all__
-__all__ = ["PREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser", "portagegroup", "rootuser", "rootuid", "wheelgid"]
+__all__ = ["EPREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser", "portagegroup", "rootuser", "rootuid", "wheelgid"]
from os import path
-PREFIX=path.normpath("@DOMAIN_PREFIX@")
+EPREFIX=path.normpath("@DOMAIN_PREFIX@")
SYSCONFDIR=path.normpath("@sysconfdir@")
PORTAGE_BASE=path.normpath("@PORTAGE_BASE@")
portagegroup="@portagegroup@"