import os,sys
sys.path = ["@PORTAGE_BASE@/pym"]+sys.path
-import portage_locks
+import portage_locks, portage_const
if not sys.argv[1:] or "--help" in sys.argv or "-h" in sys.argv:
print
print "of the locks, even if we can't establish if they are in use."
print "Please attempt cleaning without force first."
print
- print sys.argv[0]+" /usr/portage/distfiles/.locks"
- print sys.argv[0]+" --force /usr/portage/distfiles/.locks"
+ print sys.argv[0]+" "+portage_const.EPREFIX+"/usr/portage/distfiles/.locks"
+ print sys.argv[0]+" --force "+portage_const.EPREFIX+"/usr/portage/distfiles/.locks"
print
sys.exit(1)
-
\ No newline at end of file
+
import atexit, commands, os, re, shutil, stat, string, sys
sys.path = ["@PORTAGE_BASE@/pym"]+sys.path
-import portage, dispatch_conf
+import portage, dispatch_conf, portage_const
FIND_EXTANT_CONFIGS = "find '%s' %s -iname '._cfg????_%s'"
DIFF_CONTENTS = 'diff -Nu %s %s'
SCRATCH_DIR = None
while SCRATCH_DIR is None:
try:
- mydir = "/tmp/dispatch-conf."
+ mydir = portage_const.EPREFIX+"/var/tmp/dispatch-conf."
for x in range(0,8):
if int(random() * 3) == 0:
mydir += chr(int(65+random()*26.0))
#
for path in config_paths.split ():
- path = portage.normalize_path(path)
+ path = portage.normalize_path(portage_const.EPREFIX + path)
try:
mymode = os.lstat(path).st_mode
except OSError:
exit 1
fi
-if [[ ! -d ${D}${DESTTREE}/bin ]] ; then
- install -d "${D}${DESTTREE}/bin" || exit 2
+if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then
+ install -d "${ED}${DESTTREE}/bin" || exit 2
fi
ret=0
for x in "$@" ; do
if [[ -e ${x} ]] ; then
- install -m 0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/bin"
+ install -m 0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${DESTTREE}/bin"
else
echo "!!! ${0##*/}: ${x} does not exist" 1>&2
false
# $Id: /var/cvsroot/gentoo-src/portage/bin/dodir,v 1.5 2004/10/04 13:56:50 vapier Exp $
slash=/
-exec install -d ${DIROPTIONS} "${@/#${slash}/${D}${slash}}"
+exec install -d ${DIROPTIONS} "${@/#${slash}/${ED}${slash}}"
exit 1
fi
-dir="${D}/usr/share/doc/${PF}/${DOCDESTTREE}"
+dir="${ED}/usr/share/doc/${PF}/${DOCDESTTREE}"
if [ ! -d "${dir}" ] ; then
install -d "${dir}"
fi
exit 1
fi
-if [[ ! -d ${D}${EXEDESTTREE} ]] ; then
- install -d "${D}${EXEDESTTREE}"
+if [[ ! -d ${ED}${EXEDESTTREE} ]] ; then
+ install -d "${ED}${EXEDESTTREE}"
fi
for x in "$@" ; do
else
mysrc="${x}"
fi
- install ${EXEOPTIONS} "${mysrc}" "${D}${EXEDESTTREE}"
+ install ${EXEOPTIONS} "${mysrc}" "${ED}${EXEDESTTREE}"
done
target=$1
linkname=$2
-exec ln -f "${D}${target}" "${D}${linkname}"
+exec ln -f "${ED}${target}" "${ED}${linkname}"
if dirname: fullpath = dirname + "/" + fullpath
if options.DOCDESTTREE:
- destdir = options.D + "/usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix
+ destdir = options.ED + "/usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix
else:
- destdir = options.D + "/usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix
+ destdir = options.ED + "/usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix
if os.path.isfile(fullpath):
ext = os.path.splitext(basename)[1]
class OptionsClass:
def __init__(self):
self.PF = ""
- self.D = ""
+ self.ED = ""
self.DOCDESTTREE = ""
if os.environ.has_key("PF"):
self.PF = os.environ["PF"]
- if os.environ.has_key("D"):
- self.D = os.environ["D"]
+ if os.environ.has_key("ED"):
+ self.D = os.environ["ED"]
if os.environ.has_key("DOCDESTTREE"):
self.DOCDESTTREE = os.environ["DOCDESTTREE"]
echo "doinfo: at least one argument needed"
exit 1
fi
-if [ ! -d "${D}/usr/share/info" ] ; then
- install -d "${D}/usr/share/info"
+if [ ! -d "${ED}/usr/share/info" ] ; then
+ install -d "${ED}/usr/share/info"
fi
for x in "$@" ; do
if [ -e "${x}" ] ; then
- install -m 0644 "${x}" "${D}/usr/share/info"
- gzip -f -9 "${D}/usr/share/info/${x##*/}"
+ install -m 0644 "${x}" "${ED}/usr/share/info"
+ gzip -f -9 "${ED}/usr/share/info/${x##*/}"
else
echo "doinfo: ${x} does not exist"
fi
exit 1
fi
-if [ "${INSDESTTREE%${D}*}" == "" ]; then
+if [ "${INSDESTTREE%${ED}*}" == "" ]; then
echo "-------------------------------------------------------" 1>&2
- echo "You should not use \${D} with helpers." 1>&2
+ echo "You should not use \${ED} with helpers." 1>&2
echo " --> ${INSDESTTREE}" 1>&2
echo "-------------------------------------------------------" 1>&2
#exit 1
fi
-[ ! -d "${D}${INSDESTTREE}" ] && dodir "${INSDESTTREE}"
+[ ! -d "${ED}${INSDESTTREE}" ] && dodir "${INSDESTTREE}"
for x in "$@" ; do
if [ -L "$x" ] ; then
else
mysrc="${x}"
fi
- install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}"
+ install ${INSOPTIONS} "${mysrc}" "${ED}${INSDESTTREE}"
done
unset LIBDIR_VAR
# we need this to default to lib so that things dont break
CONF_LIBDIR=${CONF_LIBDIR:-lib}
-libdir="${D}${DESTTREE}/${CONF_LIBDIR}"
+libdir="${ED}${DESTTREE}/${CONF_LIBDIR}"
if [[ $# -lt 1 ]] ; then
if echo ${mandir} | @EGREP@ -q 'man[0-9n](|f|p|pm)$' -; then
if [[ -s ${x} ]] ; then
- if [[ ! -d ${D}/usr/share/man/${mandir} ]] ; then
- install -d "${D}/usr/share/man/${mandir}"
+ if [[ ! -d ${ED}/usr/share/man/${mandir} ]] ; then
+ install -d "${ED}/usr/share/man/${mandir}"
fi
- install -m 0644 "${x}" "${D}/usr/share/man/${mandir}"
+ install -m 0644 "${x}" "${ED}/usr/share/man/${mandir}"
((ret+=$?))
elif [[ ! -e ${x} ]] ; then
echo "doman: ${x} does not exist" 1>&2
echo "${0}: at least one argument needed"
exit 1
fi
-if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then
- install -d "${D}${DESTTREE}/share/locale/"
+if [ ! -d "${ED}${DESTTREE}/share/locale" ] ; then
+ install -d "${ED}${DESTTREE}/share/locale/"
fi
for x in "$@" ; do
if [ -e "${x}" ] ; then
mytiny="${x##*/}"
- mydir="${D}${DESTTREE}/share/locale/${mytiny%.*}/LC_MESSAGES"
+ mydir="${ED}${DESTTREE}/share/locale/${mytiny%.*}/LC_MESSAGES"
if [ ! -d "${mydir}" ] ; then
install -d "${mydir}"
fi
exit 1
fi
-if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then
- install -d "${D}${DESTTREE}/sbin" || exit 2
+if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then
+ install -d "${ED}${DESTTREE}/sbin" || exit 2
fi
ret=0
for x in "$@" ; do
if [[ -e ${x} ]] ; then
- install -m 0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/sbin"
+ install -m 0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${DESTTREE}/sbin"
else
echo "!!! ${0##*/}: ${x} does not exist" 1>&2
false
# Distributed under the terms of the GNU General Public License v2
# $Id: /var/cvsroot/gentoo-src/portage/bin/dosed,v 1.7 2004/10/04 13:56:50 vapier Exp $
-mysed="s:${D}::g"
+mysed="s:${ED}::g"
for x in "$@" ; do
- y="${D}${x}"
+ y="${ED}${x}"
if [ -e "${y}" ] ; then
if [ -f "${y}" ] ; then
sed -i -e "${mysed}" "${y}"
target="${1}"
linkname="${2}"
[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
-exec ln -snf "${target}" "${D}/${linkname}"
+exec ln -snf "${target}" "${ED}/${linkname}"
local x
if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
shift
- find "$@" -type d -printf "${D}/%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" | tr "\n" "\0" | $XARGS -0 -n100 touch || die "Failed to recursive create .keep files"
+ find "$@" -type d -printf "${ED}/%p/.keep_${CATEGORY}_${PN}-${SLOT}\n" | tr "\n" "\0" | $XARGS -0 -n100 touch || die "Failed to recursive create .keep files"
else
for x in "$@"; do
- touch "${D}/${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || die "Failed to create .keep in ${D}/${x}"
+ touch "${ED}/${x}/.keep_${CATEGORY}_${PN}-${SLOT}" || die "Failed to create .keep in ${ED}/${x}"
done
fi
}
fi
vecho ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \
- --prefix=${EPREFIX}/usr \
+ --prefix="${EPREFIX}"/usr \
--host=${CHOST} \
- --mandir=${EPREFIX}/usr/share/man \
- --infodir=${EPREFIX}/usr/share/info \
- --datadir=${EPREFIX}/usr/share \
- --sysconfdir=${EPREFIX}/etc \
- --localstatedir=${EPREFIX}/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=${EPREFIX}/usr \
- --host=${CHOST} \
- --mandir=${EPREFIX}/usr/share/man \
- --infodir=${EPREFIX}/usr/share/info \
- --datadir=${EPREFIX}/usr/share \
- --sysconfdir=${EPREFIX}/etc \
- --localstatedir=${EPREFIX}/var/lib \
+ --prefix="${EPREFIX}"/usr \
+ --host="${CHOST}" \
+ --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
if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
if [ "${PORTAGE_DEBUG}" == "1" ]; then
- make -n prefix="${D}/usr" \
- datadir="${D}/usr/share" \
- infodir="${D}/usr/share/info" \
- localstatedir="${D}/var/lib" \
- mandir="${D}/usr/share/man" \
- sysconfdir="${D}/etc" \
+ make -n prefix="${ED}/usr" \
+ datadir="${ED}/usr/share" \
+ infodir="${ED}/usr/share/info" \
+ localstatedir="${ED}/var/lib" \
+ mandir="${ED}/usr/share/man" \
+ sysconfdir="${ED}/etc" \
${EXTRA_EINSTALL} \
"$@" install
fi
- make prefix="${D}/usr" \
- datadir="${D}/usr/share" \
- infodir="${D}/usr/share/info" \
- localstatedir="${D}/var/lib" \
- mandir="${D}/usr/share/man" \
- sysconfdir="${D}/etc" \
+ make prefix="${ED}/usr" \
+ datadir="${ED}/usr/share" \
+ infodir="${ED}/usr/share/info" \
+ localstatedir="${ED}/var/lib" \
+ mandir="${ED}/usr/share/man" \
+ sysconfdir="${ED}/etc" \
${EXTRA_EINSTALL} \
"$@" install || die "einstall failed"
else
}
src_install() {
- # this avoids misc errors in prefix because it doesn't exist in
+ # this avoids misc errors in prefix because it doesn't exist
# by default
- mkdir -p "${D}"
+ mkdir -p "${ED}"
return
}
# Used to generate the /lib/cpp and /usr/bin/cc wrappers
gen_wrapper() {
cat > "$1" <<-EOF
- #!/bin/sh
+ #!${EPREFIX}/bin/sh
exec $2 "\$@"
EOF
chmod 0755 "$1"
export DESTTREE=""
else
export DESTTREE=$1
- if [ ! -d "${D}${DESTTREE}" ]; then
- install -d "${D}${DESTTREE}"
+ if [ ! -d "${ED}${DESTTREE}" ]; then
+ install -d "${ED}${DESTTREE}"
fi
fi
}
export INSDESTTREE=""
else
export INSDESTTREE=$1
- if [ ! -d "${D}${INSDESTTREE}" ]; then
- install -d "${D}${INSDESTTREE}"
+ if [ ! -d "${ED}${INSDESTTREE}" ]; then
+ install -d "${ED}${INSDESTTREE}"
fi
fi
}
export EXEDESTTREE=""
else
export EXEDESTTREE="$1"
- if [ ! -d "${D}${EXEDESTTREE}" ]; then
- install -d "${D}${EXEDESTTREE}"
+ if [ ! -d "${ED}${EXEDESTTREE}" ]; then
+ install -d "${ED}${EXEDESTTREE}"
fi
fi
}
export DOCDESTTREE=""
else
export DOCDESTTREE="$1"
- if [ ! -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}" ]; then
- install -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}"
+ if [ ! -d "${ED}usr/share/doc/${PF}/${DOCDESTTREE}" ]; then
+ install -d "${ED}usr/share/doc/${PF}/${DOCDESTTREE}"
fi
fi
}
srcdir=${S}
cd "${S}"
fi
- #our custom version of libtool uses $S and $D to fix
+ #our custom version of libtool uses $S and $ED to fix
#invalid paths in .la files
- export S D
+ export S ED
#some packages use an alternative to $S to build in, cause
#our libtool to create problematic .la files
export PWORKDIR="$WORKDIR"
cd "${S}"
fi
vecho
- vecho ">>> Install ${PF} into ${D} category ${CATEGORY}"
- #our custom version of libtool uses $S and $D to fix
+ vecho ">>> Install ${PF} into ${ED} category ${CATEGORY}"
+ #our custom version of libtool uses $S and $ED to fix
#invalid paths in .la files
- export S D
+ export S ED
#some packages uses an alternative to $S to build in, cause
#our libtool to create problematic .la files
export PWORKDIR="$WORKDIR"
src_install
touch "${PORTAGE_BUILDDIR}/.installed"
- vecho ">>> Completed installing ${PF} into ${D}"
+ vecho ">>> Completed installing ${PF} into ${ED}"
vecho
cd ${PORTAGE_BUILDDIR}
[ "$(type -t post_src_install)" == "function" ] && post_src_install
export ROOT="${ROOT:=/}"
[[ ${ROOT} == */ ]] || export ROOT="${ROOT}/"
-export ENVDIR="${ROOT}etc/env.d"
+export ENVDIR="${EROOT}etc/env.d"
mkdir -p ${ENVDIR}
chmod 755 ${ENVDIR}
specials="
ADA_INCLUDE_PATH ADA_OBJECTS_PATH LDPATH PATH MANPATH ROOTPATH
PRELINK_PATH PRELINK_PATH_MASK PYTHON_PATH"
-export LDSOCONF="${ROOT}etc/ld.so.conf"
+export LDSOCONF="${EROOT}etc/ld.so.conf"
-export PRELINKCONF="${ROOT}etc/prelink.conf"
+export PRELINKCONF="${EROOT}etc/prelink.conf"
defaultprelinkpaths=":/bin:/sbin:/usr/bin:/usr/sbin:/lib:/usr/lib"
-export PROFILEENV="${ROOT}etc/profile.env"
-export CSHENV="${ROOT}etc/csh.env"
+export PROFILEENV="${EROOT}etc/profile.env"
+export CSHENV="${EROOT}etc/csh.env"
# make sure we aren't tricked with previous 'my_envd_' variables
unset $(set | grep '^my_envd_' | cut -d= -f1)
# RUN EXTERNAL PROGRAMS NOW
############################################
-echo ">>> Regenerating ${ROOT}etc/ld.so.cache..."
+echo ">>> Regenerating ${EROOT}etc/ld.so.cache..."
if [[ ${MAKELINKS} -eq 0 ]] ; then
- (cd / ; ${EPREFIX}/sbin/ldconfig -X -r ${ROOT} >& /dev/null)
+ (cd / ; ${EPREFIX}/sbin/ldconfig -X -r ${EROOT} >& /dev/null)
else
- (cd / ; ${EPREFIX}/sbin/ldconfig -r ${ROOT} >& /dev/null)
+ (cd / ; ${EPREFIX}/sbin/ldconfig -r ${EROOT} >& /dev/null)
fi
cat << EOF > ${PROFILEENV}
# Distributed under the terms of the GNU General Public License v2
# $Id: $
+# Fabian Groffen <grobian@gentoo.org>
# replaces @GENTOO_PORTAGE_EPREFIX@ with EPREFIX for the given files
if [[ $# -lt 1 ]] ; then
fi
for path in ${CONFIG_PROTECT} ; do
- path="${ROOT}${EPREFIX}/${path}"
+ path="${EROOT}/${path}"
find_opts="-iname ._cfg????_*"
if [ ! -d "${path}" ]; then
[ ! -f "${path}" ] && continue
rpath=$(echo "${file/\/\///}" | sed -e "s:/[^/]*$::")
rfile=$(echo "${file/\/\///}" | sed -e "s:^.*/::")
for mpath in ${CONFIG_PROTECT_MASK}; do
- mpath="${ROOT}${path}"
+ mpath="${EROOT}${mpath}"
if [[ "${rpath}" == "${mpath}"* ]]; then
mv ${rpath}/${rfile} ${rpath}/${rfile:10}
break
eval $(@PORTAGE_BASE@/bin/portageq envvar -v CONFIG_PROTECT \
- CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR ROOT EPREFIX)
+ CONFIG_PROTECT_MASK PORTAGE_CONFIGROOT PORTAGE_TMPDIR ROOT \
+ EROOT EPREFIX)
export PORTAGE_TMPDIR
# quick hack to get prefix support in
from stat import *
from output import *
from portage import lockfile,unlockfile,VDB_PATH,root
+import portage_const
-mylog = open("/var/log/emerge_fix-db.log", "a")
+mylog = open(portage_const.EPREFIX+"/var/log/emerge_fix-db.log", "a")
def writemsg(msg):
if msg[-1] != '\n':
msg += "\n"
mylog.flush()
def fix_global_counter(value):
- myf = open("/var/cache/edb/counter")
+ myf = open(portage_const.EPREFIX+"/var/cache/edb/counter")
newvalue = value+1000
myf.write(str(newvalue))
myf.flush()
times = {}
try:
- real_counter = long(open("/var/cache/edb/counter").read())
+ real_counter = long(open(portage_const.EPREFIX+"/var/cache/edb/counter").read())
except SystemExit, e:
raise # This needs to be propogated
except:
#writemsg("Run with '--fix' to attempt automatic correction.")
pass
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
# $Id: fowners 1912 2005-08-25 03:54:42Z ferringb $
slash=/
-exec chown "${@/#${slash}/${D}${slash}}"
+exec chown "${@/#${slash}/${ED}${slash}}"
# $Id: fperms 1912 2005-08-25 03:54:42Z ferringb $
slash=/
-exec chmod "${@/#${slash}/${D}${slash}}"
+exec chmod "${@/#${slash}/${ED}${slash}}"
}
esyslog() {
+ # not prefixed yet as I don't know if it's possible to have a logger
+ # inside the prefix at all
local pri=
local tag=
source @PORTAGE_BASE@/bin/ebuild.sh
install_qa_check() {
- cd "${D}" || die "cd failed"
+ cd "${ED}" || die "cd failed"
prepall
declare -i UNSAFE=0
- for i in $(find "${D}/" -type f -perm -2002); do
+ for i in $(find "${ED}/" -type f -perm -2002); do
((UNSAFE++))
vecho "UNSAFE SetGID: $i"
chmod -s,o-w "$i"
done
- for i in $(find "${D}/" -type f -perm -4002); do
+ for i in $(find "${ED}/" -type f -perm -4002); do
((UNSAFE++))
vecho "UNSAFE SetUID: $i"
chmod -s,o-w "$i"
done
# Now we look for all world writable files.
- for i in $(find "${D}/" -type f -perm -2); do
+ for i in $(find "${ED}/" -type f -perm -2); do
vecho -ne '\a'
vecho "QA Security Notice:"
- vecho "- ${i:${#D}:${#i}} will be a world writable file."
+ vecho "- ${i:${#ED}:${#i}} will be a world writable file."
vecho "- This may or may not be a security problem, most of the time it is one."
vecho "- Please double check that $PF really needs a world writeable bit and file bugs accordingly."
sleep 1
# Don't want paths that point to the tree where the package was built
# (older, broken libtools would do this). Also check for null paths
# because the loader will search $PWD when it finds null paths.
- f=$(scanelf -qyRF '%r %p' "${D}" | grep -E "(${PORTAGE_BUILDDIR}|: |::|^:|^ )")
+ f=$(scanelf -qyRF '%r %p' "${ED}" | grep -E "(${PORTAGE_BUILDDIR}|: |::|^:|^ )")
if [[ -n ${f} ]] ; then
vecho -ne '\a\n'
vecho "QA Notice: the following files contain insecure RUNPATH's"
fi
# Check for setid binaries but are not built with BIND_NOW
- f=$(scanelf -qyRF '%b %p' "${D}")
+ f=$(scanelf -qyRF '%b %p' "${ED}")
if [[ -n ${f} ]] ; then
vecho -ne '\a\n'
vecho "QA Notice: the following files are setXid, dyn linked, and using lazy bindings"
[[ -n ${!qa_var} ]] && QA_TEXTRELS=${!qa_var}
[[ -n ${QA_STRICT_TEXTRELS} ]] && QA_TEXTRELS=""
export QA_TEXTRELS
- f=$(scanelf -qyRF '%t %p' "${D}" | grep -v 'usr/lib/debug/')
+ f=$(scanelf -qyRF '%t %p' "${ED}" | grep -v 'usr/lib/debug/')
if [[ -n ${f} ]] ; then
scanelf -qyRF '%T %p' "${PORTAGE_BUILDDIR}"/ &> "${T}"/scanelf-textrel.log
vecho -ne '\a\n'
[[ -n ${!qa_var} ]] && QA_WX_LOAD=${!qa_var}
[[ -n ${QA_STRICT_WX_LOAD} ]] && QA_WX_LOAD=""
export QA_EXECSTACK QA_WX_LOAD
- f=$(scanelf -qyRF '%e %p' "${D}" | grep -v 'usr/lib/debug/')
+ f=$(scanelf -qyRF '%e %p' "${ED}" | grep -v 'usr/lib/debug/')
;;
esac
;;
fi
# Save NEEDED information
- scanelf -qyRF '%p %n' "${D}" | sed -e 's:^:/:' > "${PORTAGE_BUILDDIR}"/build-info/NEEDED
+ scanelf -qyRF '%p %n' "${ED}" | sed -e 's:^:/:' > "${PORTAGE_BUILDDIR}"/build-info/NEEDED
if [[ ${insecure_rpath} -eq 1 ]] ; then
die "Aborting due to serious QA concerns with RUNPATH/RPATH"
die "There are ${UNSAFE} unsafe files. Portage will not install them."
fi
- if [[ -d ${D}/${D} ]] ; then
+ if [[ -d ${ED}/${ED} ]] ; then
declare -i INSTALLTOD=0
- for i in $(find "${D}/${D}/"); do
- echo "QA Notice: /${i##${D}/${D}} installed in \${D}/\${D}"
+ for i in $(find "${ED}/${ED}/"); do
+ echo "QA Notice: /${i##${ED}/${ED}} installed in \${ED}/\${ED}"
((INSTALLTOD++))
done
- die "Aborting due to QA concerns: ${INSTALLTOD} files installed in ${D}/${D}"
+ die "Aborting due to QA concerns: ${INSTALLTOD} files installed in ${ED}/${ED}"
unset INSTALLTOD
fi
- if [[ -d ${D}/${EPREFIX} ]] ; then
+ if [[ -d ${ED}/${EPREFIX} ]] ; then
declare -i INSTALLTOD=0
- for i in $(find "${D}/${EPREFIX}/") ; do
- echo "QA Notice: ${i#${D}} double prefix"
+ for i in $(find "${ED}/${EPREFIX}/") ; do
+ echo "QA Notice: ${i#${ED}} double prefix"
((INSTALLTOD++))
done
die "Aborting due to QA concerns: ${INSTALLTOD} double prefix files installed"
unset INSTALLTOD
fi
- if [[ -d ${EDEST} ]] ; then
+ if [[ -d ${D} ]] ; then
declare -i INSTALLTOD=0
- for i in $(find ${EDEST%/} | sed -e "s|^${EDEST%/}||g") ; do
+ for i in $(find ${D%/} | sed -e "s|^${D%/}||g") ; do
if [[ ${#EPREFIX} -gt ${#i} && ${EPREFIX:0:${#i}} != ${i} ]] ; then
echo "QA Notice: ${i} outside of prefix"
((INSTALLTOD++))
fi
local find_log="${T}/find-portage-log"
- find "${D}"/ -user ${PORTAGE_USER:-portage} -print0 > "${find_log}"
+ find "${ED}"/ -user ${PORTAGE_USER:-portage} -print0 > "${find_log}"
if [[ -s ${find_log} ]] ; then
xargs -0 chown -h ${PORTAGE_INST_UID:-0} < "${find_log}"
fi
- find "${D}"/ -group ${PORTAGE_GROUP:-portage} -print0 > "${find_log}"
+ find "${ED}"/ -group ${PORTAGE_GROUP:-portage} -print0 > "${find_log}"
if [[ -s ${find_log} ]] ; then
xargs -0 chgrp -h ${PORTAGE_INST_GID:-0} < "${find_log}"
fi
rm -f "${find_log}"
# Portage regenerates this on the installed system.
- if [ -f "${D}/usr/share/info/dir.gz" ]; then
- rm -f "${D}/usr/share/info/dir.gz"
+ if [ -f "${ED}/usr/share/info/dir.gz" ]; then
+ rm -f "${ED}/usr/share/info/dir.gz"
fi
if hasq multilib-strict ${FEATURES} && [ -x file -a -x find -a \
local abort=no firstrun=yes
MULTILIB_STRICT_EXEMPT=$(echo ${MULTILIB_STRICT_EXEMPT} | sed -e 's:\([(|)]\):\\\1:g')
for dir in ${MULTILIB_STRICT_DIRS}; do
- [ -d "${D}/${dir}" ] || continue
- for file in $(find ${D}/${dir} -type f | grep -v "^${D}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
+ [ -d "${ED}/${dir}" ] || continue
+ for file in $(find ${ED}/${dir} -type f | grep -v "^${ED}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
if file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" ; then
if [[ ${firstrun} == yes ]] ; then
echo "Files matching a file type that is not allowed:"
firstrun=no
fi
abort=yes
- echo " ${file#${D}//}"
+ echo " ${file#${ED}//}"
fi
done
done
tar ${tar_options} -cf - . | bzip2 -f > "${pkg_tmp}" || \
die "Failed to create tarball"
cd ..
- export PYTHONPATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
+ export PYTHONPATH=${PORTAGE_PYM_PATH:-${EPREFIX}/usr/lib/portage/pym}
python -c "import xpak; t=xpak.tbz2('${pkg_tmp}'); t.recompose('${PORTAGE_BUILDDIR}/build-info')"
if [ $? -ne 0 ]; then
rm -f "${pkg_tmp}"
-#!/usr/bin/python -O
+#!@PYTHON@ -O
import profile,time,sys,os
-sys.path = ["/usr/lib/portage/bin","/usr/lib/portage/pym"]+sys.path
+sys.path = ["@PORTAGE_BASE@/bin","@PORTAGE_BASE@/pym"]+sys.path
def clock():
return time.time()
profile.run("import emerge", os.getcwd()+"/prof")
-class StatsProcesser:
+ class StatsProcesser:
def __init__(self, stats):
self.output = []
self.last = ""
# Distributed under the terms of the GNU General Public License v2
# $Id: /var/cvsroot/gentoo-src/portage/bin/portage_gpg_update.sh,v 1.2 2004/10/04 13:56:50 vapier Exp $
-wget -O - http://www.gentoo.org/proj/en/devrel/roll-call/userinfo.xml | sed 's:.*\(0x[0-9a-fA-F]\+\)[^0-9a-fA-F].*:\1:gp;d' | xargs gpg -vvv --no-default-keyring --no-permission-warning --homedir /usr/portage/metadata --keyring "gentoo.gpg" --keyserver subkeys.pgp.net --recv-keys &> gpg.log
+wget -O - http://www.gentoo.org/proj/en/devrel/roll-call/userinfo.xml | sed 's:.*\(0x[0-9a-fA-F]\+\)[^0-9a-fA-F].*:\1:gp;d' | xargs gpg -vvv --no-default-keyring --no-permission-warning --homedir "${EPREFIX}"/usr/portage/metadata --keyring "gentoo.gpg" --keyserver subkeys.pgp.net --recv-keys &> gpg.log
# this should help to ensure that all (most?) shared libraries are executable
# and that all libtool scripts / static libraries are not executable
-for i in "${D}"/opt/*/lib{,32,64} \
- "${D}"/lib{,32,64} \
- "${D}"/usr/lib{,32,64} \
- "${D}"/usr/X11R6/lib{,32,64} ; do
+for i in "${ED}"/opt/*/lib{,32,64} \
+ "${ED}"/lib{,32,64} \
+ "${ED}"/usr/lib{,32,64} \
+ "${ED}"/usr/X11R6/lib{,32,64} ; do
[[ ! -d ${i} ]] && continue
for j in "${i}"/*.so.* "${i}"/*.so ; do
[[ ! -e ${j} ]] && continue
[[ -L ${j} ]] && continue
[[ -x ${j} ]] && continue
- echo "making executable: /${j/${D}/}"
+ echo "making executable: /${j/${ED}/}"
chmod +x "${j}"
done
[[ ! -e ${j} ]] && continue
[[ -L ${j} ]] && continue
[[ ! -x ${j} ]] && continue
- echo "removing executable bit: /${j/${D}/}"
+ echo "removing executable bit: /${j/${ED}/}"
chmod -x "${j}"
done
done
# /lib, we have to make sure we have a linker script in /usr/lib along side
# the static library, or gcc will utilize the static lib when linking :(.
# http://bugs.gentoo.org/4411
-for a in "${D}"/usr/lib*/*.a ; do
+for a in "${ED}"/usr/lib*/*.a ; do
s=${a%.a}.so
if [[ ! -e ${s} ]] ; then
s=${s%usr/*}${s##*/usr/}
done
# Make sure people don't store libtool files or static libs in /lib
-f=$(ls "${D}"/lib*/*.{a,la} 2>/dev/null)
+f=$(ls "${ED}"/lib*/*.{a,la} 2>/dev/null)
if [[ -n ${f} ]] ; then
echo -e "\n\aQA Notice: excessive files found in the / partition\a"
echo "${f}"
fi
# Verify that the libtool files don't contain bogus $D entries.
-for a in "${D}"/usr/lib*/*.la ; do
+for a in "${ED}"/usr/lib*/*.la ; do
s=${a##*/}
- if grep -qs "${D}" "${a}" ; then
+ if grep -qs "${ED}" "${a}" ; then
echo -e "\n\aQA Notice: ${s} appears to contain PORTAGE_TMPDIR paths\a"
sleep 1
fi
if type -p scanelf > /dev/null ; then
# Run some sanity checks on shared libraries
-for d in "${D}"/lib* "${D}"/usr/lib* ; do
+for d in "${ED}"/lib* "${ED}"/usr/lib* ; do
f=$(scanelf -ByF '%S %p' "${d}"/lib*.so* | gawk '$2 == "" { print }')
if [[ -n ${f} ]] ; then
echo -e "\n\aQA Notice: the following shared libraries lack a SONAME\a"
# Distributed under the terms of the GNU General Public License v2
# $Id: /var/cvsroot/gentoo-src/portage/bin/prepalldocs,v 1.6 2004/10/04 13:56:50 vapier Exp $
-z="`find "${D}"/usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null`"
+z="`find "${ED}"/usr/share/doc \( -type f -or -type l \) -not -name "*.gz" -not -name "*.js" 2>/dev/null`"
for y in ${z} ; do
if [ -L "${y}" ] ; then
# Distributed under the terms of the GNU General Public License v2
# $Id: /var/cvsroot/gentoo-src/portage/bin/prepallinfo,v 1.6 2004/10/04 13:56:50 vapier Exp $
-[[ ! -d ${D}/usr/share/info ]] && exit 0
+[[ ! -d ${ED}/usr/share/info ]] && exit 0
echo "info:"
exec prepinfo
ret=0
echo "man:"
-for x in "${D}"/opt/*/man "${D}"/usr/share/man "${D}"/usr/local/man "${D}"/usr/X11R6/man ; do
+for x in "${ED}"/opt/*/man "${ED}"/usr/share/man "${ED}"/usr/local/man "${ED}"/usr/X11R6/man ; do
if [[ -d ${x} ]] ; then
- x=${x#${D}}
+ x=${x#${ED}}
x=${x%/man}
prepman "${x}"
((ret+=$?))
# Distributed under the terms of the GNU General Public License v2
# $Id: /var/cvsroot/gentoo-src/portage/bin/prepallstrip,v 1.12 2004/10/04 13:56:50 vapier Exp $
-exec prepstrip "${D}"
+exec prepstrip "${ED}"
# $Id: /var/cvsroot/gentoo-src/portage/bin/prepinfo,v 1.6.2.1 2005/05/29 12:40:08 jstubbs Exp $
if [ -z "$1" ] ; then
- z="${D}/usr/share/info"
+ z="${ED}/usr/share/info"
else
- if [ -d "${D}$1/share/info" ] ; then
- z="${D}$1/share/info"
+ if [ -d "${ED}$1/share/info" ] ; then
+ z="${ED}$1/share/info"
else
- z="${D}$1/info"
+ z="${ED}$1/info"
fi
fi
fi
if [ -z "$1" ] ; then
- z="${D}/usr/${CONF_LIBDIR}"
+ z="${ED}/usr/${CONF_LIBDIR}"
else
- z="${D}$1/${CONF_LIBDIR}"
+ z="${ED}$1/${CONF_LIBDIR}"
fi
if [ -d "${z}" ] ; then
# $Id: /var/cvsroot/gentoo-src/portage/bin/prepman,v 1.10.2.3 2005/05/29 12:40:08 jstubbs Exp $
if [[ -z $1 ]] ; then
- z="${D}/usr/share/man"
+ z="${ED}/usr/share/man"
else
- z="${D}$1/man"
+ z="${ED}$1/man"
fi
if [[ ! -d ${z} ]] ; then
- echo "QA Notice: prepman called with non-existent dir '${z#${D}}'" 2>&1
+ echo "QA Notice: prepman called with non-existent dir '${z#${ED}}'" 2>&1
exit 0
fi
save_elf_debug() {
local x=$1
- local y="${D}usr/lib/debug/${x:${#D}}.debug"
+ local y="${ED}usr/lib/debug/${x:${#ED}}.debug"
if hasq installsources ${FEATURES} && [ -x "${EPREFIX}"/usr/bin/debugedit ] ; then
local sources_dir=/usr/src/debug/${CATEGORY}/${PF}
debugedit -b "${WORKDIR}" -d "${EPREFIX}/${sources_dir}" \
-l "${T}"/debug.sources "${x}"
if [[ -s ${T}/debug.sources ]] ; then
- [[ -d ${D}${sources_dir} ]] || mkdir -p "${D}${sources_dir}"
+ [[ -d ${ED}${sources_dir} ]] || mkdir -p "${ED}${sources_dir}"
cat "${T}"/debug.sources | (cd "${WORKDIR}"; LANG=C sort -z -u | \
- rsync -aL0 --files-from=- "${WORKDIR}/" "${D}${sources_dir}/" )
+ rsync -aL0 --files-from=- "${WORKDIR}/" "${ED}${sources_dir}/" )
fi
fi
set +o noglob
if [[ ${f} == *"current ar archive"* ]] ; then
- vecho " ${x:${#D}}"
+ vecho " ${x:${#ED}}"
[[ -n ${NOSTRIP} ]] && continue
[[ ${stripitbaby} -eq 1 ]] && ${STRIP} -g "${x}"
fi
if [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* ]] ; then
- vecho " ${x:${#D}}"
+ vecho " ${x:${#ED}}"
save_elf_debug "${x}"
[[ -n ${NOSTRIP} ]] && continue
[[ ${stripitbaby} -eq 1 ]] && ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
import sys
sys.path.insert(0, "@PORTAGE_BASE@/pym")
import os
-import portage, string, re
+import portage, string, re, portage_const
__candidatematcher__ = re.compile("^[0-9]+: \\*\\*\\* emerge ")
__noncandidatematcher__ = re.compile(" sync( |$)| clean( |$)| search( |$)|--oneshot|--fetchonly| unmerge( |$)")
syslist = portage.settings.packages
syslist = filter(issyspkg, syslist)
-logfile = portage.grabfile("/var/log/emerge.log")
+logfile = portage.grabfile(portage_const.EPREFIX+"/var/log/emerge.log")
biglist = filter(iscandidate, logfile)
biglist = map(getpkginfo, biglist)
tmplist = []
-#!/bin/bash
+#!@BASH@
# Copyright 2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
mysettings["EPREFIX"] = portage_const.EPREFIX.rstrip(os.sep)
mysettings["ROOT"] = myroot
- mysettings["PROOT"] = normalize_path(myroot + mysettings["EPREFIX"]) + os.sep
+ mysettings["EROOT"] = normalize_path(myroot + mysettings["EPREFIX"]) + os.sep
mysettings["STARTDIR"] = getcwd()
mysettings["EBUILD"] = ebuild_path
mysettings["HOME"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "homedir")
mysettings["WORKDIR"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "work")
- 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["D"] = os.path.join(mysettings["PORTAGE_BUILDDIR"], "image") + os.sep
+ mysettings["ED"] = 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(