about summary refs log tree commit diff
path: root/nixpkgs/maintainers/scripts/haskell/update-stackage.sh
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/maintainers/scripts/haskell/update-stackage.sh')
-rwxr-xr-xnixpkgs/maintainers/scripts/haskell/update-stackage.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/nixpkgs/maintainers/scripts/haskell/update-stackage.sh b/nixpkgs/maintainers/scripts/haskell/update-stackage.sh
index 881cf5fd4837..5dc52abdd668 100755
--- a/nixpkgs/maintainers/scripts/haskell/update-stackage.sh
+++ b/nixpkgs/maintainers/scripts/haskell/update-stackage.sh
@@ -7,8 +7,11 @@ set -eu -o pipefail
 # Stackage solver to use, LTS or Nightly
 # (should be capitalized like the display name)
 SOLVER=LTS
+# Stackage solver verson, if any. Use latest if empty
+VERSION=21
 TMP_TEMPLATE=update-stackage.XXXXXXX
 readonly SOLVER
+readonly VERSION
 readonly TMP_TEMPLATE
 
 toLower() {
@@ -23,7 +26,7 @@ stackage_config="pkgs/development/haskell-modules/configuration-hackage2nix/stac
 trap 'rm "${tmpfile}" "${tmpfile_new}"' 0
 touch "$tmpfile" "$tmpfile_new" # Creating files here so that trap creates no errors.
 
-curl -L -s "https://stackage.org/$(toLower "$SOLVER")/cabal.config" >"$tmpfile"
+curl -L -s "https://stackage.org/$(toLower "$SOLVER")${VERSION:+-$VERSION}/cabal.config" >"$tmpfile"
 old_version=$(grep '^# Stackage' $stackage_config | sed -e 's/.\+ \([A-Za-z]\+ [0-9.-]\+\)$/\1/g')
 version="$SOLVER $(sed -rn "s/^--.*http:..(www.)?stackage.org.snapshot.$(toLower "$SOLVER")-//p" "$tmpfile")"