get-win32-tarballs: Use correct `find`
authorBen Gamari <bgamari.foss@gmail.com>
Mon, 4 Sep 2017 12:01:04 +0000 (08:01 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 5 Sep 2017 11:20:00 +0000 (07:20 -0400)
This fixes #12502 by using the `find` utility found by FP_PROG_FIND
instead of the first one in PATH.

Test Plan: Validate on Windows

Reviewers: Phyx, austin, hvr

Reviewed By: Phyx

Subscribers: rwbarton, thomie, erikd

GHC Trac Issues: #12502

Differential Revision: https://phabricator.haskell.org/D3907

distrib/configure.ac.in
mk/get-win32-tarballs.sh

index 7c27dad..9a94cf2 100644 (file)
@@ -63,6 +63,12 @@ dnl ** figure out how to do a BSD-ish install **
 AC_PROG_INSTALL
 
 #
+dnl ** find `find`, used by get-win32-tarballs.sh (see #12502)
+#
+FP_PROG_FIND()
+export FIND
+
+#
 dnl ** how to do symlinks **
 #
 AC_PROG_LN_S()
index 75889ee..b3c9e07 100755 (executable)
@@ -3,6 +3,9 @@
 tarball_dir='ghc-tarballs'
 missing_files=0
 
+# see #12502
+if test -z "$FIND"; then FIND="find"; fi
+
 fail() {
     echo >&2
     echo "$1" >&2
@@ -148,16 +151,16 @@ sync_binaries_and_sources() {
     verify=0
     download_sources
 
-    for f in $(find ghc-tarballs/mingw-w64 -iname '*.sig'); do
+    for f in $($FIND ghc-tarballs/mingw-w64 -iname '*.sig'); do
         echo "Verifying $f"
         gpg --verify $f
     done
 
-    md5sum `find ghc-tarballs -type f -a -not -iname '*.sig'` >| mk/win32-tarballs.md5sum
+    md5sum `$FIND ghc-tarballs -type f -a -not -iname '*.sig'` >| mk/win32-tarballs.md5sum
     chmod -R ugo+rX ghc-tarballs
 
     rsync -av ghc-tarballs/mingw-w64/* downloads.haskell.org:public_html/mingw
-    for f in $(find ghc-tarballs/mingw-w64); do
+    for f in $($FIND ghc-tarballs/mingw-w64); do
         curl -XPURGE http://downloads.haskell.org/~ghc/mingw/$f
     done
 }