diff options
author | Sam James <sam@gentoo.org> | 2022-08-01 01:05:47 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-08-06 22:00:28 +0100 |
commit | 7f6e83707daf4a7d8231b968078a1ba94d80c697 (patch) | |
tree | 182e5475eccfe441dc82c934d6aa1a1353f0b271 | |
parent | dispatch-conf: respect (E)ROOT (diff) | |
download | portage-7f6e83707daf4a7d8231b968078a1ba94d80c697.tar.gz portage-7f6e83707daf4a7d8231b968078a1ba94d80c697.tar.bz2 portage-7f6e83707daf4a7d8231b968078a1ba94d80c697.zip |
estrip: avoid spurious NEEDED warning when no ELF installed (< EAPI 7)
If no ELF files are installed, then we're obviously
not going to have a NEEDED file.
The reason this didn't get hit sooner is because
apparently very few of us are actually testing
EAPI 6 actively - which figures.
We only take this path for < EAPI 7 (non-dostrip)
which means we're actually missing the estrip
optimisation in bug #749624 for newer EAPIs!
(Will be fixed in a followup).
Bug: https://bugs.gentoo.org/749624
Bug: https://bugs.gentoo.org/862606
Fixes: bb88e766897f5e7e0b0a10c48cf99a04edb73a40
Signed-off-by: Sam James <sam@gentoo.org>
-rwxr-xr-x | bin/estrip | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/bin/estrip b/bin/estrip index 6935470d3..f45211bdb 100755 --- a/bin/estrip +++ b/bin/estrip @@ -417,12 +417,20 @@ while read -r x ; do inode_link=$(get_inode_number "${x}") || die "stat failed unexpectedly" echo "${x}" >> "${inode_link}" || die "echo failed unexpectedly" done < <( - # Use sort -u to eliminate duplicates for bug #445336. + # NEEDED may not exist for some packages (bug #862606) + if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; then + needed_contents=$(cat "${PORTAGE_BUILDDIR}"/build-info/NEEDED | cut -d ' ' -f1 | sed -e "s:^:${D%/}:") + else + needed_contents="" + fi + + # Use sort -u to eliminate duplicates (bug #445336). ( + [[ -n ${needed_contents[@]} ]] && printf "%s\n" "${needed_contents[@]}" find "$@" -type f ! -type l -name '*.a' - cut -d ' ' -f1 < "${PORTAGE_BUILDDIR}"/build-info/NEEDED \ - | sed -e "s:^:${D%/}:" ) | LC_ALL=C sort -u + + unset needed_contents ) else while IFS= read -d '' -r x ; do |