@@ -47,38 +47,36 @@ unused_dlls_file=/tmp/unused-dlls.$$.txt
4747tmp_file=/tmp/tmp.$$ .txt
4848trap " rm \" $used_dlls_file \" \" $missing_dlls_file \" \" $unused_dlls_file \" \" $tmp_file \" " EXIT
4949
50- all_files= " $( export ARCH && " $thisdir " /make-file-list.sh | tr A-Z a-z | grep -v ' /getprocaddr64.exe$' ) " &&
51- usr_bin_dlls=" $( echo " $all_files " | grep ' ^usr/bin/[^/]*\.dll$' ) " &&
52- mingw_bin_dlls=" $( echo " $all_files " | grep ' ^' $MINGW_PREFIX ' /bin/[^/]*\.dll$' ) " &&
53- dirs=" $( echo " $all_files " | sed -n ' s/[^/]*\.\(dll\|exe\)$//p' | sort | uniq) " &&
50+ ARCH= $ ARCH " $thisdir " /make-file-list.sh | tr A-Z a-z | grep -v ' /getprocaddr64.exe$' > " $tmp_file .all " &&
51+ usr_bin_dlls=" $( grep ' ^usr/bin/[^/]*\.dll$' " $tmp_file .all " ) " &&
52+ mingw_bin_dlls=" $( grep ' ^' $MINGW_PREFIX ' /bin/[^/]*\.dll$' " $tmp_file .all " ) " &&
53+ dirs=" $( sed -n ' s/[^/]*\.\(dll\|exe\)$//p' " $tmp_file .all " | sort | uniq) " &&
5454for dir in $dirs
5555do
5656 test -z " $print_dir " ||
5757 printf " dir: $dir \\ 033[K\\ r" >&2
5858
5959 case " $dir " in
60- usr/* ) dlls=" $sys_dlls$LF$ usr_bin_dlls$LF " ;;
61- $MINGW_PREFIX /* ) dlls=" $sys_dlls$LF$ mingw_bin_dlls$LF " ;;
62- * ) dlls=" $sys_dlls$LF " ;;
60+ usr/* ) dlls=" $usr_bin_dlls$LF " ;;
61+ $MINGW_PREFIX /* ) dlls=" $mingw_bin_dlls$LF " ;;
62+ * ) dlls=" " ;;
6363 esac
6464
65- paths=$( echo " $all_files " |
66- sed -ne ' s,[][],\\&,g' -e " s,^$dir [^/]*\.\(dll\|exe\)$,/&,p" )
67- out=" $( /usr/bin/objdump -p $paths 2> " $tmp_file " ) "
65+ paths=$( sed -ne ' s,[][],\\&,g' -e " s,^$dir [^/]*\.\(dll\|exe\)$,/&,p" " $tmp_file .all" )
66+ /usr/bin/objdump -p $paths 2> " $tmp_file " > " $tmp_file .ldd"
6867 paths=" $( sed -n ' s|^/usr/bin/objdump: \([^ :]*\): file format not recognized|\1|p' < " $tmp_file " ) "
6968 test -z " $paths " ||
70- out= " $out$LF $( ldd $paths ) "
69+ ldd $paths >> " $tmp_file .ldd "
7170
72- echo " $out " |
73- tr A-Z\\ r a-z\ |
71+ tr A-Z\\ r a-z\ < " $tmp_file .ldd" |
7472 grep -e ' ^.dll name:' -e ' ^[^ ]*\.\(dll\|exe\):' -e ' \.dll =>' |
7573 while read a b c d
7674 do
7775 case " $a ,$b " in
7876 * .exe:,* |* .dll:,* ) current=" ${a%: } " ;;
7977 * .dll," =>" ) # `ldd` output
8078 echo " $a " >> " $used_dlls_file "
81- case " $dlls " in
79+ case " $sys_dlls$LF$ dlls " in
8280 * " /$a$LF " * ) ;; # okay, it's included
8381 * )
8482 echo " $current is missing $a " >&2
8886 ;;
8987 dll,name:) # `objdump -p` output
9088 echo " $c " >> " $used_dlls_file "
91- case " $dlls " in
89+ case " $sys_dlls$LF$ dlls " in
9290 * " /$c$LF " * ) ;; # okay, it's included
9391 * )
9492 echo " $current is missing $c " >&2
@@ -106,8 +104,7 @@ used_dlls_regex="/\\($(test -n "$MINIMAL_GIT" || printf 'p11-kit-trust\\|';
106104 uniq |
107105 sed -e ' s/+x/\\+/g' -e ' s/\.dll$/\\|/' -e ' $s/\\|//' |
108106 tr -d ' \n' ) \\ )\\ .dll\$ "
109- echo " $all_files " |
110- grep ' \.dll$' |
107+ grep ' \.dll$' " $tmp_file .all" |
111108 grep -v \
112109 -e " $used_dlls_regex " \
113110 -e ' ^usr/lib/perl5/' \
0 commit comments