mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-12 07:18:31 +01:00
32 lines
1.1 KiB
Bash
Executable File
32 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euxo pipefail
|
|
|
|
ETC=$(cd $(dirname $0) ; pwd)
|
|
export GHCVER=$(sed -n "s/^ghc-version: \"\(.*\)\"/\1/p" "$ETC/../build-constraints.yaml")
|
|
|
|
# Download and unpack the stack executable
|
|
mkdir -p ~/.local/bin
|
|
export PATH=$HOME/.local/bin:$PATH
|
|
curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
|
|
|
|
# Get new Stackage curator
|
|
CURATOR2=stackage-curator-2-7e161449fa1b63a7e41299f3f87bd6f3d7e13082
|
|
wget "https://download.fpcomplete.com/stackage-curator-2/$CURATOR2.bz2"
|
|
bunzip2 "$CURATOR2.bz2"
|
|
chmod +x $CURATOR2
|
|
mv $CURATOR2 ~/.local/bin/stackage-curator-2
|
|
|
|
# Install GHC
|
|
stack setup $GHCVER
|
|
|
|
# curator's constraint command has target as a required parameter
|
|
# because of a different constraints handling in minor LTS version bumps
|
|
NIGHTLY="nightly-$(date +%Y-%m-%d)"
|
|
# New curator check
|
|
stackage-curator-2 update &&
|
|
stackage-curator-2 constraints --target=$NIGHTLY &&
|
|
stackage-curator-2 snapshot-incomplete &&
|
|
stackage-curator-2 snapshot &&
|
|
stack --resolver ghc-$GHCVER exec stackage-curator-2 check-snapshot
|