Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepstrip: use debugedit from rpm if necessary (bug 634378) #221

Merged
merged 1 commit into from
Oct 16, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 16 additions & 4 deletions bin/ebuild-helpers/prepstrip
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,19 @@ esac

prepstrip_sources_dir=${EPREFIX}/usr/src/debug/${CATEGORY}/${PF}

type -P debugedit >/dev/null && debugedit_found=true || debugedit_found=false
debugedit=$(type -P debugedit)
if [[ -z ${debugedit} ]]; then
debugedit_paths=(
"${EPREFIX}/usr/libexec/rpm/debugedit"
)
for x in "${debugedit_paths[@]}"; do
if [[ -x ${x} ]]; then
debugedit=${x}
break
fi
done
fi
[[ ${debugedit} ]] && debugedit_found=true || debugedit_found=false
debugedit_warned=false

__multijob_init
Expand All @@ -101,8 +113,8 @@ save_elf_sources() {
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!"
ewarn "FEATURES=installsources is enabled but the debugedit binary could not be"
ewarn "found. This feature will not work unless debugedit or rpm is installed!"
fi
return 0
fi
Expand All @@ -112,7 +124,7 @@ save_elf_sources() {
# 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 \
buildid=$("${debugedit}" -i \
-b "${WORKDIR}" \
-d "${prepstrip_sources_dir}" \
-l "${tmpdir}/sources/${x##*/}.${BASHPID:-$(__bashpid)}" \
Expand Down