2022-01-31 20:18:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
url=$1
|
|
|
|
ver=$2
|
2022-02-26 17:06:41 +00:00
|
|
|
artifacts_dir=$3
|
2022-01-31 20:18:24 +00:00
|
|
|
|
|
|
|
die() {
|
|
|
|
(>&2 printf "%s\\n" "$1")
|
|
|
|
exit 2
|
|
|
|
}
|
|
|
|
|
|
|
|
[ -z $url ] && die "no url set"
|
|
|
|
[ -z $ver ] && die "no version set"
|
2022-02-26 17:06:41 +00:00
|
|
|
[ -z "${artifacts_dir}" ] && die "artifacts_dir not set"
|
2022-02-26 17:47:07 +00:00
|
|
|
[ -e "${artifacts_dir}" ] || die "artifacts_dir \"${artifacts_dir}\" does not exist"
|
2022-02-26 17:06:41 +00:00
|
|
|
|
|
|
|
cd "${artifacts_dir}"
|
2022-01-31 20:18:24 +00:00
|
|
|
|
|
|
|
sftp $url <<EOF
|
|
|
|
cd ghcup
|
|
|
|
|
2022-02-26 17:06:41 +00:00
|
|
|
mkdir ${ver}
|
|
|
|
cd ${ver}
|
|
|
|
put SHA256SUMS
|
|
|
|
put SHA256SUMS.sig
|
|
|
|
put aarch64-apple-darwin-ghcup-${ver}
|
|
|
|
put aarch64-apple-darwin-ghcup-${ver}.sig
|
|
|
|
put aarch64-linux-ghcup-${ver}
|
|
|
|
put aarch64-linux-ghcup-${ver}.sig
|
|
|
|
put armv7-linux-ghcup-${ver}
|
|
|
|
put armv7-linux-ghcup-${ver}.sig
|
|
|
|
put i386-linux-ghcup-${ver}
|
|
|
|
put i386-linux-ghcup-${ver}.sig
|
|
|
|
put x86_64-apple-darwin-ghcup-${ver}
|
|
|
|
put x86_64-apple-darwin-ghcup-${ver}.sig
|
|
|
|
put x86_64-freebsd12-ghcup-${ver}
|
|
|
|
put x86_64-freebsd12-ghcup-${ver}.sig
|
|
|
|
put x86_64-freebsd13-ghcup-${ver}
|
|
|
|
put x86_64-freebsd13-ghcup-${ver}.sig
|
|
|
|
put x86_64-linux-ghcup-${ver}
|
|
|
|
put x86_64-linux-ghcup-${ver}.sig
|
|
|
|
put x86_64-mingw64-ghcup-${ver}.exe
|
|
|
|
put x86_64-mingw64-ghcup-${ver}.exe.sig
|
2022-01-31 20:18:24 +00:00
|
|
|
EOF
|
|
|
|
|
2022-02-26 17:06:41 +00:00
|
|
|
curl -X PURGE https://downloads.haskell.org/~ghcup/${ver}/
|
|
|
|
curl -X PURGE https://downloads.haskell.org/ghcup/${ver}/
|