commit:     36dbd3e4336fa199a35b4f74c1679511707138f5
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Aug 17 02:34:08 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Aug 17 03:26:11 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=36dbd3e4

estrip: consistently use an array for scanelf results

Otherwise the new arithmetic-context test isn't going to work
if we're in the simpler scanelf-directly case (non-cache).

I should've spotted that we don't have an array in both
branches.

And while at it, adapt the find_paths test.

Fixes: f35bf4828ac56b4ab4f7fb4ccc846ebdee33767d
Thanks-to: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

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

diff --git a/bin/estrip b/bin/estrip
index d7be51743..6738fb4d3 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -63,7 +63,7 @@ while [[ $# -gt 0 ]] ; do
                        fi
                done
 
-               if [[ ${find_paths[@]} ]]; then
+               if (( ${#find_paths[@]} )); then
                        # We can avoid scanelf calls for binaries we already
                        # checked in install_qa_check (where we generate
                        # NEEDED for everything installed).
@@ -98,7 +98,7 @@ while [[ $# -gt 0 ]] ; do
                                        done
                                done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED
                        else
-                               scanelf_results=$(scanelf -yqRBF '#k%F' -k 
'.symtab' "${find_paths[@]}")
+                               mapfile -t scanelf_results < <(scanelf -yqRBF 
'#k%F' -k '.symtab' "${find_paths[@]}")
                        fi
 
                        while IFS= read -r path; do

Reply via email to