Commit 758d23c1 authored by Ryan Scott's avatar Ryan Scott

Fix #2

This fixes #2 by tweaking `scripts/head.hackage` in two ways:

1. This changes the script to use
   `cabal new-update head.hackage.ghc.haskell.org`, not
   `cabal new-update head.hackage`, since the former is now the name
   of the `repository`. Since `head.hackage.ghc.haskell.org` is
   referred to in quite a few places in the script, I factored this
   out into its own variable.
2. This changes the `url` to use `http://`, not `https://`, so that
   `http-transport: plain-http` works properly. An alternative would
   be to keep the use of `https://` and use `http-transport: curl`
   instead, but that assumes the existence of a `curl` binary on
   one's machine, making it a less portable solution. In any case,
   the use of `http://` in this script shouldn't pose any security
   issues, since `hackage-security` already introduces a security
   layer independent of CAs.
parent 714ecb06
Pipeline #9065 passed with stages
in 103 minutes and 26 seconds
......@@ -5,10 +5,12 @@ die () {
exit 1
}
REPO=head.hackage.ghc.haskell.org
cat_repo () {
cat <<EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
repository $REPO
url: http://ghc.gitlab.haskell.org/head.hackage/
secure: True
root-keys: 7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
......@@ -57,18 +59,18 @@ case "X$1" in
check_pkgcache
if "$CABAL" new-update --help > /dev/null 2>&1; then
echo "INFO: '$CABAL' is recent enough and supports 'cabal new-update head.hackage'; you can try using that directly!"
echo "INFO: '$CABAL' is recent enough and supports 'cabal new-update $REPO'; you can try using that directly!"
echo ""
CFGFILE=$(mktemp)
cat_repo > "$CFGFILE"
# we need to wipe the cache for head.hackage to workaround issues in hackage-security
rm -rf "$PKGCACHE/head.hackage/"
rm -rf "$PKGCACHE/$REPO/"
echo "http-transport: plain-http" >> "$CFGFILE"
"$CABAL" --project-file="$CFGFILE" new-update head.hackage
"$CABAL" --project-file="$CFGFILE" new-update $REPO
rm "$CFGFILE"
else
......@@ -78,7 +80,7 @@ case "X$1" in
cat_repo > "$CFGFILE"
# we need to wipe the cache for head.hackage to workaround issues in hackage-security
rm -rf "$PKGCACHE/head.hackage/"
rm -rf "$PKGCACHE/$REPO/"
echo "http-transport: plain-http" >> "$CFGFILE"
echo "remote-repo-cache: $PKGCACHE" >> "$CFGFILE"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment