Clarify why we can't run .bat files
[cabal.git] / scripts / release / download-cabal-install-release-binaries.sh
blob4547fd910e8b32291532bb6b6f25f2882b434908
1 #!/usr/bin/env bash
3 # A script to download the release binary files for a given cabal release
4 # from upstream "downlods.haskell.org".
5 # It accepts the first and only argument as the release number.
7 # useage:-
8 # $ download-cabal-install-release-binaries.sh "3.10.1.0"
10 # This was initally made to be used with ./create-release-metadata-for-ghcup.sh
12 set -eu
13 set -o pipefail
15 RELEASE=$1
17 echo "RELEASE: $RELEASE"
19 for com in wget sha256sum ; do
20 command -V ${com} >/dev/null 2>&1
21 done
23 [ ! -d "binary-downloads/cabal-install-${RELEASE}-binaries" ]
25 mkdir -p "binary-downloads/cabal-install-${RELEASE}-binaries"
27 cd "binary-downloads/cabal-install-${RELEASE}-binaries"
29 ## Download release files
30 echo "Downloading form: \"https://downloads.haskell.org/~cabal/cabal-install-${RELEASE}/\""
31 wget --no-parent -r --reject "index.html*" --no-directories "https://downloads.haskell.org/~cabal/cabal-install-${RELEASE}/"
33 ## Verify that sha256 sums of downloaded files match the ones mentioned in the upstream SHA256SUMS file
34 echo "verifying checksums for downloaded files..."
36 if sha256sum --check ./SHA256SUMS; then
37 echo "All checksums match!"
38 echo "Successfully downloaded binaries for release: ${RELEASE}"
39 else
40 echo "checksums of downloaded files do no match the ones listed in upstream SHA256SUMS file."
41 echo "please try deleting \"binary-downloads/cabal-install-${RELEASE}-binaries\" folder and downloading again."