mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-10-13 19:31:05 +02:00
Merge pull request #2361 from rbenv/truffleruby-dev-url-redirect
Simplify `truffleruby+graalvm-dev` build definition re: download redirect
This commit is contained in:
commit
683dc59774
2 changed files with 17 additions and 12 deletions
|
@ -423,8 +423,15 @@ http_head_aria2c() {
|
||||||
}
|
}
|
||||||
|
|
||||||
http_get_aria2c() {
|
http_get_aria2c() {
|
||||||
|
local destfile="$2"
|
||||||
|
if [[ $destfile == /* ]]; then
|
||||||
|
# the "-o" option to aria2c cannot be an absolute path, but we can achieve that with "--dir"
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
log_command aria2c --allow-overwrite=true --no-conf=true --console-log-level=warn --stderr $ARIA2_OPTS -o "$2" "$1" 2>&3
|
log_command aria2c --allow-overwrite=true --no-conf=true --console-log-level=warn --stderr $ARIA2_OPTS --dir "${destfile%/*}" -o "${destfile##*/}" "$1" 2>&3
|
||||||
|
else
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
log_command aria2c --allow-overwrite=true --no-conf=true --console-log-level=warn --stderr $ARIA2_OPTS -o "$destfile" "$1" 2>&3
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
http_head_curl() {
|
http_head_curl() {
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
platform="$(uname -s)-$(uname -m)"
|
platform="$(uname -s)-$(uname -m)"
|
||||||
case $platform in
|
case $platform in
|
||||||
Linux-x86_64)
|
Linux-x86_64)
|
||||||
url="https://raw.githubusercontent.com/graalvm/graal-languages-ea-builds/main/truffleruby/versions/latest-jvm-linux-amd64.url"
|
url="https://github.com/graalvm/graal-languages-ea-builds/raw/HEAD/truffleruby/versions/latest-jvm-linux-amd64.url"
|
||||||
;;
|
;;
|
||||||
Linux-aarch64)
|
Linux-aarch64)
|
||||||
url="https://raw.githubusercontent.com/graalvm/graal-languages-ea-builds/main/truffleruby/versions/latest-jvm-linux-aarch64.url"
|
url="https://github.com/graalvm/graal-languages-ea-builds/raw/HEAD/truffleruby/versions/latest-jvm-linux-aarch64.url"
|
||||||
;;
|
;;
|
||||||
Darwin-x86_64)
|
Darwin-x86_64)
|
||||||
url="https://raw.githubusercontent.com/graalvm/graal-languages-ea-builds/main/truffleruby/versions/latest-jvm-darwin-amd64.url"
|
url="https://github.com/graalvm/graal-languages-ea-builds/raw/HEAD/truffleruby/versions/latest-jvm-darwin-amd64.url"
|
||||||
;;
|
;;
|
||||||
Darwin-arm64)
|
Darwin-arm64)
|
||||||
url="https://raw.githubusercontent.com/graalvm/graal-languages-ea-builds/main/truffleruby/versions/latest-jvm-darwin-aarch64.url"
|
url="https://github.com/graalvm/graal-languages-ea-builds/raw/HEAD/truffleruby/versions/latest-jvm-darwin-aarch64.url"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
colorize 1 "Unsupported platform: $platform"
|
colorize 1 "Unsupported platform: $platform"
|
||||||
|
@ -18,9 +18,7 @@ Darwin-arm64)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
pushd "$BUILD_PATH" >/dev/null
|
urlfile="$(mktemp "${TMP}/truffleruby.XXXXXX")"
|
||||||
http get $url url.txt
|
http get "$url" "$urlfile"
|
||||||
url=$(<url.txt)
|
install_package "truffleruby+graalvm-dev" "$(<"$urlfile")" truffleruby
|
||||||
popd
|
rm -f "$urlfile"
|
||||||
|
|
||||||
install_package "truffleruby+graalvm-dev" "$url" truffleruby
|
|
||||||
|
|
Loading…
Reference in a new issue