aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2021-02-12 03:14:09 +0100
committerDaniel Gröber <dxld@darkboxed.org>2021-02-12 03:14:09 +0100
commit88df287205cb44cdfda8ab6ba70d3ceef35845fa (patch)
tree79e455fd1df11df89979f0ae3708116e35c4c90e /scripts/ci
parentbb8b03c90a8dc2096293fac1544fcf4fccfb47da (diff)
scripts: Use new stackage-snapshots repo for update-stack-resolvers
Diffstat (limited to 'scripts/ci')
-rwxr-xr-xscripts/ci/update-stack-resolvers.sh28
1 files changed, 13 insertions, 15 deletions
diff --git a/scripts/ci/update-stack-resolvers.sh b/scripts/ci/update-stack-resolvers.sh
index 4a20c14..9f6ce68 100755
--- a/scripts/ci/update-stack-resolvers.sh
+++ b/scripts/ci/update-stack-resolvers.sh
@@ -2,22 +2,20 @@
# Example:
# $ scripts/ci/update-stack-resolvers.sh | tee tests/stack-resolvers
-mkdir -p /tmp/stack-resolvers/
+STACKAGE_SNAPSHOTS_REPO=https://github.com/commercialhaskell/stackage-snapshots
-wget -q https://s3.amazonaws.com/haddock.stackage.org/snapshots.json \
- -O /tmp/stack-resolvers/snapshots.json
+tmp=/tmp/stack-resolvers
+mkdir -p "$tmp"
-resolvers=$(cat /tmp/stack-resolvers/snapshots.json \
- | jq -r '.[]' | grep ^lts- | sort -V -r | uniq)
+wget -q -O- "$STACKAGE_SNAPSHOTS_REPO"/archive/master.tar.gz \
+ | tar -xvz --strip-components=1 --show-transformed-names \
+ | tee "$tmp"/all-resolvers.list
-for res in $resolvers; do
- wget -q --continue \
- -O /tmp/stack-resolvers/$res.yaml \
- https://raw.githubusercontent.com/commercialhaskell/lts-haskell/master/$res.yaml
+< "$tmp"/all-resolvers.list \
+ sed -rn 's_((lts)/([0-9]+)/([0-9]+)\.yaml)_\1 \2-\3.\4 \2-\3_p' \
+ | sort -V -r | uniq -f 2 > "$tmp"/resolvers.list
- ghc=$(cat /tmp/stack-resolvers/$res.yaml \
- | grep ghc-version | awk '{ print $2 }' | tr -cd '0-9.')
-
- [ -z "$ghc" ] && continue
- printf '%-10s %s\n' "$ghc" "$res"
-done
+while read -r path lts _; do
+ ghc=$(cat $path | sed -rn 's/^ *compiler: +ghc-([0-9.]+)/\1/p')
+ printf '%-10s %s\n' "$ghc" "$lts"
+done < "$tmp"/resolvers.list