[DRE-commits] [SCM] ruby-build.git branch, master, updated. debian/20120524-1-5-gfad6f0b

Sebastian Boehm sebastian at sometimesfood.org
Thu Nov 8 16:28:04 UTC 2012


The following commit has been merged in the master branch:
commit d4c557e95c822bb975c3070f8a693d16f4796b54
Author: Sebastian Boehm <sebastian at sometimesfood.org>
Date:   Thu Nov 8 15:56:38 2012 +0100

    Imported Upstream version 20121104

diff --git a/README.md b/README.md
index 3364349..8dc8374 100644
--- a/README.md
+++ b/README.md
@@ -15,9 +15,7 @@ need precise control over Ruby version installation.
 Installing ruby-build as an rbenv plugin will give you access to the
 `rbenv install` command.
 
-    $ mkdir -p ~/.rbenv/plugins
-    $ cd ~/.rbenv/plugins
-    $ git clone git://github.com/sstephenson/ruby-build.git
+    $ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
 
 This will install the latest development version of ruby-build into
 the `~/.rbenv/plugins/ruby-build` directory. From that directory, you
@@ -67,13 +65,13 @@ Or, if you would like to install the latest development release:
 To install a Ruby version for use with rbenv, run `rbenv install` with
 the exact name of the version you want to install. For example,
 
-    $ rbenv install 1.9.3-p194
+    $ rbenv install 1.9.3-p286
 
 Ruby versions will be installed into a directory of the same name
 under `~/.rbenv/versions`.
 
-To see a list of all available Ruby versions, run `rbenv install`
-without any arguments. You may also tab-complete available Ruby
+To see a list of all available Ruby versions, run `rbenv install --list`.
+You may also tab-complete available Ruby
 versions if your rbenv installation is properly configured.
 
 ### Using `ruby-build` standalone
@@ -86,7 +84,7 @@ Run the `ruby-build` command with the exact name of the version you
 want to install and the full path where you want to install it. For
 example,
 
-    $ ruby-build 1.9.3-p194 ~/local/ruby-1.9.3-p194
+    $ ruby-build 1.9.3-p286 ~/local/ruby-1.9.3-p286
 
 To see a list of all available Ruby versions, run `ruby-build
 --definitions`.
