update-stackage.sh: update the stackage config
commitabba3896a655196cda7a82642bff38bb1f526d96
authorPeter Simons <simons@cryp.to>
dateMon 19 Sep 2016, 17:53 (10 years ago)
parent589079a
update-stackage.shnew file+24
@@ -0,0 +1,24 @@
1+#! /usr/bin/env bash
2+
3+set -eu -o pipefail
4+
5+tmpfile=$(mktemp "stackage-update.XXXXXXX")
6+trap "rm $tmpfile" 0
7+
8+curl -L -s "https://www.stackage.org/lts/cabal.config" >"$tmpfile"
9+version=$(sed -n "s/^--.*http:..www.stackage.org.snapshot.lts-//p" "$tmpfile")
10+
11+sed -r \
12+ -e '/^--/d' \
13+ -e 's|^constraints:||' \
14+ -e 's|^ +| - |' \
15+ -e 's|,$||' \
16+ -e '/installed$/d' \
17+ -i "$tmpfile"
18+
19+sed -e '/# LTS Haskell/,/^$/c \TODO\
20+' -i nixpkgs/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
21+
22+sed -e "/TODO/r $tmpfile" \
23+ -e "s/TODO/ # LTS Haskell $version/" \
24+ -i nixpkgs/pkgs/development/haskell-modules/configuration-hackage2nix.yaml