Skip to content

Commit

Permalink
fixup: ghcup download
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Dec 15, 2023
1 parent 290af18 commit 8a127cc
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -637,17 +637,17 @@ EOF
#}

fetch_stack_osx() {
curl -sSkL https://www.stackage.org/stack/osx-x86_64 \
curl --fail -sSkL https://www.stackage.org/stack/osx-x86_64 \
| tar xz --strip-components=1 -C $1 --include '*/stack'
}

fetch_stack_linux() {
curl -sSkL https://www.stackage.org/stack/linux-x86_64 \
curl --fail -sSkL https://www.stackage.org/stack/linux-x86_64 \
| tar xz --strip-components=1 -C $1 --wildcards '*/stack'
}

fetch_stack_windows() {
curl -sSkL http://www.stackage.org/stack/windows-i386 \
curl --fail -sSkL http://www.stackage.org/stack/windows-i386 \
| 7z x -si stack.exe
}

Expand Down Expand Up @@ -886,7 +886,16 @@ ghcup_install() {
esac

# Check available versions here: https://downloads.haskell.org/~ghcup/
curl -sL -o $GHCUP_PATH https://downloads.haskell.org/~ghcup/$GHCUP_VER/${GHCUP_ARCH}-ghcup-$GHCUP_VER
mkdir -p $(dirname $GHCUP_PATH)
URL="https://downloads.haskell.org/~ghcup/$GHCUPVER/${GHCUP_ARCH}-ghcup-$GHCUPVER"
echo "Downloading $URL"
curl --fail -sL -o $GHCUP_PATH $URL
if test $? -ne 0
then
rm -f $GHCUP_PATH
echo "Failed to download ghcup"
exit 1
fi
chmod +x $GHCUP_PATH
fi

Expand Down Expand Up @@ -940,11 +949,11 @@ ensure_ghc() {
die "$msg"
fi

if test -n "$GHCVER"
check_version_die $COMPILER $GHCVER
if test -n "$GHCVER" -a -n "$(need_stack)"
then
echo "GHCVER is specified, using '$STACKCMD --system-ghc'."
echo "Clear GHCVER if you want to use stack supplied ghc."
check_version_die $COMPILER $GHCVER
# If the user specified GHCVER then use it as system-ghc
# Stack will still silently choose its own ghc if the ghc does not match
# the snapshot.
Expand Down Expand Up @@ -1597,7 +1606,7 @@ install_hlint() {
trap cleanup EXIT

echo $URL
retry_cmd curl --progress-bar --location -o$TEMP/$PACKAGE$EXT $URL
retry_cmd curl --fail --progress-bar --location -o$TEMP/$PACKAGE$EXT $URL
mkdir -p ${OS_APP_HOME}/${OS_LOCAL_DIR}/bin/
if [ "$OS" = "windows" ]; then
7z x -y $TEMP/$PACKAGE$EXT -o${TEMP} hlint-$VERSION/hlint.exe > /dev/null
Expand Down

0 comments on commit 8a127cc

Please sign in to comment.