@@ -102,7 +100,7 @@ develop and install versions of Ruby that are not yet supported by
 ruby-build.
 
 See the [ruby-build built-in
-definitions](https://github.com/sstephenson/ruby-build/tree/share/ruby-build)
+definitions](https://github.com/sstephenson/ruby-build/tree/master/share/ruby-build)
 as a starting point for custom definition files.
 
 ### Special environment variables
@@ -146,6 +144,44 @@ include the full build log for build failures.
 
 ## Version History
 
+#### 20121104
+* Add a definition for Ruby 2.0.0-preview1
+* Add a definition for Rubinius 2.0.0-rc1
+
+#### 20121022
+* Added a definition for JRuby 1.7.0
+
+#### 20121020
+
+* Added a definition for Ruby 1.9.3-p286
+* Added a definition for JRuby 1.7.0-rc2
+* Added a definition for JRuby 1.7.0-rc1
+* Added a definition for JRuby 1.6.8
+* Added a definition for JRuby 1.5.6
+* Fetch Ruby 2.0.0.dev via Subversion instead of Git
+* Allow hooks to be defined for `rbenv-install`
+
+#### 20120815
+
+* Added a definition for MagLev 1.1.0-dev from git.
+* Added a definition for Ruby 1.8.7-p370. (For those having trouble
+  installing 1.8.7 with newer versions of glibc, please see
+  https://github.com/sstephenson/ruby-build/pull/195#issuecomment-7743664.)
+* Updated the package URL in the definition for JRuby 1.7.0-preview1.
+* Added a definition for JRuby 1.7.0-preview2.
+* Updated the Rubinius 2.0.0-dev definition to use the bundled
+  RubyGems version instead of installing its own.
+* Added an `rbenv uninstall` command for removing installed versions.
+* Improved the option parsing for `ruby-build` and `rbenv-install` so
+  options may be placed in any order, and short options may be
+  combined (e.g. `-kv`).
+* Added a `-l`/`--list` option to `rbenv install` to list all
+  available definitions.
+* Added a `-v`/`--verbose` option to `rbenv install` to invoke
+  `ruby-build` in verbose mode.
+* Documented the `-k`/`--keep` flag in the command-line help for
+  `ruby-build` and `rbenv install`.
+
 #### 20120524
 
 * Added definitions for JRuby 1.6.7.2 and 1.7.0-preview1.
diff --git a/bin/rbenv-install b/bin/rbenv-install
index 35496be..16f6eb4 100755
--- a/bin/rbenv-install
+++ b/bin/rbenv-install
@@ -11,23 +11,59 @@ if [ -z "$RBENV_ROOT" ]; then
   RBENV_ROOT="${HOME}/.rbenv"
 fi
 
-DEFINITION="$1"
-case "$DEFINITION" in
-"" | -* )
-  { echo "usage: rbenv install VERSION"
-    echo "       rbenv install /path/to/definition"
+# Load shared library functions
+eval "$(ruby-build --lib)"
+
+usage() {
+  { echo "usage: rbenv install [-k|--keep] [-v|--verbose] VERSION"
+    echo "       rbenv install [-k|--keep] [-v|--verbose] /path/to/definition"
+    echo "       rbenv install -l|--list"
     echo
-    echo "Available versions:"
-    ruby-build --definitions | sed 's/^/  /'
+    echo "  -l/--list        List all available versions"
+    echo "  -k/--keep        Keep source tree in \$RBENV_BUILD_ROOT after installation"
+    echo "                   (defaults to ${RBENV_ROOT}/sources)"
+    echo "  -v/--verbose     Verbose mode: print compilation status to stdout"
     echo
   } >&2
-  exit 1
-  ;;
-"-k" | "--keep" )
-  [ -z "${RBENV_BUILD_ROOT}" ] && RBENV_BUILD_ROOT="${RBENV_ROOT}/sources"
-  RUBY_BUILD_OPTIONS="${RUBY_BUILD_OPTIONS} -k"
-  ;;
-esac
+
+  [ -z "$1" ] || exit "$1"
+}
+
+unset KEEP
+unset VERBOSE
+
+parse_options "$@"
+for option in "${OPTIONS[@]}"; do
+  case "$option" in
+  "h" | "help" )
+    usage 0
+    ;;
+  "l" | "list" )
+    echo "Available versions:"
+    ruby-build --definitions | sed 's/^/  /'
+    exit
+    ;;
+  "k" | "keep" )
+    [ -n "${RBENV_BUILD_ROOT}" ] || RBENV_BUILD_ROOT="${RBENV_ROOT}/sources"
+    ;;
+  "v" | "verbose" )
+    VERBOSE="-v"
+    ;;
+  "version" )
+    exec ruby-build --version
+    ;;
+  * )
+    usage 1
+    ;;
+  esac
+done
+
+DEFINITION="${ARGUMENTS[0]}"
+[ -n "$DEFINITION" ] || usage 1
+
+for script in $(rbenv-hooks install); do
+  source "$script"
+done
 
 VERSION_NAME="${DEFINITION##*/}"
 PREFIX="${RBENV_ROOT}/versions/${VERSION_NAME}"
@@ -35,8 +71,8 @@ PREFIX="${RBENV_ROOT}/versions/${VERSION_NAME}"
 # If RBENV_BUILD_ROOT is set, then always pass keep options to ruby-build
 if [ -n "${RBENV_BUILD_ROOT}" ]; then
   export RUBY_BUILD_BUILD_PATH="${RBENV_BUILD_ROOT}/${VERSION_NAME}"
-  RUBY_BUILD_OPTIONS="${RUBY_BUILD_OPTIONS} -k"
+  KEEP="-k"
 fi
 
-ruby-build "$DEFINITION" "$PREFIX" "$RUBY_BUILD_OPTIONS"
+ruby-build $KEEP $VERBOSE "$DEFINITION" "$PREFIX"
 rbenv rehash
