summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-10-23 18:11:40 +0000
committerZac Medico <zmedico@gentoo.org>2009-10-23 18:11:40 +0000
commit7c59dadd0ef98449d7d30f42ed8ffd0cd5df9438 (patch)
tree67c1162f552f7a9833ef75834b06777af5e0fc20 /bin
parentFactor vdb loading code out of the depgraph constructor, since this procedure (diff)
downloadportage-idfetch-7c59dadd0ef98449d7d30f42ed8ffd0cd5df9438.tar.gz
portage-idfetch-7c59dadd0ef98449d7d30f42ed8ffd0cd5df9438.tar.bz2
portage-idfetch-7c59dadd0ef98449d7d30f42ed8ffd0cd5df9438.zip
Bug #289967 - Update installsources rsync code for >=debugedit-4.4.6-r2.
Thanks to Peter Alfredsen <loki_val@g.o> for this patch. svn path=/main/trunk/; revision=14706
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ebuild-helpers/prepstrip32
1 files changed, 23 insertions, 9 deletions
diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
index 98308ae9..0f97ca05 100755
--- a/bin/ebuild-helpers/prepstrip
+++ b/bin/ebuild-helpers/prepstrip
@@ -24,6 +24,7 @@ type -P -- ${OBJCOPY} > /dev/null || OBJCOPY=objcopy
# 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}
if hasq installsources ${FEATURES} && ! type -P debugedit >/dev/null ; then
ewarn "FEATURES=installsources is enabled but the debugedit binary could not"
@@ -48,17 +49,10 @@ save_elf_sources() {
local x=$1
local inode=$(inode_var_name "$x")
[[ -n ${!inode} ]] && return 0
- local sources_dir=/usr/src/debug/${CATEGORY}/${PF}
- debugedit -b "${WORKDIR}" -d "${sources_dir}" \
+ debugedit -b "${WORKDIR}" -d "${prepstrip_sources_dir}" \
-l "${T}"/debug.sources "${x}"
- if [[ -s ${T}/debug.sources ]] ; then
- [[ -d ${D}${sources_dir} ]] || mkdir -p "${D}${sources_dir}"
- grep -zv '/<built-in>$' "${T}"/debug.sources | \
- (cd "${WORKDIR}"; LANG=C sort -z -u | \
- rsync -rtL0 --files-from=- "${WORKDIR}/" "${D}${sources_dir}/" )
- fi
}
-
+
save_elf_debug() {
hasq splitdebug ${FEATURES} || return 0
@@ -178,3 +172,23 @@ do
fi
fi
done
+
+if [[ -s ${T}/debug.sources ]] && \
+ hasq installsources ${FEATURES} && \
+ ! hasq installsources ${RESTRICT} && \
+ type -P debugedit >/dev/null
+then
+ vecho "installsources: rsyncing source files"
+ [[ -d ${D}${prepstrip_sources_dir} ]] || mkdir -p "${D}${prepstrip_sources_dir}"
+ grep -zv '/<[^/>]*>$' "${T}"/debug.sources | \
+ (cd "${WORKDIR}"; LANG=C sort -z -u | \
+ rsync -tL0 --files-from=- "${WORKDIR}/" "${D}${prepstrip_sources_dir}/" )
+
+ # Preserve directory structure.
+ # Needed after running save_elf_sources.
+ # https://bugzilla.redhat.com/show_bug.cgi?id=444310
+ while read -r emptydir
+ do
+ touch "$emptydir"/.keepdir
+ done < <(find "${D}${prepstrip_sources_dir}/" -type d -empty)
+fi