Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/ebuild-helpers/
Date: Mon, 16 Oct 2017 17:16:22
Message-Id: 1508174120.234ad726ddc5d62eb0d956023de338dc488e2ea1.zmedico@gentoo
1 commit: 234ad726ddc5d62eb0d956023de338dc488e2ea1
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Mon Oct 16 08:08:19 2017 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Mon Oct 16 17:15:20 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=234ad726
7
8 prepstrip: use debugedit from rpm if necessary (bug 634378)
9
10 If debugedit is not found in PATH, then use debugedit
11 installed by app-arch/rpm (if available).
12
13 Suggested-by: Francesco Riosa <vivo75 <AT> gmail.com>
14 Bug: https://bugs.gentoo.org/634378
15 Acked-by: Brian Dolbec <dolsen <AT> gentoo.org>
16
17 bin/ebuild-helpers/prepstrip | 20 ++++++++++++++++----
18 1 file changed, 16 insertions(+), 4 deletions(-)
19
20 diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
21 index 43caa29c7..ea5c0dc09 100755
22 --- a/bin/ebuild-helpers/prepstrip
23 +++ b/bin/ebuild-helpers/prepstrip
24 @@ -84,7 +84,19 @@ esac
25
26 prepstrip_sources_dir=${EPREFIX}/usr/src/debug/${CATEGORY}/${PF}
27
28 -type -P debugedit >/dev/null && debugedit_found=true || debugedit_found=false
29 +debugedit=$(type -P debugedit)
30 +if [[ -z ${debugedit} ]]; then
31 + debugedit_paths=(
32 + "${EPREFIX}/usr/libexec/rpm/debugedit"
33 + )
34 + for x in "${debugedit_paths[@]}"; do
35 + if [[ -x ${x} ]]; then
36 + debugedit=${x}
37 + break
38 + fi
39 + done
40 +fi
41 +[[ ${debugedit} ]] && debugedit_found=true || debugedit_found=false
42 debugedit_warned=false
43
44 __multijob_init
45 @@ -101,8 +113,8 @@ save_elf_sources() {
46 if ! ${debugedit_found} ; then
47 if ! ${debugedit_warned} ; then
48 debugedit_warned=true
49 - ewarn "FEATURES=installsources is enabled but the debugedit binary could not"
50 - ewarn "be found. This feature will not work unless debugedit is installed!"
51 + ewarn "FEATURES=installsources is enabled but the debugedit binary could not be"
52 + ewarn "found. This feature will not work unless debugedit or rpm is installed!"
53 fi
54 return 0
55 fi
56 @@ -112,7 +124,7 @@ save_elf_sources() {
57 # since we're editing the ELF here, we should recompute the build-id
58 # (the -i flag below). save that output so we don't need to recompute
59 # it later on in the save_elf_debug step.
60 - buildid=$(debugedit -i \
61 + buildid=$("${debugedit}" -i \
62 -b "${WORKDIR}" \
63 -d "${prepstrip_sources_dir}" \
64 -l "${tmpdir}/sources/${x##*/}.${BASHPID:-$(__bashpid)}" \