]> granicus.if.org Git - libexpat/commitdiff
coverage.sh: Improve handling of absent libwinpthread-1.dll
authorSebastian Pipping <sebastian@pipping.org>
Sun, 6 Oct 2019 19:26:09 +0000 (21:26 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Mon, 7 Oct 2019 20:33:35 +0000 (22:33 +0200)
expat/coverage.sh

index 60d52d86b86e63a61e899a16633d66f9211013fd..2624ff96e6bbdf77a21e41a46e7b868680f01ed5 100755 (executable)
@@ -83,15 +83,17 @@ _copy_missing_mingw_libaries() {
         )
     done
 
-    local mingw_pthread_dll_dir="$(dirname "$(ls -1 /usr/i686-w64-mingw32/lib*/libwinpthread-1.dll | head -n1)")"
-    for dll in libwinpthread-1.dll; do
-        source="${mingw_pthread_dll_dir}"/${dll}
-        [[ -e "${source}" ]] || continue
-        (
-            set -x
-            ln -s "${source}" "${target}"/${dll}
-        )
-    done
+    local mingw_pthread_dll="$(ls -1 /usr/i686-w64-mingw32/lib*/libwinpthread-1.dll 2>/dev/null | head -n1)"
+    if [[ -n ${mingw_pthread_dll} ]]; then
+        local mingw_pthread_dll_dir="$(dirname "${mingw_pthread_dll}")"
+        for dll in libwinpthread-1.dll; do
+            source="${mingw_pthread_dll_dir}"/${dll}
+            (
+                set -x
+                ln -s "${source}" "${target}"/${dll}
+            )
+        done
+    fi
 }