@@ -47,38 +47,36 @@ unused_dlls_file=/tmp/unused-dlls.$$.txt
47
47
tmp_file=/tmp/tmp.$$ .txt
48
48
trap " rm \" $used_dlls_file \" \" $missing_dlls_file \" \" $unused_dlls_file \" \" $tmp_file \" " EXIT
49
49
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) " &&
54
54
for dir in $dirs
55
55
do
56
56
test -z " $print_dir " ||
57
57
printf " dir: $dir \\ 033[K\\ r" >&2
58
58
59
59
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=" " ;;
63
63
esac
64
64
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"
68
67
paths=" $( sed -n ' s|^/usr/bin/objdump: \([^ :]*\): file format not recognized|\1|p' < " $tmp_file " ) "
69
68
test -z " $paths " ||
70
- out= " $out$LF $( ldd $paths ) "
69
+ ldd $paths >> " $tmp_file .ldd "
71
70
72
- echo " $out " |
73
- tr A-Z\\ r a-z\ |
71
+ tr A-Z\\ r a-z\ < " $tmp_file .ldd" |
74
72
grep -e ' ^.dll name:' -e ' ^[^ ]*\.\(dll\|exe\):' -e ' \.dll =>' |
75
73
while read a b c d
76
74
do
77
75
case " $a ,$b " in
78
76
* .exe:,* |* .dll:,* ) current=" ${a%: } " ;;
79
77
* .dll," =>" ) # `ldd` output
80
78
echo " $a " >> " $used_dlls_file "
81
- case " $dlls " in
79
+ case " $sys_dlls$LF$ dlls " in
82
80
* " /$a$LF " * ) ;; # okay, it's included
83
81
* )
84
82
echo " $current is missing $a " >&2
88
86
;;
89
87
dll,name:) # `objdump -p` output
90
88
echo " $c " >> " $used_dlls_file "
91
- case " $dlls " in
89
+ case " $sys_dlls$LF$ dlls " in
92
90
* " /$c$LF " * ) ;; # okay, it's included
93
91
* )
94
92
echo " $current is missing $c " >&2
@@ -106,8 +104,7 @@ used_dlls_regex="/\\($(test -n "$MINIMAL_GIT" || printf 'p11-kit-trust\\|';
106
104
uniq |
107
105
sed -e ' s/+x/\\+/g' -e ' s/\.dll$/\\|/' -e ' $s/\\|//' |
108
106
tr -d ' \n' ) \\ )\\ .dll\$ "
109
- echo " $all_files " |
110
- grep ' \.dll$' |
107
+ grep ' \.dll$' " $tmp_file .all" |
111
108
grep -v \
112
109
-e " $used_dlls_regex " \
113
110
-e ' ^usr/lib/perl5/' \
0 commit comments