Commit fdc1a00c by Sam Stephenson

Degrade gracefully (no checksumming or mirrors) if MD5 is unavailable

parent 1043ab60
......@@ -138,12 +138,15 @@ compute_md5() {
local output="$(md5sum -b)"
echo "${output% *}"
else
echo "error: please install \`md5sum\` and try again" >&2
exit 1
return 1
fi
}
verify_checksum() {
if [ -z "$HAS_MD5_SUPPORT" ]; then
return 0
fi
local filename="$1"
if [ ! -e "$filename" ]; then
return 1
......@@ -591,6 +594,13 @@ if [ -n "$RUBY_BUILD_SKIP_MIRROR" ]; then
unset RUBY_BUILD_MIRROR_URL
fi
if echo test | compute_md5 >/dev/null; then
HAS_MD5_SUPPORT=1
else
unset HAS_MD5_SUPPORT
unset RUBY_BUILD_MIRROR_URL
fi
SEED="$(date "+%Y%m%d%H%M%S").$$"
LOG_PATH="${TMP}/ruby-build.${SEED}.log"
RUBY_BIN="${PREFIX_PATH}/bin/ruby"
......
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