Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fe97440

Browse files
committedSep 21, 2023
Let RUBY_BUILD_MIRROR_PACKAGE_URL work even when there is no checksum
* And add RUBY_BUILD_IGNORE_CHECKSUM when it is expected the alternative URL has different contents.
1 parent 5478483 commit fe97440

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed
 

‎bin/ruby-build

+10-6
Original file line numberDiff line numberDiff line change
@@ -365,14 +365,18 @@ fetch_tarball() {
365365
if [ "$package_url" != "${package_url/\#}" ]; then
366366
checksum="${package_url#*#}"
367367
package_url="${package_url%%#*}"
368+
fi
368369

369-
if [ -n "$RUBY_BUILD_MIRROR_URL" ]; then
370-
if [[ -z "$RUBY_BUILD_DEFAULT_MIRROR" || $package_url != */cache.ruby-lang.org/* ]]; then
371-
mirror_url="${RUBY_BUILD_MIRROR_URL}/$checksum"
372-
fi
373-
elif [ -n "$RUBY_BUILD_MIRROR_PACKAGE_URL" ]; then
374-
mirror_url="$RUBY_BUILD_MIRROR_PACKAGE_URL"
370+
if [ -n "$RUBY_BUILD_IGNORE_CHECKSUM" ]; then
371+
checksum=""
372+
fi
373+
374+
if [[ -n "$RUBY_BUILD_MIRROR_URL" && -n "$checksum" ]]; then
375+
if [[ -z "$RUBY_BUILD_DEFAULT_MIRROR" || $package_url != */cache.ruby-lang.org/* ]]; then
376+
mirror_url="${RUBY_BUILD_MIRROR_URL}/$checksum"
375377
fi
378+
elif [ -n "$RUBY_BUILD_MIRROR_PACKAGE_URL" ]; then
379+
mirror_url="$RUBY_BUILD_MIRROR_PACKAGE_URL"
376380
fi
377381

378382
local tar_args="xzf"

0 commit comments

Comments
 (0)
Please sign in to comment.