From 82d35ed02b69d40ed8d2ea20195e747e08b60884 Mon Sep 17 00:00:00 2001 From: Koichi ITO Date: Mon, 9 Mar 2020 19:57:18 +0900 Subject: [PATCH] Add update-cruby and update-jruby scripts This PR adds update-cruby and update-jruby scripts. They are provided to update MRI and JRuby definition files. These scripts are based on script/update-truffleruby. https://github.com/rbenv/ruby-build/blob/v20200224/script/update-truffleruby --- script/update-cruby | 23 +++++++++++++++++++++++ script/update-jruby | 22 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100755 script/update-cruby create mode 100755 script/update-jruby diff --git a/script/update-cruby b/script/update-cruby new file mode 100755 index 00000000..74412071 --- /dev/null +++ b/script/update-cruby @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +if [ $# -ne 2 ]; then + echo "usage: $0 VERSION RELEASE_DIRECTORY" + exit 1 +fi + +version="$1" +release_directory="$2" +file="share/ruby-build/${version}" + +basename="ruby-${version}.tar.bz2" +major_minor_version=$(echo ${version} | cut -d '.' -f 1,2) +url="https://cache.ruby-lang.org/pub/ruby/${major_minor_version}/${basename}" +sha256=$(sha256sum "$release_directory/$basename" | cut -d ' ' -f 1) + +cat > "$file" < "$file" <