summaryrefslogtreecommitdiffstats
path: root/bin/ebuild-helpers/prepstrip
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-11-01 19:17:19 -0700
committerZac Medico <zmedico@gentoo.org>2011-11-01 19:17:19 -0700
commit1af0c40b1300651ca03a7509f49f152c1e595736 (patch)
tree6d967ae665bf98c9ba8219fb812a9678a127a57e /bin/ebuild-helpers/prepstrip
parent889853171246ab1063bb5015caf41a41761f5424 (diff)
downloadportage-1af0c40b1300651ca03a7509f49f152c1e595736.tar.gz
portage-1af0c40b1300651ca03a7509f49f152c1e595736.tar.bz2
portage-1af0c40b1300651ca03a7509f49f152c1e595736.zip
Add EPREFIX and ED support in all ebuild helpers.
This allows our prefix tests to use helpers like insinto, doins, and dosym.
Diffstat (limited to 'bin/ebuild-helpers/prepstrip')
-rwxr-xr-xbin/ebuild-helpers/prepstrip26
1 files changed, 14 insertions, 12 deletions
diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
index 8c2ca4839..fac20b24f 100755
--- a/bin/ebuild-helpers/prepstrip
+++ b/bin/ebuild-helpers/prepstrip
@@ -18,6 +18,8 @@ exp_tf() {
exp_tf FEATURES installsources nostrip splitdebug
exp_tf RESTRICT binchecks installsources strip
+case "$EAPI" in 0|1|2) ED=${D} ;; esac
+
banner=false
SKIP_STRIP=false
if ${RESTRICT_strip} || ${FEATURES_nostrip} ; then
@@ -99,7 +101,7 @@ save_elf_debug() {
${FEATURES_splitdebug} || return 0
local x=$1
- local y="${D}usr/lib/debug/${x:${#D}}.debug"
+ local y="${ED}usr/lib/debug/${x:${#ED}}.debug"
# dont save debug info twice
[[ ${x} == *".debug" ]] && return 0
@@ -108,7 +110,7 @@ save_elf_debug() {
local inode=$(inode_var_name "$x")
if [[ -n ${!inode} ]] ; then
- ln "${D}usr/lib/debug/${!inode:${#D}}.debug" "$y"
+ ln "${ED}usr/lib/debug/${!inode:${#ED}}.debug" "$y"
else
eval $inode=\$x
if [[ -e ${T}/prepstrip.split.debug ]] ; then
@@ -129,18 +131,18 @@ save_elf_debug() {
| 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"
- ln -s "/${x:${#D}}" "${buildid_file}"
+ ln -s "../../${x:${#ED}}.debug" "${buildid_file}.debug"
+ ln -s "/${x:${#ED}}" "${buildid_file}"
fi
}
process_elf() {
local x=$1 strip_flags=${*:2}
- vecho " ${x:${#D}}"
+ vecho " ${x:${#ED}}"
save_elf_sources "${x}"
if ${strip_this} ; then
@@ -165,7 +167,7 @@ if ! ${RESTRICT_binchecks} && ! ${RESTRICT_strip} ; then
log=$T/scanelf-already-stripped.log
qa_var="QA_PRESTRIPPED_${ARCH/-/_}"
[[ -n ${!qa_var} ]] && QA_PRESTRIPPED="${!qa_var}"
- scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^$D##" > "$log"
+ scanelf -yqRBF '#k%F' -k '!.symtab' "$@" | sed -e "s#^${ED}##" > "$log"
if [[ -n $QA_PRESTRIPPED && -s $log && \
${QA_STRICT_PRESTRIPPED-unset} = unset ]] ; then
shopts=$-
@@ -206,7 +208,7 @@ 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
@@ -221,7 +223,7 @@ do
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}"
@@ -239,10 +241,10 @@ if [[ -s ${T}/debug.sources ]] && \
${debugedit_found}
then
vecho "installsources: rsyncing source files"
- [[ -d ${D}${prepstrip_sources_dir} ]] || mkdir -p "${D}${prepstrip_sources_dir}"
+ [[ -d ${ED}${prepstrip_sources_dir} ]] || mkdir -p "${ED}${prepstrip_sources_dir}"
grep -zv '/<[^/>]*>$' "${T}"/debug.sources | \
(cd "${WORKDIR}"; LANG=C sort -z -u | \
- rsync -tL0 --files-from=- "${WORKDIR}/" "${D}${prepstrip_sources_dir}/" )
+ rsync -tL0 --files-from=- "${WORKDIR}/" "${ED}${prepstrip_sources_dir}/" )
# Preserve directory structure.
# Needed after running save_elf_sources.
@@ -250,5 +252,5 @@ then
while read -r -d $'\0' emptydir
do
>> "$emptydir"/.keepdir
- done < <(find "${D}${prepstrip_sources_dir}/" -type d -empty -print0)
+ done < <(find "${ED}${prepstrip_sources_dir}/" -type d -empty -print0)
fi