git.iko.soy/typeable/cabal2nix
on master help sign in
update-stackage: make sure the Stackage package list is sorted alphabetically

This prevents redundant commits re-ordering the list mindless because upstream generated the file in a different order.

commitd1d82087bedb89af9c092d9647c1a5bad5e8f98c authorPeter Simons <simons@cryp.to> dateMon 4 Mar 2019, 14:27 (8 years ago) parent74e5d36
1 file changed+6−4
update-stackage.sh+6−4
update-stackage.sh+6−4
@@ -2,8 +2,9 @@
22
33set -eu -o pipefail
44
5−tmpfile=$(mktemp "stackage-update.XXXXXXX")
6−trap "rm $tmpfile" 0
5+tmpfile=$(mktemp "update-stackage.XXXXXXX")
6+# shellcheck disable=SC2064
7+trap "rm ${tmpfile} ${tmpfile}.new" 0
78
89curl -L -s "https://www.stackage.org/lts/cabal.config" >"$tmpfile"
910version=$(sed -n "s/^--.*http:..www.stackage.org.snapshot.lts-//p" "$tmpfile")
@@ -16,7 +17,7 @@ sed -r \
1617 -e 's|,$||' \
1718 -e '/installed$/d' \
1819 -e '/^$/d' \
19− -i "$tmpfile"
20+ < "${tmpfile}" | sort --ignore-case >"${tmpfile}.new"
2021
2122# Drop restrictions on some tools where we always want the latest version.
2223sed -r \
@@ -38,9 +39,10 @@ sed -r \
3839 -e '/ ShellCheck /d' \
3940 -e '/ stack /d' \
4041 -e '/ weeder /d' \
41− -i "$tmpfile"
42+ < "${tmpfile}.new" > "${tmpfile}"
4243
4344# Drop the previous configuration ...
45+# shellcheck disable=SC1004
4446sed -e '/# LTS Haskell/,/^$/c \TODO\
4547' -i nixpkgs/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
4648