commit:     4af780be38037391751bccc6e15fc2561b8970e0
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  1 01:40:44 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Aug  6 21:00:28 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4af780be

estrip: use while/read for prepstrip (< EAPI 7)

Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index f45211bdb..0ed35111d 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -419,9 +419,10 @@ while read -r x ; do
 done < <(
        # 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=""
+               while IFS= read -r needed_entry ; do
+                       needed_entry="${needed_entry% *}"
+                       needed_contents+=( "${D%/}${needed_entry}" )
+               done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED
        fi
 
        # Use sort -u to eliminate duplicates (bug #445336).
@@ -429,8 +430,6 @@ done < <(
                [[ -n ${needed_contents[@]} ]] && printf "%s\n" 
"${needed_contents[@]}"
                find "$@" -type f ! -type l -name '*.a'
        ) | LC_ALL=C sort -u
-
-       unset needed_contents
 )
 else
 while IFS= read -d '' -r x ; do

Reply via email to