1 |
commit: 7f6e83707daf4a7d8231b968078a1ba94d80c697 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 1 00:05:47 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 6 21:00:28 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=7f6e8370 |
7 |
|
8 |
estrip: avoid spurious NEEDED warning when no ELF installed (< EAPI 7) |
9 |
|
10 |
If no ELF files are installed, then we're obviously |
11 |
not going to have a NEEDED file. |
12 |
|
13 |
The reason this didn't get hit sooner is because |
14 |
apparently very few of us are actually testing |
15 |
EAPI 6 actively - which figures. |
16 |
|
17 |
We only take this path for < EAPI 7 (non-dostrip) |
18 |
which means we're actually missing the estrip |
19 |
optimisation in bug #749624 for newer EAPIs! |
20 |
|
21 |
(Will be fixed in a followup). |
22 |
|
23 |
Bug: https://bugs.gentoo.org/749624 |
24 |
Bug: https://bugs.gentoo.org/862606 |
25 |
Fixes: bb88e766897f5e7e0b0a10c48cf99a04edb73a40 |
26 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
27 |
|
28 |
bin/estrip | 14 +++++++++++--- |
29 |
1 file changed, 11 insertions(+), 3 deletions(-) |
30 |
|
31 |
diff --git a/bin/estrip b/bin/estrip |
32 |
index 6935470d3..f45211bdb 100755 |
33 |
--- a/bin/estrip |
34 |
+++ b/bin/estrip |
35 |
@@ -417,12 +417,20 @@ while read -r x ; do |
36 |
inode_link=$(get_inode_number "${x}") || die "stat failed unexpectedly" |
37 |
echo "${x}" >> "${inode_link}" || die "echo failed unexpectedly" |
38 |
done < <( |
39 |
- # Use sort -u to eliminate duplicates for bug #445336. |
40 |
+ # NEEDED may not exist for some packages (bug #862606) |
41 |
+ if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; then |
42 |
+ needed_contents=$(cat "${PORTAGE_BUILDDIR}"/build-info/NEEDED | cut -d ' ' -f1 | sed -e "s:^:${D%/}:") |
43 |
+ else |
44 |
+ needed_contents="" |
45 |
+ fi |
46 |
+ |
47 |
+ # Use sort -u to eliminate duplicates (bug #445336). |
48 |
( |
49 |
+ [[ -n ${needed_contents[@]} ]] && printf "%s\n" "${needed_contents[@]}" |
50 |
find "$@" -type f ! -type l -name '*.a' |
51 |
- cut -d ' ' -f1 < "${PORTAGE_BUILDDIR}"/build-info/NEEDED \ |
52 |
- | sed -e "s:^:${D%/}:" |
53 |
) | LC_ALL=C sort -u |
54 |
+ |
55 |
+ unset needed_contents |
56 |
) |
57 |
else |
58 |
while IFS= read -d '' -r x ; do |