commit:     8454ba2415fd1bd4acd4e34b66d97b18d4a3e9f3
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Jun  9 19:57:26 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 11 03:26:18 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=8454ba24

estrip: fix the indentation for do_ignore() and do_queue()

The preceding commit introduced two new functions, whose contents were
deliberately over-indented so as to reduce the complexity of the patch.
As such, this commit serves only to correct the indentation.

See-also: dc83120e615f35e4cb44cd78930e4eb046288e02
Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/estrip | 124 ++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 62 insertions(+), 62 deletions(-)

diff --git a/bin/estrip b/bin/estrip
index a149731b57..6a0fab2bda 100755
--- a/bin/estrip
+++ b/bin/estrip
@@ -325,76 +325,76 @@ restore_xattrs() {
 }
 
 do_ignore() {
-               local -a skip_dirs
-               local skip
-
-               for skip; do
-                       if [[ -d ${ED%/}/${skip#/} ]]; then
-                               skip_dirs+=( "${ED%/}/${skip#/}" )
-                       else
-                               rm -f "${ED%/}/${skip#/}.estrip" || die
-                       fi
-               done
+       local -a skip_dirs
+       local skip
 
-               if (( ${#skip_dirs[@]} )); then
-                       find "${skip_dirs[@]}" -name '*.estrip' -delete || die
+       for skip; do
+               if [[ -d ${ED%/}/${skip#/} ]]; then
+                       skip_dirs+=( "${ED%/}/${skip#/}" )
+               else
+                       rm -f "${ED%/}/${skip#/}.estrip" || die
                fi
+       done
+
+       if (( ${#skip_dirs[@]} )); then
+               find "${skip_dirs[@]}" -name '*.estrip' -delete || die
+       fi
 }
 
 do_queue() {
-               local needed_entry_file needed_entry find_path path
-               local -a find_paths scanelf_results
-
-               for path; do
-                       if [[ -e ${ED%/}/${path#/} ]]; then
-                               find_paths+=( "${ED%/}/${path#/}" )
-                       fi
-               done
+       local needed_entry_file needed_entry find_path path
+       local -a find_paths scanelf_results
 
-               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).
-                       #
-                       # EAPI 7+ has controlled stripping (dostrip) though
-                       # which is why estrip has the queue/dequeue logic,
-                       # so we need to take the intersection of:
-                       # 1. files scanned earlier (all ELF installed)
-                       #    (note that this should be a superset of 2., so we 
don't
-                       #    need to worry about unknown files appearing)
-                       #
-                       # 2. the files we're interested in right now
-                       if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; 
then
-                               # The arguments may not be exact files 
(probably aren't), but search paths/directories
-                               # which should then be searched recursively.
-                               while IFS= read -r needed_entry ; do
-                                       for find_path in "${find_paths[@]}" ; do
-                                               # NEEDED has a bunch of entries 
like:
-                                               # /usr/lib64/libfoo.so libc.so
-                                               #
-                                               # find_path entries may be 
exact paths (like /usr/lib64/libfoo.so)
-                                               # or instead /usr/lib64, or 
${ED}/usr, etc.
-                                               #
-                                               # We check if the beginning 
(i.e. first entry) of the NEEDED line
-                                               # matches the path given
-                                               # e.g. find_path="/usr/lib64" 
will match needed_entry="/usr/lib64/libfoo.so libc.so".
-                                               
needed_entry_file="${needed_entry% *}"
-                                               if [[ "${needed_entry_file}" =~ 
^${find_path##"${D}"} ]] ; then
-                                                       scanelf_results+=( 
"${D}${needed_entry_file}" )
-                                               fi
-                                       done
-                               done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED
-                       else
-                               mapfile -t scanelf_results < <(scanelf -yqRBF 
'#k%F' -k '.symtab' "${find_paths[@]}")
-                       fi
+       for path; do
+               if [[ -e ${ED%/}/${path#/} ]]; then
+                       find_paths+=( "${ED%/}/${path#/}" )
+               fi
+       done
 
-                       while IFS= read -r path; do
-                               >> "${path}.estrip" || die
-                       done < <(
-                               (( ${#scanelf_results[@]} )) && printf "%s\n" 
"${scanelf_results[@]}"
-                               find "${find_paths[@]}" -type f ! -type l -name 
'*.a'
-                       )
+       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).
+               #
+               # EAPI 7+ has controlled stripping (dostrip) though
+               # which is why estrip has the queue/dequeue logic,
+               # so we need to take the intersection of:
+               # 1. files scanned earlier (all ELF installed)
+               #    (note that this should be a superset of 2., so we don't
+               #    need to worry about unknown files appearing)
+               #
+               # 2. the files we're interested in right now
+               if [[ -f "${PORTAGE_BUILDDIR}"/build-info/NEEDED ]] ; then
+                       # The arguments may not be exact files (probably 
aren't), but search paths/directories
+                       # which should then be searched recursively.
+                       while IFS= read -r needed_entry ; do
+                               for find_path in "${find_paths[@]}" ; do
+                                       # NEEDED has a bunch of entries like:
+                                       # /usr/lib64/libfoo.so libc.so
+                                       #
+                                       # find_path entries may be exact paths 
(like /usr/lib64/libfoo.so)
+                                       # or instead /usr/lib64, or ${ED}/usr, 
etc.
+                                       #
+                                       # We check if the beginning (i.e. first 
entry) of the NEEDED line
+                                       # matches the path given
+                                       # e.g. find_path="/usr/lib64" will 
match needed_entry="/usr/lib64/libfoo.so libc.so".
+                                       needed_entry_file="${needed_entry% *}"
+                                       if [[ "${needed_entry_file}" =~ 
^${find_path##"${D}"} ]] ; then
+                                               scanelf_results+=( 
"${D}${needed_entry_file}" )
+                                       fi
+                               done
+                       done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED
+               else
+                       mapfile -t scanelf_results < <(scanelf -yqRBF '#k%F' -k 
'.symtab' "${find_paths[@]}")
                fi
+
+               while IFS= read -r path; do
+                       >> "${path}.estrip" || die
+               done < <(
+                       (( ${#scanelf_results[@]} )) && printf "%s\n" 
"${scanelf_results[@]}"
+                       find "${find_paths[@]}" -type f ! -type l -name '*.a'
+               )
+       fi
 }
 
 declare -A has_feature

Reply via email to