Skip to content

Instantly share code, notes, and snippets.

@croaker
Last active December 14, 2015 09:59
Show Gist options
  • Save croaker/5068854 to your computer and use it in GitHub Desktop.
Save croaker/5068854 to your computer and use it in GitHub Desktop.
Download a ruby 1.9.3 version, patch it using the railsexpress patches of skaes/rvm-patchsets, and pack it up..
#!/bin/bash
set -e
echo "Which patchset of ruby 1.9.3 do you want to download and patch? (eg. 392)"
read PATCHSET
RUBY_VERSION="ruby-1.9.3-p${PATCHSET}"
FILENAME="${RUBY_VERSION}.tar.gz"
if [ -d "/tmp/${RUBY_VERSION}" ]; then
echo "You seem to have the source of ${RUBY_VERSION} in /tmp. Please remove it an ruby this script again!"
exit 1
fi;
curl -o "/tmp/${FILENAME}" "http://ftp.ruby-lang.org/pub/ruby/1.9/${FILENAME}"
tar xzf "/tmp/${FILENAME}" -C /tmp
curl "https://raw.github.com/skaes/rvm-patchsets/master/patchsets/ruby/1.9.3/p${PATCHSET}/railsexpress" | xargs -I % curl https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p${PATCHSET}/% | patch -p1 -d "/tmp/${RUBY_VERSION}"
cd /tmp
tar czPf "${RUBY_VERSION}-perf.tar.gz" "${RUBY_VERSION}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment