scripts/ruby-installer in rvm-0.0.51 vs scripts/ruby-installer in rvm-0.0.52
- old
+ new
@@ -12,11 +12,11 @@
rm -rf $rvm_ruby_src_path
fi
result=0
if [ -z "$rvm_ruby_tag" -a -z "$rvm_ruby_rev" ] ; then
- if [ ! -d $rvm_ruby_src_path ] ; then
+ if [ ! -f $rvm_archives_path/$rvm_ruby_package_name.tar.gz ] ; then
rvm_url="${rvm_url:-"ftp://ftp.ruby-lang.org/pub/ruby/1.$rvm_major_version/$rvm_ruby_package_name.tar.gz"}"
__rvm_run "fetch" "__rvm_fetch $rvm_url" "Downloading $rvm_ruby_package_name, this may take a while depending on your connection..."
if [ $? -gt 0 ] ; then result=$? ; return $result ; fi
mkdir -p $rvm_ruby_src_path # Is this line necessary considering -C below? v
__rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_name.tar.gz -C $rvm_source_path" "Extracting $rvm_ruby_package_name ..."
@@ -192,17 +192,21 @@
rvm_ruby_make="rake"
rvm_ruby_make_install="rake install"
rvm_ruby_home="$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"
#rvm_ruby_rev="head"
+ # For Installer, can do this once it's ready:
+ RBX_PREFIX=$rvm_ruby_home ; export RBX_PREFIX
+ # Also see 'rakelib/configuration.rake'
+
if [ ! -d $rvm_ruby_home -o ! -d $rvm_ruby_home/.git ] ; then
rm -rf $rvm_ruby_home
- git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_home
+ __rvm_run "rbx.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_home" "Cloning $rvm_ruby_repo_url"
cd $rvm_ruby_home
else
cd $rvm_ruby_home
- git pull origin master
+ __rvm_run "rbx.repo" "git pull origin master" "Pulling from origin master"
fi
# prereqs, 1.8.6 w/ParseTree & rake. Yes this could all be one line... not pushing our luck.
echo `export rvm_install_on_use_flag=1 ; rvm 1.8.6` # This should install if missing.
echo `rvm 1.8.6 -m rbx ; gem install --no-rdoc --no-ri rake ParseTree` # This should install if missing.
@@ -212,37 +216,49 @@
__rvm_run "build" "\`rvm 1.8.6 -m rbx ; RBX_LLVM=1 rake build\`" "Building rbx with RBX_LLVM=1"
else
__rvm_run "build" "\`rvm 1.8.6 -m rbx ; rake build\`" "Building rbx"
fi
- binaries="ruby irb"
- for binary in $(echo $binaries) ; do
- ln -fs $rvm_ruby_home/bin/rbx $rvm_ruby_home/bin/$binary
- done ; unset binary binaries
+ binaries="ruby irb" # Trick to work in more shells :)
+ for binary_name in $(echo $binaries) ; do
+ ln -fs $rvm_ruby_home/bin/rbx $rvm_ruby_home/bin/$binary_name
+ done ; unset binary_name binaries
- $rvm_ruby_home/bin/rbx -S gem install rake --no-rdoc --no-ri
+ __rvm_run "rake.install" "$rvm_ruby_home/bin/rbx gem install rake --no-rdoc --no-ri" "Installing Rake"
+ binary=rake
+ if [ -f $rvm_gem_home/bin/$binary ] ; then
+ if [ "$rvm_gem_home" != "$rvm_ruby_home" ] ; then
+ cp $rvm_gem_home/bin/$binary $rvm_ruby_home/bin/$binary
+ fi
+ chmod +x $rvm_ruby_home/bin/$binary
+ __rvm_inject_ruby_shebang "$rvm_ruby_home/bin/$binary"
+ __rvm_inject_gem_env "$rvm_ruby_home/bin/$binary"
+ fi ; unset binary
binaries="erb ri rdoc"
__rvm_post_install
- for binary_name in gem rake ; do
+ binaries="gem" # Trick to work in more shells :)
+ for binary_name in $(echo $binaries); do
+ if [ $binary_name != "gem" ] ; then prefix="-S" ; fi
ruby_wrapper=$(cat <<RubyWrapper
#!/bin/bash
GEM_HOME="$rvm_gem_home" ; export GEM_HOME
GEM_PATH="$rvm_gem_home" ; export GEM_PATH
MY_RUBY_HOME="$rvm_ruby_home" ; export MY_RUBY_HOME
PATH="$rvm_ruby_home/bin:$rvm_gem_home/bin:\$PATH" ; export PATH
-exec $rvm_ruby_home/bin/rbx -S $binary_name "\$@"
+exec $rvm_ruby_home/bin/rbx $prefix $binary_name "\$@"
RubyWrapper
)
- for file_name in $rvm_path/bin/$binary-$rvm_ruby_package_name $rvm_ruby_home/bin/$binary ; do
+ files="$rvm_ruby_home/bin/$binary_name $rvm_path/bin/$binary_name-$rvm_ruby_package_name"
+ for file_name in $(echo $files) ; do
rm -f $file_name
echo "$ruby_wrapper" > $file_name
if [ -f $file_name ] ; then chmod +x $file_name ; fi
done ; unset file_name
- unset ruby_wrapper binary_name
+ unset ruby_wrapper binary_name files prefix
done
__rvm_irbrc
__rvm_bin_scripts
;;