diff --git a/bin/rbenv-uninstall b/bin/rbenv-uninstall
new file mode 100755
index 0000000..add4615
--- /dev/null
+++ b/bin/rbenv-uninstall
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+set -e
+
+# Provide rbenv completions
+if [ "$1" = "--complete" ]; then
+  exec rbenv versions --bare
+fi
+
+if [ -z "$RBENV_ROOT" ]; then
+  RBENV_ROOT="${HOME}/.rbenv"
+fi
+
+unset FORCE
+if [ "$1" = "-f" ]; then
+  FORCE=true
+  shift
+fi
+
+DEFINITION="$1"
+case "$DEFINITION" in
+"" | -* )
+  { echo "usage: rbenv uninstall [-f] VERSION"
+    echo
+    echo "   -f  Attempt to remove the specified version without prompting"
+    echo "       for confirmation. If the version does not exist, do not"
+    echo "       display an error message."
+    echo
+    echo "Installed versions:"
+    rbenv versions --bare | sed 's/^/  /'
+    echo
+  } >&2
+  exit 1
+  ;;
+esac
+
+VERSION_NAME="${DEFINITION##*/}"
+PREFIX="${RBENV_ROOT}/versions/${VERSION_NAME}"
+
+if [ -z "$FORCE" ]; then
+  if [ ! -d "$PREFIX" ]; then
+    echo "rbenv: version \`$VERSION_NAME' not installed" >&2
+    exit 1
+  fi
+
+  read -p "rbenv: remove $PREFIX? "
+  case "$REPLY" in
+  y* | Y* ) ;;
+  * ) exit 1 ;;
+  esac
+fi
+
+if [ -d "$PREFIX" ]; then
+  rm -rf "$PREFIX"
+  rbenv rehash
+fi
diff --git a/bin/ruby-build b/bin/ruby-build
index 9f897ac..5864e13 100755
--- a/bin/ruby-build
+++ b/bin/ruby-build
@@ -1,10 +1,44 @@
 #!/usr/bin/env bash
 
-RUBY_BUILD_VERSION="20120524"
+RUBY_BUILD_VERSION="20121104"
 
 set -E
 exec 3<&2 # preserve original stderr at fd 3
 
