get-win32-tarballs: More reworking of tarball maintenance
authorBen Gamari <ben@smart-cactus.org>
Thu, 9 Mar 2017 14:25:50 +0000 (09:25 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 9 Mar 2017 15:34:34 +0000 (10:34 -0500)
This fixes fetching of signatures and sources for inconsistently named msys2
tarballs.

mk/get-win32-tarballs.sh
mk/win32-tarballs.md5sum

index 769beb0..f51a304 100755 (executable)
@@ -34,10 +34,11 @@ download_file() {
         fi
     fi
 
-    if test "$sigs" = "1"
+    local sig_file="${dest_file}.sig"
+    if test "$sigs" = "1" -a ! -f "$sig_file"
     then
         echo "Downloading ${description} (signature) to ${dest_dir}..."
-        local curl_cmd="curl -L ${file_url}.sig -o ${dest_file}.sig --create-dirs -# ${extra_curl_opts}"
+        local curl_cmd="curl -L ${file_url}.sig -o ${sig_file} --create-dirs -# ${extra_curl_opts}"
         $curl_cmd || {
                 rm -f "${dest_file}.sig"
                 fail "ERROR: Download failed."
@@ -46,7 +47,7 @@ download_file() {
 
     if test "$verify" = "1"
     then
-        grep "${dest_file}" mk/win32-tarballs.md5sum | md5sum --quiet -c - ||
+        grep "${dest_file}$" mk/win32-tarballs.md5sum | md5sum --quiet -c - ||
             fail "ERROR: ${description} appears to be corrupted, please delete it and try again."
     fi
 }
@@ -74,8 +75,8 @@ download_mingw() {
 }
 
 download_tarballs() {
-    local mingw_base_url="http://repo.msys2.org/mingw"
-    #local mingw_base_url="https://downloads.haskell.org/~ghc/mingw"
+    #local mingw_base_url="http://repo.msys2.org/mingw"
+    local mingw_base_url="https://downloads.haskell.org/~ghc/mingw"
     local package_prefix="mingw-w64"
     local format_url="${mingw_base_url}/${mingw_arch}/${package_prefix}-${mingw_arch}"
 
@@ -85,14 +86,22 @@ download_tarballs() {
     download_mingw "${format_url}-libwinpthread-git-5.0.0.4741.2c8939a-1-any.pkg.tar.xz"
     download_mingw "${format_url}-zlib-1.2.8-9-any.pkg.tar.xz"
     download_mingw "${format_url}-isl-0.17.1-1-any.pkg.tar.xz"
-    download_mingw "${format_url}-mpc-1.0.3-2-any.pkg.tar.xz"
     download_mingw "${format_url}-mpfr-3.1.4.p3-4-any.pkg.tar.xz"
     download_mingw "${format_url}-gmp-6.1.1-1-any.pkg.tar.xz"
-    download_mingw "${format_url}-gcc-libs-6.2.0-2-any.pkg.tar.xz"
     download_mingw "${format_url}-binutils-2.27-2-any.pkg.tar.xz"
     download_mingw "${format_url}-libidn-1.32-3-any.pkg.tar.xz"
     download_mingw "${format_url}-gcc-6.2.0-2-any.pkg.tar.xz"
 
+    # Upstream is unfortunately quite inconsistent in naming
+    if test "$mingw_arch" != "sources"; then
+        download_mingw "${format_url}-mpc-1.0.3-2-any.pkg.tar.xz"
+        download_mingw "${format_url}-gcc-libs-6.2.0-2-any.pkg.tar.xz"
+    else
+        local format_url="${mingw_base_url}/${mingw_arch}/${package_prefix}"
+        download_mingw "${format_url}-i686-mpc-1.0.3-2.src.tar.gz"
+        download_mingw "${format_url}-x86_64-mpc-1.0.3-2.src.tar.gz"
+    fi
+
     download_file "https://github.com/ghc/ghc-tarballs/blob/master/perl/ghc-perl-1.tar.gz?raw=true" "ghc-tarballs/perl/ghc-perl-1.tar.gz" "Windows Perl binary distributions" "--insecure"
 
     if ! test "$missing_files" = "0"
index 2ff0f5b..c65272b 100644 (file)
@@ -11,6 +11,18 @@ d263d1362dee0c24df80b461eb2ec489  ghc-tarballs/mingw-w64/x86/mingw-w64-i686-binu
 9ecd264a3da0f0f6af8b392c1b183a7b  ghc-tarballs/mingw-w64/x86/mingw-w64-i686-libidn-1.32-3-any.pkg.tar.xz
 e8cc05fc566ddc6c16266da9aec2ddd3  ghc-tarballs/mingw-w64/x86/mingw-w64-i686-gmp-6.1.1-1-any.pkg.tar.xz
 719e76fa7a54a8676d2e60af3bb13c45  ghc-tarballs/mingw-w64/x86/mingw-w64-i686-mpc-1.0.3-2-any.pkg.tar.xz
+af26624e5337a1bbb2cc21eb69c79583  ghc-tarballs/mingw-w64/sources/mingw-w64-libidn-1.32-3.src.tar.gz
+5c24d319656ed61e517dfa0fee7e475c  ghc-tarballs/mingw-w64/sources/mingw-w64-i686-mpc-1.0.3-2.src.tar.gz
+7640270cffcd384f8dc44c19f502cb53  ghc-tarballs/mingw-w64/sources/mingw-w64-gmp-6.1.1-1.src.tar.gz
+33ff8b589d36fbd49f287f283a58ffe5  ghc-tarballs/mingw-w64/sources/mingw-w64-headers-git-5.0.0.4747.0f8f626-1.src.tar.gz
+d0b3537c3f56b6f396b3dc23a905d186  ghc-tarballs/mingw-w64/sources/mingw-w64-crt-git-5.0.0.4795.e3d96cb1-1.src.tar.gz
+dfa5ea68e92146b3066e6808847ff247  ghc-tarballs/mingw-w64/sources/mingw-w64-gcc-6.2.0-2.src.tar.gz
+d6e1c36ea8f308aeba179bca976c817d  ghc-tarballs/mingw-w64/sources/mingw-w64-binutils-2.27-2.src.tar.gz
+32078e2a67e34ff6c0b1795fe6ed9d36  ghc-tarballs/mingw-w64/sources/mingw-w64-zlib-1.2.8-9.src.tar.gz
+fd3f5c0829f52bb84873a2712d19e151  ghc-tarballs/mingw-w64/sources/mingw-w64-winpthreads-git-5.0.0.4741.2c8939a-1.src.tar.gz
+9a247c15405f83152f4bb9cf339ed741  ghc-tarballs/mingw-w64/sources/mingw-w64-mpfr-3.1.4.p3-4.src.tar.gz
+e0b495821486711fc113de0d9c648498  ghc-tarballs/mingw-w64/sources/mingw-w64-isl-0.17.1-1.src.tar.gz
+d4261042f502998006c57f0e6517998e  ghc-tarballs/mingw-w64/sources/mingw-w64-x86_64-mpc-1.0.3-2.src.tar.gz
 3780a25a6f20eef9b143f47f4b615e39  ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-crt-git-5.0.0.4795.e3d96cb1-1-any.pkg.tar.xz
 ba417ad9fb7cd3ee56e713b2b070adb9  ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-winpthreads-git-5.0.0.4741.2c8939a-1-any.pkg.tar.xz
 39c8b3b8e56b3b0bdef86cf32f1e09ba  ghc-tarballs/mingw-w64/x86_64/mingw-w64-x86_64-isl-0.17.1-1-any.pkg.tar.xz