aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'portage_with_autodep/bin/ebuild-helpers')
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/bsd/sed (renamed from portage_with_autodep/bin/ebuild-helpers/sed)14
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dobin11
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dodir7
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dodoc5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/doexe11
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dohard9
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/doheader19
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/doinfo11
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/doins17
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dolib7
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/doman9
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/domo12
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dosbin11
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dosed9
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/dosym18
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/ecompressdir73
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/fowners13
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/fperms7
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/keepdir20
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newbin5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newconfd5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newdoc5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newenvd5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newexe5
l---------portage_with_autodep/bin/ebuild-helpers/newheader1
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newinitd5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newins3
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newlib.a5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newlib.so5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newman5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/newsbin5
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/prepall11
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/prepalldocs8
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/prepallinfo7
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/prepallman7
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/prepallstrip7
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/prepinfo9
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/preplib9
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/prepman11
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/prepstrip290
l---------portage_with_autodep/bin/ebuild-helpers/unprivileged/chgrp1
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/unprivileged/chown41
-rwxr-xr-xportage_with_autodep/bin/ebuild-helpers/xattr/install12
43 files changed, 563 insertions, 187 deletions
diff --git a/portage_with_autodep/bin/ebuild-helpers/sed b/portage_with_autodep/bin/ebuild-helpers/bsd/sed
index b21e856..01b8847 100755
--- a/portage_with_autodep/bin/ebuild-helpers/sed
+++ b/portage_with_autodep/bin/ebuild-helpers/bsd/sed
@@ -1,27 +1,27 @@
#!/bin/bash
-# Copyright 2007 Gentoo Foundation
+# Copyright 2007-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
scriptpath=${BASH_SOURCE[0]}
scriptname=${scriptpath##*/}
-if [[ sed == ${scriptname} ]] && [[ -n ${ESED} ]]; then
+if [[ sed == ${scriptname} && -n ${ESED} ]]; then
exec ${ESED} "$@"
elif type -P g${scriptname} > /dev/null ; then
exec g${scriptname} "$@"
else
old_IFS="${IFS}"
IFS=":"
-
+
for path in $PATH; do
- [[ ${path}/${scriptname} == ${scriptpath} ]] && continue
if [[ -x ${path}/${scriptname} ]]; then
- exec ${path}/${scriptname} "$@"
+ [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue
+ exec "${path}/${scriptname}" "$@"
exit 0
fi
done
-
+
IFS="${old_IFS}"
fi
-
+
exit 1
diff --git a/portage_with_autodep/bin/ebuild-helpers/dobin b/portage_with_autodep/bin/ebuild-helpers/dobin
index e385455..f90d893 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dobin
+++ b/portage_with_autodep/bin/ebuild-helpers/dobin
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,15 +9,18 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-if [[ ! -d ${D}${DESTTREE}/bin ]] ; then
- install -d "${D}${DESTTREE}/bin" || { helpers_die "${0##*/}: failed to install ${D}${DESTTREE}/bin"; exit 2; }
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ! -d ${ED}${DESTTREE}/bin ]] ; then
+ install -d "${ED}${DESTTREE}/bin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/bin"; exit 2; }
fi
ret=0
for x in "$@" ; do
if [[ -e ${x} ]] ; then
- install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/bin"
+ install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${DESTTREE}/bin"
else
echo "!!! ${0##*/}: $x does not exist" 1>&2
false
diff --git a/portage_with_autodep/bin/ebuild-helpers/dodir b/portage_with_autodep/bin/ebuild-helpers/dodir
index f40bee7..90a3efe 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dodir
+++ b/portage_with_autodep/bin/ebuild-helpers/dodir
@@ -1,10 +1,13 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-install -d ${DIROPTIONS} "${@/#/${D}/}"
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+install -d ${DIROPTIONS} "${@/#/${ED}/}"
ret=$?
[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
exit $ret
diff --git a/portage_with_autodep/bin/ebuild-helpers/dodoc b/portage_with_autodep/bin/ebuild-helpers/dodoc
index 65713db..1f333a6 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dodoc
+++ b/portage_with_autodep/bin/ebuild-helpers/dodoc
@@ -9,7 +9,10 @@ if [ $# -lt 1 ] ; then
exit 1
fi
-dir="${D}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+dir="${ED}usr/share/doc/${PF}/${_E_DOCDESTTREE_}"
if [ ! -d "${dir}" ] ; then
install -d "${dir}"
fi
diff --git a/portage_with_autodep/bin/ebuild-helpers/doexe b/portage_with_autodep/bin/ebuild-helpers/doexe
index 360800e..fb228f9 100755
--- a/portage_with_autodep/bin/ebuild-helpers/doexe
+++ b/portage_with_autodep/bin/ebuild-helpers/doexe
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,8 +9,11 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-if [[ ! -d ${D}${_E_EXEDESTTREE_} ]] ; then
- install -d "${D}${_E_EXEDESTTREE_}"
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ! -d ${ED}${_E_EXEDESTTREE_} ]] ; then
+ install -d "${ED}${_E_EXEDESTTREE_}"
fi
TMP=$T/.doexe_tmp
@@ -29,7 +32,7 @@ for x in "$@" ; do
mysrc="${x}"
fi
if [ -e "$mysrc" ] ; then
- install $EXEOPTIONS "$mysrc" "$D$_E_EXEDESTTREE_"
+ install $EXEOPTIONS "$mysrc" "$ED$_E_EXEDESTTREE_"
else
echo "!!! ${0##*/}: $mysrc does not exist" 1>&2
false
diff --git a/portage_with_autodep/bin/ebuild-helpers/dohard b/portage_with_autodep/bin/ebuild-helpers/dohard
index 2270487..b52fd7c 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dohard
+++ b/portage_with_autodep/bin/ebuild-helpers/dohard
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2007 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
if [[ $# -ne 2 ]] ; then
@@ -7,7 +7,10 @@ if [[ $# -ne 2 ]] ; then
exit 1
fi
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
destdir=${2%/*}
-[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
+[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
-exec ln -f "${D}$1" "${D}$2"
+exec ln -f "${ED}$1" "${ED}$2"
diff --git a/portage_with_autodep/bin/ebuild-helpers/doheader b/portage_with_autodep/bin/ebuild-helpers/doheader
new file mode 100755
index 0000000..3795365
--- /dev/null
+++ b/portage_with_autodep/bin/ebuild-helpers/doheader
@@ -0,0 +1,19 @@
+#!/bin/bash
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
+if ! ___eapi_has_doheader; then
+ die "${0##*/} is not supported in EAPI ${EAPI}"
+fi
+
+if [[ $# -lt 1 ]] || [[ $1 == -r && $# -lt 2 ]] ; then
+ __helpers_die "${0##*/}: at least one argument needed"
+ exit 1
+fi
+
+exec \
+env \
+INSDESTTREE="/usr/include/" \
+doins "$@"
diff --git a/portage_with_autodep/bin/ebuild-helpers/doinfo b/portage_with_autodep/bin/ebuild-helpers/doinfo
index 54fb8da..8fd7d45 100755
--- a/portage_with_autodep/bin/ebuild-helpers/doinfo
+++ b/portage_with_autodep/bin/ebuild-helpers/doinfo
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,11 +9,14 @@ if [[ -z $1 ]] ; then
exit 1
fi
-if [[ ! -d ${D}usr/share/info ]] ; then
- install -d "${D}usr/share/info" || { helpers_die "${0##*/}: failed to install ${D}usr/share/info"; exit 1; }
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ! -d ${ED}usr/share/info ]] ; then
+ install -d "${ED}usr/share/info" || { helpers_die "${0##*/}: failed to install ${ED}usr/share/info"; exit 1; }
fi
-install -m0644 "$@" "${D}usr/share/info"
+install -m0644 "$@" "${ED}usr/share/info"
rval=$?
if [ $rval -ne 0 ] ; then
for x in "$@" ; do
diff --git a/portage_with_autodep/bin/ebuild-helpers/doins b/portage_with_autodep/bin/ebuild-helpers/doins
index 7dec146..443bfdb 100755
--- a/portage_with_autodep/bin/ebuild-helpers/doins
+++ b/portage_with_autodep/bin/ebuild-helpers/doins
@@ -27,12 +27,15 @@ else
DOINSRECUR=n
fi
-if [[ ${INSDESTTREE#${D}} != "${INSDESTTREE}" ]]; then
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) export ED="${D}" ;; esac
+
+if [[ ${INSDESTTREE#${ED}} != "${INSDESTTREE}" ]]; then
vecho "-------------------------------------------------------" 1>&2
- vecho "You should not use \${D} with helpers." 1>&2
+ vecho "You should not use \${D} or \${ED} with helpers." 1>&2
vecho " --> ${INSDESTTREE}" 1>&2
vecho "-------------------------------------------------------" 1>&2
- helpers_die "${0##*/} used with \${D}"
+ helpers_die "${0##*/} used with \${D} or \${ED}"
exit 1
fi
@@ -49,7 +52,7 @@ export TMP=$T/.doins_tmp
# Use separate directories to avoid potential name collisions.
mkdir -p "$TMP"/{1,2}
-[[ ! -d ${D}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
+[[ ! -d ${ED}${INSDESTTREE} ]] && dodir "${INSDESTTREE}"
_doins() {
local mysrc="$1" mydir="$2" cleanup="" rval
@@ -63,8 +66,8 @@ _doins() {
# $PORTAGE_ACTUAL_DISTDIR/.
if [ $PRESERVE_SYMLINKS = y ] && \
! [[ $(readlink "$mysrc") == "$PORTAGE_ACTUAL_DISTDIR"/* ]] ; then
- rm -rf "$D$INSDESTTREE/$mydir/${mysrc##*/}" || return $?
- cp -P "$mysrc" "$D$INSDESTTREE/$mydir/${mysrc##*/}"
+ rm -rf "${ED}$INSDESTTREE/$mydir/${mysrc##*/}" || return $?
+ cp -P "$mysrc" "${ED}$INSDESTTREE/$mydir/${mysrc##*/}"
return $?
else
cp "$mysrc" "$TMP/2/${mysrc##*/}" || return $?
@@ -73,7 +76,7 @@ _doins() {
fi
fi
- install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}/${mydir}"
+ install ${INSOPTIONS} "${mysrc}" "${ED}${INSDESTTREE}/${mydir}"
rval=$?
[[ -n ${cleanup} ]] && rm -f "${cleanup}"
[ $rval -ne 0 ] && echo "!!! ${0##*/}: $mysrc does not exist" 1>&2
diff --git a/portage_with_autodep/bin/ebuild-helpers/dolib b/portage_with_autodep/bin/ebuild-helpers/dolib
index 87ade42..9af5418 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dolib
+++ b/portage_with_autodep/bin/ebuild-helpers/dolib
@@ -1,9 +1,12 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
# Setup ABI cruft
LIBDIR_VAR="LIBDIR_${ABI}"
if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
@@ -12,7 +15,7 @@ fi
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
diff --git a/portage_with_autodep/bin/ebuild-helpers/doman b/portage_with_autodep/bin/ebuild-helpers/doman
index 4561bef..b4047ce 100755
--- a/portage_with_autodep/bin/ebuild-helpers/doman
+++ b/portage_with_autodep/bin/ebuild-helpers/doman
@@ -9,6 +9,9 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
i18n=""
ret=0
@@ -44,11 +47,11 @@ for x in "$@" ; do
if [[ ${mandir} == *man[0-9n] ]] ; 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 -m0644 "${x}" "${D}/usr/share/man/${mandir}/${name}"
+ install -m0644 "${x}" "${ED}/usr/share/man/${mandir}/${name}"
((ret|=$?))
elif [[ ! -e ${x} ]] ; then
echo "!!! ${0##*/}: $x does not exist" 1>&2
diff --git a/portage_with_autodep/bin/ebuild-helpers/domo b/portage_with_autodep/bin/ebuild-helpers/domo
index 4737f44..d994343 100755
--- a/portage_with_autodep/bin/ebuild-helpers/domo
+++ b/portage_with_autodep/bin/ebuild-helpers/domo
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,8 +9,12 @@ if [ ${mynum} -lt 1 ] ; then
helpers_die "${0}: at least one argument needed"
exit 1
fi
-if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then
- install -d "${D}${DESTTREE}/share/locale/"
+
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [ ! -d "${ED}${DESTTREE}/share/locale" ] ; then
+ install -d "${ED}${DESTTREE}/share/locale/"
fi
ret=0
@@ -18,7 +22,7 @@ ret=0
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
diff --git a/portage_with_autodep/bin/ebuild-helpers/dosbin b/portage_with_autodep/bin/ebuild-helpers/dosbin
index 87a3091..d101c8a 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dosbin
+++ b/portage_with_autodep/bin/ebuild-helpers/dosbin
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,15 +9,18 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
-if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then
- install -d "${D}${DESTTREE}/sbin" || { helpers_die "${0##*/}: failed to install ${D}${DESTTREE}/sbin"; exit 2; }
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ! -d ${ED}${DESTTREE}/sbin ]] ; then
+ install -d "${ED}${DESTTREE}/sbin" || { helpers_die "${0##*/}: failed to install ${ED}${DESTTREE}/sbin"; exit 2; }
fi
ret=0
for x in "$@" ; do
if [[ -e ${x} ]] ; then
- install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/sbin"
+ install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${ED}${DESTTREE}/sbin"
else
echo "!!! ${0##*/}: ${x} does not exist" 1>&2
false
diff --git a/portage_with_autodep/bin/ebuild-helpers/dosed b/portage_with_autodep/bin/ebuild-helpers/dosed
index afc949b..f202df7 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dosed
+++ b/portage_with_autodep/bin/ebuild-helpers/dosed
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
if [[ $# -lt 1 ]] ; then
@@ -7,12 +7,15 @@ if [[ $# -lt 1 ]] ; then
exit 1
fi
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
ret=0
file_found=0
-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
file_found=1
diff --git a/portage_with_autodep/bin/ebuild-helpers/dosym b/portage_with_autodep/bin/ebuild-helpers/dosym
index 500dad0..2489e22 100755
--- a/portage_with_autodep/bin/ebuild-helpers/dosym
+++ b/portage_with_autodep/bin/ebuild-helpers/dosym
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -9,10 +9,22 @@ if [[ $# -ne 2 ]] ; then
exit 1
fi
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+if [[ ${2} == */ ]] || \
+ [[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then
+ # implicit basename not allowed by PMS (bug #379899)
+ eqawarn "QA Notice: dosym target omits basename: '${2}'"
+fi
+
destdir=${2%/*}
-[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
+[[ ! -d ${ED}${destdir} ]] && dodir "${destdir}"
+# when absolute, prefix with offset for Gentoo Prefix
+target="${1}"
+[[ ${target:0:1} == "/" ]] && target="${EPREFIX}${target}"
+ln -snf "${target}" "${ED}${2}"
-ln -snf "$1" "${D}$2"
ret=$?
[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
exit $ret
diff --git a/portage_with_autodep/bin/ebuild-helpers/ecompressdir b/portage_with_autodep/bin/ebuild-helpers/ecompressdir
index 7a95120..a2c9e52 100755
--- a/portage_with_autodep/bin/ebuild-helpers/ecompressdir
+++ b/portage_with_autodep/bin/ebuild-helpers/ecompressdir
@@ -1,27 +1,30 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
if [[ -z $1 ]] ; then
helpers_die "${0##*/}: at least one argument needed"
exit 1
fi
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} EPREFIX= ;; esac
+
case $1 in
--ignore)
shift
for skip in "$@" ; do
- [[ -d ${D}${skip} || -f ${D}${skip} ]] \
- && >> "${D}${skip}.ecompress.skip"
+ [[ -d ${ED}${skip} || -f ${ED}${skip} ]] \
+ && >> "${ED}${skip}.ecompress.skip"
done
exit 0
;;
--queue)
shift
set -- "${@/%/.ecompress.dir}"
- set -- "${@/#/${D}}"
+ set -- "${@/#/${ED}}"
ret=0
for x in "$@" ; do
>> "$x"
@@ -32,10 +35,10 @@ case $1 in
;;
--dequeue)
[[ -n $2 ]] && vecho "${0##*/}: --dequeue takes no additional arguments" 1>&2
- find "${D}" -name '*.ecompress.dir' -print0 \
- | sed -e 's:\.ecompress\.dir::g' -e "s:${D}:/:g" \
+ find "${ED}" -name '*.ecompress.dir' -print0 \
+ | sed -e 's:\.ecompress\.dir::g' -e "s:${ED}:/:g" \
| ${XARGS} -0 ecompressdir
- find "${D}" -name '*.ecompress.skip' -print0 | ${XARGS} -0 rm -f
+ find "${ED}" -name '*.ecompress.skip' -print0 | ${XARGS} -0 rm -f
exit 0
;;
--*)
@@ -66,6 +69,17 @@ funk_up_dir() {
while read -r -d $'\0' brokenlink ; do
[[ -e ${brokenlink} ]] && continue
olddest=$(readlink "${brokenlink}")
+ # Ignore temporarily broken symlinks due to
+ # _relocate_skip_dirs (bug #399595), and handle
+ # absolute symlinks to files that aren't merged
+ # yet (bug #405327).
+ if [[ ${olddest} == /* ]] ; then
+ [ -e "${D}${olddest}" ] && continue
+ skip_dir_dest=${T}/ecompress-skip/${olddest#${EPREFIX}}
+ else
+ skip_dir_dest=${T}/ecompress-skip/${actual_dir#${ED}}/${brokenlink%/*}/${olddest}
+ fi
+ [[ -e ${skip_dir_dest} ]] && continue
[[ ${act} == "compress" ]] \
&& newdest="${olddest}${suffix}" \
|| newdest="${olddest%${suffix}}"
@@ -95,18 +109,28 @@ _relocate_skip_dirs() {
mv "${src}.ecompress.skip" "${dst}.ecompress.skip"
done
}
-hide_skip_dirs() { _relocate_skip_dirs "${D}" "${T}"/ecompress-skip/ ; }
-restore_skip_dirs() { _relocate_skip_dirs "${T}"/ecompress-skip/ "${D}" ; }
+hide_skip_dirs() { _relocate_skip_dirs "${ED}" "${T}"/ecompress-skip/ ; }
+restore_skip_dirs() { _relocate_skip_dirs "${T}"/ecompress-skip/ "${ED}" ; }
ret=0
rm -rf "${T}"/ecompress-skip
+decompressors=(
+ ".Z" "gunzip -f"
+ ".gz" "gunzip -f"
+ ".bz2" "bunzip2 -f"
+ ".xz" "unxz -f"
+ ".lzma" "unxz -f"
+)
+
+multijob_init
+
for dir in "$@" ; do
dir=${dir#/}
- dir="${D}${dir}"
+ dir="${ED}${dir}"
if [[ ! -d ${dir} ]] ; then
- vecho "${0##*/}: /${dir#${D}} does not exist!"
+ vecho "${0##*/}: /${dir#${ED}} does not exist!"
continue
fi
cd "${dir}"
@@ -122,18 +146,31 @@ for dir in "$@" ; do
find "${dir}" -type f -name '*.ecompress.file' -print0 | ${XARGS} -0 rm -f
# not uncommon for packages to compress doc files themselves
- funk_up_dir "decompress" ".Z" "gunzip -f"
- funk_up_dir "decompress" ".gz" "gunzip -f"
- funk_up_dir "decompress" ".bz2" "bunzip2 -f"
+ for (( d = 0; d < ${#decompressors[@]}; d += 2 )) ; do
+ # It's faster to parallelize at this stage than to try to
+ # parallelize the compressors. This is because the find|xargs
+ # ends up launching less compressors overall, so the overhead
+ # of forking children ends up dominating.
+ (
+ multijob_child_init
+ funk_up_dir "decompress" "${decompressors[i]}" "${decompressors[i+1]}"
+ ) &
+ multijob_post_fork
+ : $(( ret |= $? ))
+ done
# forcibly break all hard links as some compressors whine about it
find "${dir}" -type f -links +1 -exec env file="{}" sh -c \
'cp -p "${file}" "${file}.ecompress.break" ; mv -f "${file}.ecompress.break" "${file}"' \;
+ multijob_finish
+ : $(( ret |= $? ))
+
# now lets do our work
- [[ -z ${suffix} ]] && continue
- vecho "${0##*/}: $(ecompress --bin) /${actual_dir#${D}}"
- funk_up_dir "compress" "${suffix}" "ecompress"
+ if [[ -n ${suffix} ]] ; then
+ vecho "${0##*/}: $(ecompress --bin) /${actual_dir#${ED}}"
+ funk_up_dir "compress" "${suffix}" "ecompress"
+ fi
# finally, restore the skipped stuff
restore_skip_dirs
diff --git a/portage_with_autodep/bin/ebuild-helpers/fowners b/portage_with_autodep/bin/ebuild-helpers/fowners
index 4cc6bfa..a213c9e 100755
--- a/portage_with_autodep/bin/ebuild-helpers/fowners
+++ b/portage_with_autodep/bin/ebuild-helpers/fowners
@@ -1,13 +1,22 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) EPREFIX= ED=${D} ;; esac
+
# we can't prefix all arguments because
# chown takes random options
slash="/"
-chown "${@/#${slash}/${D}${slash}}"
+chown "${@/#${slash}/${ED}${slash}}"
ret=$?
+
+if [[ ${ret} != 0 && -n ${EPREFIX} && ${EUID} != 0 ]] ; then
+ ewarn "fowners failure ignored in Prefix with non-privileged user"
+ exit 0
+fi
+
[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
exit $ret
diff --git a/portage_with_autodep/bin/ebuild-helpers/fperms b/portage_with_autodep/bin/ebuild-helpers/fperms
index 0260bdc..a2f77ea 100755
--- a/portage_with_autodep/bin/ebuild-helpers/fperms
+++ b/portage_with_autodep/bin/ebuild-helpers/fperms
@@ -1,13 +1,16 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
# we can't prefix all arguments because
# chmod takes random options
slash="/"
-chmod "${@/#${slash}/${D}${slash}}"
+chmod "${@/#${slash}/${ED}${slash}}"
ret=$?
[[ $ret -ne 0 ]] && helpers_die "${0##*/} failed"
exit $ret
diff --git a/portage_with_autodep/bin/ebuild-helpers/keepdir b/portage_with_autodep/bin/ebuild-helpers/keepdir
new file mode 100755
index 0000000..bec2feb
--- /dev/null
+++ b/portage_with_autodep/bin/ebuild-helpers/keepdir
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
+if ! ___eapi_has_prefix_variables; then
+ ED=${D}
+fi
+
+dodir "$@"
+ret=$?
+
+for x in "$@"; do
+ >> "${ED}${x}/.keep_${CATEGORY}_${PN}-${SLOT%/*}" || \
+ { echo "!!! ${0##*/}: cannot write .keep in ${ED}${x}" 1>&2; ret=1; }
+done
+
+[[ ${ret} -ne 0 ]] && __helpers_die "${0##*/} failed"
+exit ${ret}
diff --git a/portage_with_autodep/bin/ebuild-helpers/newbin b/portage_with_autodep/bin/ebuild-helpers/newbin
index 30f19b0..bf98744 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newbin
+++ b/portage_with_autodep/bin/ebuild-helpers/newbin
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec dobin "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newconfd b/portage_with_autodep/bin/ebuild-helpers/newconfd
index 5752cfa..fa3710d 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newconfd
+++ b/portage_with_autodep/bin/ebuild-helpers/newconfd
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec doconfd "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newdoc b/portage_with_autodep/bin/ebuild-helpers/newdoc
index f97ce0d..df6fb1d 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newdoc
+++ b/portage_with_autodep/bin/ebuild-helpers/newdoc
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec dodoc "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newenvd b/portage_with_autodep/bin/ebuild-helpers/newenvd
index 83c556e..c54af05 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newenvd
+++ b/portage_with_autodep/bin/ebuild-helpers/newenvd
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec doenvd "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newexe b/portage_with_autodep/bin/ebuild-helpers/newexe
index 92dbe9f..9bcf64b 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newexe
+++ b/portage_with_autodep/bin/ebuild-helpers/newexe
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec doexe "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newheader b/portage_with_autodep/bin/ebuild-helpers/newheader
new file mode 120000
index 0000000..59a0db2
--- /dev/null
+++ b/portage_with_autodep/bin/ebuild-helpers/newheader
@@ -0,0 +1 @@
+newins \ No newline at end of file
diff --git a/portage_with_autodep/bin/ebuild-helpers/newinitd b/portage_with_autodep/bin/ebuild-helpers/newinitd
index fc6003a..03bbe68 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newinitd
+++ b/portage_with_autodep/bin/ebuild-helpers/newinitd
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec doinitd "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newins b/portage_with_autodep/bin/ebuild-helpers/newins
index 065477f..adf2d80 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newins
+++ b/portage_with_autodep/bin/ebuild-helpers/newins
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" || exit $?
case "$EAPI" in
0|1|2|3|3_pre2)
diff --git a/portage_with_autodep/bin/ebuild-helpers/newlib.a b/portage_with_autodep/bin/ebuild-helpers/newlib.a
index eef4104..7ff8195 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newlib.a
+++ b/portage_with_autodep/bin/ebuild-helpers/newlib.a
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec dolib.a "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newlib.so b/portage_with_autodep/bin/ebuild-helpers/newlib.so
index c8696f3..fd4c097 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newlib.so
+++ b/portage_with_autodep/bin/ebuild-helpers/newlib.so
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec dolib.so "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newman b/portage_with_autodep/bin/ebuild-helpers/newman
index ffb8a2d..889e0f9 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newman
+++ b/portage_with_autodep/bin/ebuild-helpers/newman
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec doman "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/newsbin b/portage_with_autodep/bin/ebuild-helpers/newsbin
index 82242aa..9df0af2 100755
--- a/portage_with_autodep/bin/ebuild-helpers/newsbin
+++ b/portage_with_autodep/bin/ebuild-helpers/newsbin
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -14,6 +14,9 @@ if [ ! -e "$1" ] ; then
exit 1
fi
+(($#>2)) && \
+ eqawarn "QA Notice: ${0##*/} called with more than 2 arguments: ${@:3}"
+
rm -rf "${T}/${2}" && \
cp -f "${1}" "${T}/${2}" && \
exec dosbin "${T}/${2}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/prepall b/portage_with_autodep/bin/ebuild-helpers/prepall
index 701ecba..49e646c 100755
--- a/portage_with_autodep/bin/ebuild-helpers/prepall
+++ b/portage_with_autodep/bin/ebuild-helpers/prepall
@@ -4,12 +4,15 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
if has chflags $FEATURES ; then
# Save all the file flags for restoration at the end of prepall.
- mtree -c -p "${D}" -k flags > "${T}/bsdflags.mtree"
+ mtree -c -p "${ED}" -k flags > "${T}/bsdflags.mtree"
# Remove all the file flags so that prepall can do anything necessary.
- chflags -R noschg,nouchg,nosappnd,nouappnd "${D}"
- chflags -R nosunlnk,nouunlnk "${D}" 2>/dev/null
+ chflags -R noschg,nouchg,nosappnd,nouappnd "${ED}"
+ chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
fi
prepallman
@@ -19,5 +22,5 @@ prepallstrip
if has chflags $FEATURES ; then
# Restore all the file flags that were saved at the beginning of prepall.
- mtree -U -e -p "${D}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
+ mtree -U -e -p "${ED}" -k flags < "${T}/bsdflags.mtree" &> /dev/null
fi
diff --git a/portage_with_autodep/bin/ebuild-helpers/prepalldocs b/portage_with_autodep/bin/ebuild-helpers/prepalldocs
index fdc735d..560a02b 100755
--- a/portage_with_autodep/bin/ebuild-helpers/prepalldocs
+++ b/portage_with_autodep/bin/ebuild-helpers/prepalldocs
@@ -1,5 +1,5 @@
#!/bin/bash
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
@@ -8,8 +8,10 @@ if [[ -n $1 ]] ; then
vecho "${0##*/}: invalid usage; takes no arguments" 1>&2
fi
-cd "${D}"
-[[ -d usr/share/doc ]] || exit 0
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+[[ -d ${ED}usr/share/doc ]] || exit 0
ecompressdir --ignore /usr/share/doc/${PF}/html
ecompressdir --queue /usr/share/doc
diff --git a/portage_with_autodep/bin/ebuild-helpers/prepallinfo b/portage_with_autodep/bin/ebuild-helpers/prepallinfo
index 0d97803..db9bbfa 100755
--- a/portage_with_autodep/bin/ebuild-helpers/prepallinfo
+++ b/portage_with_autodep/bin/ebuild-helpers/prepallinfo
@@ -1,9 +1,12 @@
#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-[[ ! -d ${D}usr/share/info ]] && exit 0
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+[[ -d ${ED}usr/share/info ]] || exit 0
exec prepinfo
diff --git a/portage_with_autodep/bin/ebuild-helpers/prepallman b/portage_with_autodep/bin/ebuild-helpers/prepallman
index e50de6d..dee1c72 100755
--- a/portage_with_autodep/bin/ebuild-helpers/prepallman
+++ b/portage_with_autodep/bin/ebuild-helpers/prepallman
@@ -7,11 +7,14 @@ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
# replaced by controllable compression in EAPI 4
has "${EAPI}" 0 1 2 3 || exit 0
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
ret=0
-find "${D}" -type d -name man > "${T}"/prepallman.filelist
+find "${ED}" -type d -name man > "${T}"/prepallman.filelist
while read -r mandir ; do
- mandir=${mandir#${D}}
+ mandir=${mandir#${ED}}
prepman "${mandir%/man}"
((ret|=$?))
done < "${T}"/prepallman.filelist
diff --git a/portage_with_autodep/bin/ebuild-helpers/prepallstrip b/portage_with_autodep/bin/ebuild-helpers/prepallstrip
index ec12ce6..28320d9 100755
--- a/portage_with_autodep/bin/ebuild-helpers/prepallstrip
+++ b/portage_with_autodep/bin/ebuild-helpers/prepallstrip
@@ -1,5 +1,8 @@
#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-exec prepstrip "${D}"
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
+exec prepstrip "${ED}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/prepinfo b/portage_with_autodep/bin/ebuild-helpers/prepinfo
index 691fd13..ffe2ece 100755
--- a/portage_with_autodep/bin/ebuild-helpers/prepinfo
+++ b/portage_with_autodep/bin/ebuild-helpers/prepinfo
@@ -4,17 +4,20 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
if [[ -z $1 ]] ; then
infodir="/usr/share/info"
else
- if [[ -d ${D}$1/share/info ]] ; then
+ if [[ -d ${ED}$1/share/info ]] ; then
infodir="$1/share/info"
else
infodir="$1/info"
fi
fi
-if [[ ! -d ${D}${infodir} ]] ; then
+if [[ ! -d ${ED}${infodir} ]] ; then
if [[ -n $1 ]] ; then
vecho "${0##*/}: '${infodir}' does not exist!"
exit 1
@@ -23,7 +26,7 @@ if [[ ! -d ${D}${infodir} ]] ; then
fi
fi
-find "${D}${infodir}" -type d -print0 | while read -r -d $'\0' x ; do
+find "${ED}${infodir}" -type d -print0 | while read -r -d $'\0' x ; do
for f in "${x}"/.keepinfodir*; do
[[ -e ${f} ]] && continue 2
done
diff --git a/portage_with_autodep/bin/ebuild-helpers/preplib b/portage_with_autodep/bin/ebuild-helpers/preplib
index 76aabe6..6e91cf3 100755
--- a/portage_with_autodep/bin/ebuild-helpers/preplib
+++ b/portage_with_autodep/bin/ebuild-helpers/preplib
@@ -1,11 +1,14 @@
#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
eqawarn "QA Notice: Deprecated call to 'preplib'"
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
LIBDIR_VAR="LIBDIR_${ABI}"
if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
CONF_LIBDIR="${!LIBDIR_VAR}"
@@ -18,9 +21,9 @@ if [ -z "${CONF_LIBDIR}" ]; then
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
diff --git a/portage_with_autodep/bin/ebuild-helpers/prepman b/portage_with_autodep/bin/ebuild-helpers/prepman
index c9add8a..f96b641 100755
--- a/portage_with_autodep/bin/ebuild-helpers/prepman
+++ b/portage_with_autodep/bin/ebuild-helpers/prepman
@@ -4,14 +4,17 @@
source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
if [[ -z $1 ]] ; then
- mandir="${D}usr/share/man"
+ mandir="${ED}usr/share/man"
else
- mandir="${D}$1/man"
+ mandir="${ED}$1/man"
fi
if [[ ! -d ${mandir} ]] ; then
- eqawarn "QA Notice: prepman called with non-existent dir '${mandir#${D}}'"
+ eqawarn "QA Notice: prepman called with non-existent dir '${mandir#${ED}}'"
exit 0
fi
@@ -27,6 +30,6 @@ for subdir in "${mandir}"/man* "${mandir}"/*/man* ; do
[[ -d ${subdir} ]] && really_is_mandir=1 && break
done
-[[ ${really_is_mandir} == 1 ]] && exec ecompressdir --queue "${mandir#${D}}"
+[[ ${really_is_mandir} == 1 ]] && exec ecompressdir --queue "${mandir#${ED}}"
exit 0
diff --git a/portage_with_autodep/bin/ebuild-helpers/prepstrip b/portage_with_autodep/bin/ebuild-helpers/prepstrip
index d25259d..85d5d6a 100755
--- a/portage_with_autodep/bin/ebuild-helpers/prepstrip
+++ b/portage_with_autodep/bin/ebuild-helpers/prepstrip
@@ -1,85 +1,153 @@
#!/bin/bash
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/helper-functions.sh
+
+# avoid multiple calls to `has`. this creates things like:
+# FEATURES_foo=false
+# if "foo" is not in $FEATURES
+tf() { "$@" && echo true || echo false ; }
+exp_tf() {
+ local flag var=$1
+ shift
+ for flag in "$@" ; do
+ eval ${var}_${flag}=$(tf has ${flag} ${!var})
+ done
+}
+exp_tf FEATURES compressdebug installsources nostrip splitdebug
+exp_tf RESTRICT binchecks installsources strip
+
+[[ " ${FEATURES} " == *" force-prefix "* ]] || \
+ case "${EAPI}" in 0|1|2) EPREFIX= ED=${D} ;; esac
banner=false
SKIP_STRIP=false
-if has nostrip ${FEATURES} || \
- has strip ${RESTRICT}
-then
+if ${RESTRICT_strip} || ${FEATURES_nostrip} ; then
SKIP_STRIP=true
banner=true
- has installsources ${FEATURES} || exit 0
+ ${FEATURES_installsources} || exit 0
fi
-STRIP=${STRIP:-${CHOST}-strip}
-type -P -- ${STRIP} > /dev/null || STRIP=strip
-OBJCOPY=${OBJCOPY:-${CHOST}-objcopy}
-type -P -- ${OBJCOPY} > /dev/null || OBJCOPY=objcopy
+# look up the tools we might be using
+for t in STRIP:strip OBJCOPY:objcopy READELF:readelf ; do
+ v=${t%:*} # STRIP
+ t=${t#*:} # strip
+ eval ${v}=\"${!v:-${CHOST}-${t}}\"
+ type -P -- ${!v} >/dev/null || eval ${v}=${t}
+done
-# We'll leave out -R .note for now until we can check out the relevance
-# of the section when it has the ALLOC flag set on it ...
-export SAFE_STRIP_FLAGS="--strip-unneeded"
-export PORTAGE_STRIP_FLAGS=${PORTAGE_STRIP_FLAGS-${SAFE_STRIP_FLAGS} -R .comment}
-prepstrip_sources_dir=/usr/src/debug/${CATEGORY}/${PF}
+# Figure out what tool set we're using to strip stuff
+unset SAFE_STRIP_FLAGS DEF_STRIP_FLAGS SPLIT_STRIP_FLAGS
+case $(${STRIP} --version 2>/dev/null) in
+*elfutils*) # dev-libs/elfutils
+ # elfutils default behavior is always safe, so don't need to specify
+ # any flags at all
+ SAFE_STRIP_FLAGS=""
+ DEF_STRIP_FLAGS="--remove-comment"
+ SPLIT_STRIP_FLAGS="-f"
+ ;;
+*GNU*) # sys-devel/binutils
+ # We'll leave out -R .note for now until we can check out the relevance
+ # of the section when it has the ALLOC flag set on it ...
+ SAFE_STRIP_FLAGS="--strip-unneeded"
+ DEF_STRIP_FLAGS="-R .comment -R .GCC.command.line"
+ SPLIT_STRIP_FLAGS=
+ ;;
+esac
+: ${PORTAGE_STRIP_FLAGS=${SAFE_STRIP_FLAGS} ${DEF_STRIP_FLAGS}}
-if has installsources ${FEATURES} && ! type -P debugedit >/dev/null ; then
- ewarn "FEATURES=installsources is enabled but the debugedit binary could not"
- ewarn "be found. This feature will not work unless debugedit is installed!"
-fi
+prepstrip_sources_dir=${EPREFIX}/usr/src/debug/${CATEGORY}/${PF}
+
+type -P debugedit >/dev/null && debugedit_found=true || debugedit_found=false
+debugedit_warned=false
-unset ${!INODE_*}
+multijob_init
-inode_var_name() {
- if [[ $USERLAND = BSD ]] ; then
- stat -f 'INODE_%d_%i' "$1"
+# Setup $T filesystem layout that we care about.
+tmpdir="${T}/prepstrip"
+rm -rf "${tmpdir}"
+mkdir -p "${tmpdir}"/{inodes,splitdebug,sources}
+
+# Usage: inode_var_name: <file>
+inode_file_link() {
+ echo -n "${tmpdir}/inodes/"
+ if [[ ${USERLAND} == "BSD" ]] ; then
+ stat -f '%i' "$1"
else
- stat -c 'INODE_%d_%i' "$1"
+ stat -c '%i' "$1"
fi
}
+# Usage: save_elf_sources <elf>
save_elf_sources() {
- has installsources ${FEATURES} || return 0
- has installsources ${RESTRICT} && return 0
- type -P debugedit >/dev/null || return 0
+ ${FEATURES_installsources} || return 0
+ ${RESTRICT_installsources} && return 0
+ if ! ${debugedit_found} ; then
+ if ! ${debugedit_warned} ; then
+ debugedit_warned=true
+ ewarn "FEATURES=installsources is enabled but the debugedit binary could not"
+ ewarn "be found. This feature will not work unless debugedit is installed!"
+ fi
+ return 0
+ fi
local x=$1
- local inode=$(inode_var_name "$x")
- [[ -n ${!inode} ]] && return 0
- debugedit -b "${WORKDIR}" -d "${prepstrip_sources_dir}" \
- -l "${T}"/debug.sources "${x}"
+ [[ -f $(inode_file_link "${x}") ]] && return 0
+
+ # since we're editing the ELF here, we should recompute the build-id
+ # (the -i flag below). save that output so we don't need to recompute
+ # it later on in the save_elf_debug step.
+ buildid=$(debugedit -i \
+ -b "${WORKDIR}" \
+ -d "${prepstrip_sources_dir}" \
+ -l "${tmpdir}/sources/${x##*/}.${BASHPID}" \
+ "${x}")
}
+# Usage: save_elf_debug <elf> [splitdebug file]
save_elf_debug() {
- has splitdebug ${FEATURES} || return 0
+ ${FEATURES_splitdebug} || return 0
+ # NOTE: Debug files must be installed in
+ # ${EPREFIX}/usr/lib/debug/${EPREFIX} (note that ${EPREFIX} occurs
+ # twice in this path) in order for gdb's debug-file-directory
+ # lookup to work correctly.
local x=$1
- local y="${D}usr/lib/debug/${x:${#D}}.debug"
+ local splitdebug=$2
+ local y=${ED}usr/lib/debug/${x:${#D}}.debug
# dont save debug info twice
[[ ${x} == *".debug" ]] && return 0
- # this will recompute the build-id, but for now that's ok
- local buildid="$( type -P debugedit >/dev/null && debugedit -i "${x}" )"
-
- mkdir -p $(dirname "${y}")
+ mkdir -p "${y%/*}"
- local inode=$(inode_var_name "$x")
- if [[ -n ${!inode} ]] ; then
- ln "${D}usr/lib/debug/${!inode:${#D}}.debug" "$y"
+ local inode=$(inode_file_link "${x}")
+ if [[ -f ${inode} ]] ; then
+ ln "${inode}" "${y}"
else
- eval $inode=\$x
- ${OBJCOPY} --only-keep-debug "${x}" "${y}"
- ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}"
- [[ -g ${x} ]] && chmod go-r "${y}"
- [[ -u ${x} ]] && chmod go-r "${y}"
- chmod a-x,o-w "${y}"
+ if [[ -n ${splitdebug} ]] ; then
+ mv "${splitdebug}" "${y}"
+ else
+ local objcopy_flags="--only-keep-debug"
+ ${FEATURES_compressdebug} && objcopy_flags+=" --compress-debug-sections"
+ ${OBJCOPY} ${objcopy_flags} "${x}" "${y}"
+ ${OBJCOPY} --add-gnu-debuglink="${y}" "${x}"
+ fi
+ local args="a-x,o-w"
+ [[ -g ${x} || -u ${x} ]] && args+=",go-r"
+ chmod ${args} "${y}"
+ ln "${y}" "${inode}"
fi
+ # if we don't already have build-id from debugedit, look it up
+ if [[ -z ${buildid} ]] ; then
+ # convert the readelf output to something useful
+ buildid=$(${READELF} -x .note.gnu.build-id "${x}" 2>/dev/null \
+ | awk '$NF ~ /GNU/ { getline; printf $2$3$4$5; getline; print $2 }')
+ fi
if [[ -n ${buildid} ]] ; then
- local buildid_dir="${D}usr/lib/debug/.build-id/${buildid:0:2}"
+ local buildid_dir="${ED}usr/lib/debug/.build-id/${buildid:0:2}"
local buildid_file="${buildid_dir}/${buildid:2}"
mkdir -p "${buildid_dir}"
ln -s "../../${x:${#D}}.debug" "${buildid_file}.debug"
@@ -87,33 +155,78 @@ save_elf_debug() {
fi
}
+# Usage: process_elf <elf>
+process_elf() {
+ local x=$1 strip_flags=${*:2}
+
+ vecho " ${x:${#ED}}"
+ save_elf_sources "${x}"
+
+ if ${strip_this} ; then
+
+ # If two processes try to strip the same hardlink at the same
+ # time, it will cause one of them to lose the splitdebug info.
+ # So, use a lockfile to prevent interference (easily observed
+ # with dev-vcs/git which creates ~109 hardlinks to one file in
+ # /usr/libexec/git-core).
+ local lockfile=$(inode_file_link "${x}")_lockfile
+ if ! ln "${x}" "${lockfile}" ; then
+ while [[ -f ${lockfile} ]] ; do
+ sleep 1
+ done
+ unset lockfile
+ fi
+
+ # see if we can split & strip at the same time
+ if [[ -n ${SPLIT_STRIP_FLAGS} ]] ; then
+ local shortname="${x##*/}.debug"
+ local splitdebug="${tmpdir}/splitdebug/${shortname}.${BASHPID}"
+ ${STRIP} ${strip_flags} \
+ -f "${splitdebug}" \
+ -F "${shortname}" \
+ "${x}"
+ save_elf_debug "${x}" "${splitdebug}"
+ else
+ save_elf_debug "${x}"
+ ${STRIP} ${strip_flags} "${x}"
+ fi
+ [[ -n ${lockfile} ]] && rm -f "${lockfile}"
+ fi
+}
+
# The existance of the section .symtab tells us that a binary is stripped.
# We want to log already stripped binaries, as this may be a QA violation.
# They prevent us from getting the splitdebug data.
-if ! has binchecks ${RESTRICT} && \
- ! has strip ${RESTRICT} ; then
- log=$T/scanelf-already-stripped.log
+if ! ${RESTRICT_binchecks} && ! ${RESTRICT_strip} ; then
+ # We need to do the non-stripped scan serially first before we turn around
+ # and start stripping the files ourselves. The log parsing can be done in
+ # parallel though.
+ log=${tmpdir}/scanelf-already-stripped.log
+ scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED}##" > "${log}"
+ (
+ multijob_child_init
qa_var="QA_PRESTRIPPED_${ARCH/-/_}"
[[ -n ${!qa_var} ]] && QA_PRESTRIPPED="${!qa_var}"
- scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^$D##" > "$log"
- if [[ -n $QA_PRESTRIPPED && -s $log && \
+ if [[ -n ${QA_PRESTRIPPED} && -s ${log} && \
${QA_STRICT_PRESTRIPPED-unset} = unset ]] ; then
shopts=$-
set -o noglob
- for x in $QA_PRESTRIPPED ; do
- sed -e "s#^${x#/}\$##" -i "$log"
+ for x in ${QA_PRESTRIPPED} ; do
+ sed -e "s#^${x#/}\$##" -i "${log}"
done
set +o noglob
- set -$shopts
+ set -${shopts}
fi
- sed -e "/^\$/d" -e "s#^#/#" -i "$log"
- if [[ -s $log ]] ; then
+ sed -e "/^\$/d" -e "s#^#/#" -i "${log}"
+ if [[ -s ${log} ]] ; then
vecho -e "\n"
eqawarn "QA Notice: Pre-stripped files found:"
- eqawarn "$(<"$log")"
+ eqawarn "$(<"${log}")"
else
- rm -f "$log"
+ rm -f "${log}"
fi
+ ) &
+ multijob_post_fork
fi
# Now we look for unstripped binaries.
@@ -126,8 +239,10 @@ do
banner=true
fi
- f=$(file "${x}") || continue
- [[ -z ${f} ]] && continue
+ (
+ multijob_child_init
+ f=$(file "${x}") || exit 0
+ [[ -z ${f} ]] && exit 0
if ! ${SKIP_STRIP} ; then
# The noglob funk is to support STRIP_MASK="/*/booga" and to keep
@@ -136,50 +251,61 @@ do
set -o noglob
strip_this=true
for m in $(eval echo ${STRIP_MASK}) ; do
- [[ /${x#${D}} == ${m} ]] && strip_this=false && break
+ [[ /${x#${ED}} == ${m} ]] && strip_this=false && break
done
set +o noglob
else
strip_this=false
fi
+ # In Prefix we are usually an unprivileged user, so we can't strip
+ # unwritable objects. Make them temporarily writable for the
+ # stripping.
+ was_not_writable=false
+ if [[ ! -w ${x} ]] ; then
+ was_not_writable=true
+ chmod u+w "${x}"
+ fi
+
# only split debug info for final linked objects
# or kernel modules as debuginfo for intermediatary
# files (think crt*.o from gcc/glibc) is useless and
# actually causes problems. install sources for all
# elf types though cause that stuff is good.
+ buildid=
if [[ ${f} == *"current ar archive"* ]] ; then
- vecho " ${x:${#D}}"
+ vecho " ${x:${#ED}}"
if ${strip_this} ; then
# hmm, can we split debug/sources for .a ?
${STRIP} -g "${x}"
fi
elif [[ ${f} == *"SB executable"* || ${f} == *"SB shared object"* ]] ; then
- vecho " ${x:${#D}}"
- save_elf_sources "${x}"
- if ${strip_this} ; then
- save_elf_debug "${x}"
- ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
- fi
+ process_elf "${x}" ${PORTAGE_STRIP_FLAGS}
elif [[ ${f} == *"SB relocatable"* ]] ; then
- vecho " ${x:${#D}}"
- save_elf_sources "${x}"
- if ${strip_this} ; then
- [[ ${x} == *.ko ]] && save_elf_debug "${x}"
- ${STRIP} ${SAFE_STRIP_FLAGS} "${x}"
- fi
+ process_elf "${x}" ${SAFE_STRIP_FLAGS}
fi
+
+ if ${was_not_writable} ; then
+ chmod u-w "${x}"
+ fi
+ ) &
+ multijob_post_fork
done
-if [[ -s ${T}/debug.sources ]] && \
- has installsources ${FEATURES} && \
- ! has installsources ${RESTRICT} && \
- type -P debugedit >/dev/null
+# With a bit more work, we could run the rsync processes below in
+# parallel, but not sure that'd be an overall improvement.
+multijob_finish
+
+cd "${tmpdir}"/sources/ && cat * > "${tmpdir}/debug.sources" 2>/dev/null
+if [[ -s ${tmpdir}/debug.sources ]] && \
+ ${FEATURES_installsources} && \
+ ! ${RESTRICT_installsources} && \
+ ${debugedit_found}
then
vecho "installsources: rsyncing source files"
[[ -d ${D}${prepstrip_sources_dir} ]] || mkdir -p "${D}${prepstrip_sources_dir}"
- grep -zv '/<[^/>]*>$' "${T}"/debug.sources | \
+ grep -zv '/<[^/>]*>$' "${tmpdir}"/debug.sources | \
(cd "${WORKDIR}"; LANG=C sort -z -u | \
rsync -tL0 --files-from=- "${WORKDIR}/" "${D}${prepstrip_sources_dir}/" )
@@ -188,6 +314,8 @@ then
# https://bugzilla.redhat.com/show_bug.cgi?id=444310
while read -r -d $'\0' emptydir
do
- >> "$emptydir"/.keepdir
+ >> "${emptydir}"/.keepdir
done < <(find "${D}${prepstrip_sources_dir}/" -type d -empty -print0)
fi
+
+rm -rf "${tmpdir}"
diff --git a/portage_with_autodep/bin/ebuild-helpers/unprivileged/chgrp b/portage_with_autodep/bin/ebuild-helpers/unprivileged/chgrp
new file mode 120000
index 0000000..6fb0fcd
--- /dev/null
+++ b/portage_with_autodep/bin/ebuild-helpers/unprivileged/chgrp
@@ -0,0 +1 @@
+chown \ No newline at end of file
diff --git a/portage_with_autodep/bin/ebuild-helpers/unprivileged/chown b/portage_with_autodep/bin/ebuild-helpers/unprivileged/chown
new file mode 100755
index 0000000..08fa650
--- /dev/null
+++ b/portage_with_autodep/bin/ebuild-helpers/unprivileged/chown
@@ -0,0 +1,41 @@
+#!/bin/bash
+# Copyright 2012-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+scriptpath=${BASH_SOURCE[0]}
+scriptname=${scriptpath##*/}
+
+IFS=':'
+
+for path in ${PATH}; do
+ [[ -x ${path}/${scriptname} ]] || continue
+ [[ ${path}/${scriptname} -ef ${scriptpath} ]] && continue
+ IFS=$' \t\n'
+ output=$("${path}/${scriptname}" "$@" 2>&1)
+ if [[ $? -ne 0 ]] ; then
+
+ # Avoid an extreme performance problem when the
+ # output is very long (bug #470992).
+ if [[ $(wc -l <<< "${output}") -gt 100 ]]; then
+ output=$(head -n100 <<< "${output}")
+ output="${output}\n ... (further messages truncated)"
+ fi
+
+ source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
+
+ if ! ___eapi_has_prefix_variables; then
+ EPREFIX=
+ fi
+ msg="${scriptname} failure ignored with unprivileged user:\n ${scriptname} $*\n ${output}"
+ # Reverse expansion of ${D} and ${EPREFIX}, for readability.
+ msg=${msg//${D}/'${D}'}
+ if [[ -n ${EPREFIX} ]] ; then
+ msg=${msg//${EPREFIX}/'${EPREFIX}'}
+ msg=${msg//${EPREFIX#/}/'${EPREFIX}'}
+ fi
+ ewarn "${msg}"
+ fi
+ exit 0
+done
+
+exit 1
diff --git a/portage_with_autodep/bin/ebuild-helpers/xattr/install b/portage_with_autodep/bin/ebuild-helpers/xattr/install
new file mode 100755
index 0000000..f51f621
--- /dev/null
+++ b/portage_with_autodep/bin/ebuild-helpers/xattr/install
@@ -0,0 +1,12 @@
+#!/bin/bash
+# Copyright 2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PORTAGE_BIN_PATH=${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}
+PORTAGE_PYM_PATH=${PORTAGE_PYM_PATH:-/usr/lib/portage/pym}
+# Use safe cwd, avoiding unsafe import for bug #469338.
+export __PORTAGE_HELPER_CWD=${PWD}
+cd "${PORTAGE_PYM_PATH}"
+export __PORTAGE_HELPER_PATH=${BASH_SOURCE[0]}
+PYTHONPATH=${PORTAGE_PYTHONPATH:-${PORTAGE_PYM_PATH}} \
+ exec "${PORTAGE_PYTHON:-/usr/bin/python}" "${PORTAGE_BIN_PATH}/install.py" "$@"