+
+lib() {
+  parse_options() {
+    OPTIONS=()
+    ARGUMENTS=()
+    local arg option index
+
+    for arg in "$@"; do
+      if [ "${arg:0:1}" = "-" ]; then
+        if [ "${arg:1:1}" = "-" ]; then
+          OPTIONS[${#OPTIONS[*]}]="${arg:2}"
+        else
+          index=1
+          while option="${arg:$index:1}"; do
+            [ -n "$option" ] || break
+            OPTIONS[${#OPTIONS[*]}]="$option"
+            index=$(($index+1))
+          done
+        fi
+      else
+        ARGUMENTS[${#ARGUMENTS[*]}]="$arg"
+      fi
+    done
+  }
+
+  if [ "$1" == "--$FUNCNAME" ]; then
+    declare -f "$FUNCNAME"
+    echo "$FUNCNAME \"\$1\";"
+    exit
+  fi
+}
+lib "$1"
+
+
 resolve_link() {
   $(type -p greadlink readlink | head -1) "$1"
 }
@@ -62,6 +96,10 @@ install_git() {
   install_package_using "git" 2 $*
 }
 
+install_svn() {
+  install_package_using "svn" 2 $*
+}
+
 install_package_using() {
   local package_type="$1"
   local package_type_nargs="$2"
@@ -125,6 +163,21 @@ fetch_git() {
   fi
 }
 
+fetch_svn() {
+  local package_name="$1"
+  local svn_url="$2"
+  local svn_rev="$3"
+
+  echo "Checking out ${svn_url}..." >&2
+
+  if type svn &>/dev/null; then
+    svn co -r "$svn_rev" "$svn_url" "${package_name}" >&4 2>&1
+  else
+    echo "error: please install \`svn\` and try again" >&2
+    exit 1
+  fi
+}
+
 build_package() {
   local package_name="$1"
   shift
@@ -332,7 +385,7 @@ version() {
 
 usage() {
   { version
-    echo "usage: ruby-build [-v|--verbose] definition prefix"
+    echo "usage: ruby-build [-k|--keep] [-v|--verbose] definition prefix"
     echo "       ruby-build --definitions"
   } >&2
 
@@ -351,34 +404,41 @@ list_definitions() {
 
 
 unset VERBOSE
+unset KEEP_BUILD_PATH
 RUBY_BUILD_ROOT="$(abs_dirname "$0")/.."
 
-case "$1" in
-"-h" | "--help" )
-  usage without_exiting
-  { echo
-    echo "  -v/--verbose     Verbose mode: print compilation status to stdout"
-    echo "  --definitions    List all built-in definitions"
-    echo
-  } >&2
-  exit 0
-  ;;
-"--definitions" )
-  list_definitions
-  exit 0
-  ;;
-"--version" )
-  version
-  exit 0
-  ;;
-"-v" | "--verbose" )
-  VERBOSE=true
-  shift
-  ;;
-esac
+parse_options "$@"
 
+for option in "${OPTIONS[@]}"; do
+  case "$option" in
+  "h" | "help" )
+    usage without_exiting
+    { echo
+      echo "  -k/--keep        Do not remove source tree after installation"
+      echo "  -v/--verbose     Verbose mode: print compilation status to stdout"
+      echo "  --definitions    List all built-in definitions"
+      echo
+    } >&2
+    exit 0
+    ;;
+  "definitions" )
+    list_definitions
+    exit 0
+    ;;
+  "k" | "keep" )
+    KEEP_BUILD_PATH=true
+    ;;
+  "v" | "verbose" )
+    VERBOSE=true
+    ;;
+  "version" )
+    version
+    exit 0
+    ;;
+  esac
+done
 
-DEFINITION_PATH="$1"
+DEFINITION_PATH="${ARGUMENTS[0]}"
 if [ -z "$DEFINITION_PATH" ]; then
   usage
 elif [ ! -e "$DEFINITION_PATH" ]; then
@@ -391,20 +451,11 @@ elif [ ! -e "$DEFINITION_PATH" ]; then
   fi
 fi
 
-PREFIX_PATH="$2"
+PREFIX_PATH="${ARGUMENTS[1]}"
 if [ -z "$PREFIX_PATH" ]; then
   usage
 fi
 
-OPTIONS="$3"
-for option in $OPTIONS; do
-  case "$option" in
-    "-k" | "--keep" )
-      KEEP_BUILD_PATH="y"
-      ;;
-  esac
-done
-
 if [ -z "$TMPDIR" ]; then
   TMP="/tmp"
 else
diff --git a/share/ruby-build/1.8.7-p334 b/share/ruby-build/1.8.7-p370
similarity index 54%
copy from share/ruby-build/1.8.7-p334
copy to share/ruby-build/1.8.7-p370
index bc3d70e..d8935cf 100644
--- a/share/ruby-build/1.8.7-p334
+++ b/share/ruby-build/1.8.7-p370
@@ -1,3 +1,3 @@
 require_gcc
-install_package "ruby-1.8.7-p334" "http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p334.tar.gz"
+install_package "ruby-1.8.7-p370" "http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p370.tar.gz"
 install_package "rubygems-1.6.2" "http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz" ruby
diff --git a/share/ruby-build/1.9.3-dev b/share/ruby-build/1.9.3-dev
index 64f4fe0..7695769 100644
--- a/share/ruby-build/1.9.3-dev
+++ b/share/ruby-build/1.9.3-dev
@@ -1,2 +1,2 @@
 install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
-install_git "ruby-1.9.3-dev" "https://github.com/ruby/ruby.git" "ruby_1_9_3" autoconf standard
+install_svn "ruby-1.9.3-dev" "http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_3" "HEAD" autoconf standard
diff --git a/share/ruby-build/1.9.3-p286 b/share/ruby-build/1.9.3-p286
new file mode 100644
index 0000000..602fcd8
--- /dev/null
+++ b/share/ruby-build/1.9.3-p286
@@ -0,0 +1,2 @@
+install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
+install_package "ruby-1.9.3-p286" "http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p286.tar.gz"
diff --git a/share/ruby-build/2.0.0-dev b/share/ruby-build/2.0.0-dev
index 2695eec..163a2c2 100644
--- a/share/ruby-build/2.0.0-dev
+++ b/share/ruby-build/2.0.0-dev
@@ -1,2 +1,2 @@
 install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
-install_git "ruby-2.0.0-dev" "https://github.com/ruby/ruby.git" "trunk" autoconf standard
+install_svn "ruby-2.0.0-dev" "http://svn.ruby-lang.org/repos/ruby/trunk" "HEAD" autoconf standard
diff --git a/share/ruby-build/2.0.0-preview1 b/share/ruby-build/2.0.0-preview1
new file mode 100644
index 0000000..e0f55e6
--- /dev/null
+++ b/share/ruby-build/2.0.0-preview1
@@ -0,0 +1,2 @@
+install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
+install_package "ruby-2.0.0-preview1" "http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-preview1.tar.gz"
diff --git a/share/ruby-build/jruby-1.5.6 b/share/ruby-build/jruby-1.5.6
new file mode 100644
index 0000000..7282973
--- /dev/null
+++ b/share/ruby-build/jruby-1.5.6
@@ -0,0 +1 @@
+install_package "jruby-1.5.6" "http://jruby.org.s3.amazonaws.com/downloads/1.5.6/jruby-bin-1.5.6.tar.gz" jruby
diff --git a/share/ruby-build/jruby-1.6.8 b/share/ruby-build/jruby-1.6.8
new file mode 100644
index 0000000..a54e76f
--- /dev/null
+++ b/share/ruby-build/jruby-1.6.8
@@ -0,0 +1 @@
+install_package "jruby-1.6.8" "http://jruby.org.s3.amazonaws.com/downloads/1.6.8/jruby-bin-1.6.8.tar.gz" jruby
diff --git a/share/ruby-build/jruby-1.7.0 b/share/ruby-build/jruby-1.7.0
new file mode 100644
index 0000000..8749357
--- /dev/null
+++ b/share/ruby-build/jruby-1.7.0
@@ -0,0 +1 @@
+install_package "jruby-1.7.0" "http://jruby.org.s3.amazonaws.com/downloads/1.7.0/jruby-bin-1.7.0.tar.gz" jruby
diff --git a/share/ruby-build/jruby-1.7.0-preview1 b/share/ruby-build/jruby-1.7.0-preview1
index 403b76b..3452164 100644
--- a/share/ruby-build/jruby-1.7.0-preview1
+++ b/share/ruby-build/jruby-1.7.0-preview1
@@ -1 +1 @@
-install_package "jruby-1.7.0.preview1" "http://ci.jruby.org/snapshots/1.7.x/jruby-bin-1.7.0.preview1.tar.gz" jruby
+install_package "jruby-1.7.0.preview1" "http://jruby.org.s3.amazonaws.com/downloads/1.7.0.preview1/jruby-bin-1.7.0.preview1.tar.gz" jruby
diff --git a/share/ruby-build/jruby-1.7.0-preview2 b/share/ruby-build/jruby-1.7.0-preview2
new file mode 100644
index 0000000..6a8c813
--- /dev/null
+++ b/share/ruby-build/jruby-1.7.0-preview2
@@ -0,0 +1 @@
+install_package "jruby-1.7.0.preview2" "http://jruby.org.s3.amazonaws.com/downloads/1.7.0.preview2/jruby-bin-1.7.0.preview2.tar.gz" jruby
diff --git a/share/ruby-build/jruby-1.7.0-rc1 b/share/ruby-build/jruby-1.7.0-rc1
new file mode 100644
index 0000000..c642a3e
--- /dev/null
+++ b/share/ruby-build/jruby-1.7.0-rc1
@@ -0,0 +1 @@
+install_package "jruby-1.7.0.RC1" "http://jruby.org.s3.amazonaws.com/downloads/1.7.0.RC1/jruby-bin-1.7.0.RC1.tar.gz" jruby
diff --git a/share/ruby-build/jruby-1.7.0-rc2 b/share/ruby-build/jruby-1.7.0-rc2
new file mode 100644
index 0000000..a998885
--- /dev/null
+++ b/share/ruby-build/jruby-1.7.0-rc2
@@ -0,0 +1 @@
+install_package "jruby-1.7.0.RC2" "http://jruby.org.s3.amazonaws.com/downloads/1.7.0.RC2/jruby-bin-1.7.0.RC2.tar.gz" jruby
diff --git a/share/ruby-build/maglev-1.1.0-dev b/share/ruby-build/maglev-1.1.0-dev
new file mode 100644
index 0000000..dfee158
--- /dev/null
+++ b/share/ruby-build/maglev-1.1.0-dev
@@ -0,0 +1 @@
+install_git "maglev-1.1.0-dev" "https://github.com/MagLev/maglev.git" "master" maglev
diff --git a/share/ruby-build/rbx-2.0.0-dev b/share/ruby-build/rbx-2.0.0-dev
index 2f894f4..6b3b07a 100644
--- a/share/ruby-build/rbx-2.0.0-dev
+++ b/share/ruby-build/rbx-2.0.0-dev
@@ -1,2 +1 @@
 install_git "rubinius-2.0.0-dev" "https://github.com/rubinius/rubinius.git" "master" rbx
-install_package "rubygems-1.8.23" "http://production.cf.rubygems.org/rubygems/rubygems-1.8.23.tgz" ruby
diff --git a/share/ruby-build/rbx-2.0.0-rc1 b/share/ruby-build/rbx-2.0.0-rc1
new file mode 100644
index 0000000..e5528b4
--- /dev/null
+++ b/share/ruby-build/rbx-2.0.0-rc1
@@ -0,0 +1,2 @@
+install_package "yaml-0.1.4" "http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz"
+install_package "rubinius-release-2.0.0-rc1" "https://nodeload.github.com/rubinius/rubinius/tar.gz/release-2.0.0-rc1" rbx

-- 
ruby-build.git



More information about the Pkg-ruby-extras-commits mailing list