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