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.
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
17 echo "RELEASE: $RELEASE"
19 for com
in wget sha256sum
; do
20 command -V ${com} >/dev
/null
2>&1
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}"
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."