scripts/ruby-installer in rvm-0.0.80 vs scripts/ruby-installer in rvm-0.0.81
- old
+ new
@@ -1,10 +1,10 @@
#!/usr/bin/env bash
__rvm_install_source() {
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
- __rvm_log "info" "Installing Ruby from source to: $rvm_ruby_home"
+ $rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home"
mkdir -p "$rvm_ruby_log_path"
__rvm_pushpop "$rvm_src_path"
if [[ ! -z "$rvm_force_flag" ]] ; then
@@ -14,23 +14,23 @@
result=0
# TODO: This really should be about the url instead of this hokey logic.
if [[ -z "$rvm_head_flag" ]] && [[ -z "$rvm_ruby_tag" ]] && [[ -z "$rvm_ruby_revision" ]] ; 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_log "info" "Downloading $rvm_ruby_package_name, this may take a while depending on your connection..."
- __rvm_fetch "$rvm_url"
- if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
+ $rvm_scripts_path/log "info" "Downloading $rvm_ruby_package_name, this may take a while depending on your connection..."
+ $rvm_scripts_path/fetch "$rvm_url"
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
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_src_path" "Extracting $rvm_ruby_package_name ..."
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
else
if [[ ! -z "$(echo $rvm_url | awk '/^git/')" ]] ; then
if [[ -d "$rvm_ruby_src_path/.git" ]] ; then
- cd $rvm_ruby_src_path
+ builtin builtin cd $rvm_ruby_src_path
if [[ -z "$rvm_ruby_revision" ]] ; then
- __rvm_log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
+ $rvm_scripts_path/log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
git pull origin master
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
else
if [[ -z "$rvm_ruby_sha" ]] ; then
git checkout HEAD
@@ -38,11 +38,11 @@
git checkout $(echo $rvm_ruby_sha | sed 's#^s##')
fi
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
fi
else
- __rvm_log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
+ $rvm_scripts_path/log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
fi
else
if [[ ! -z "$rvm_head_flag" ]] || [[ "trunk" = "$rvm_ruby_revision" ]] ; then
@@ -56,57 +56,57 @@
rvm_url=$rvm_ruby_repo_url/branches/ruby_1_${rvm_major_version}_${rvm_minor_version}
rvm_rev="-$rvm_ruby_revision"
fi
if [[ -d "$rvm_ruby_src_path/.svn" ]] ; then
- cd $rvm_ruby_src_path
- __rvm_log "info" "Updating ruby from $rvm_url"
+ builtin cd $rvm_ruby_src_path
+ $rvm_scripts_path/log "info" "Updating ruby from $rvm_url"
__rvm_run "svn.update" "svn update"
if [[ ! -z "$rvm_rev" ]] ; then
- __rvm_log "info" "Checking out revision ${rvm_rev/-r/-r } from $rvm_url"
+ $rvm_scripts_path/log "info" "Checking out revision ${rvm_rev/-r/-r } from $rvm_url"
__rvm_run "svn.checkout" "svn update -q ${rvm_rev/-r/-r }"
fi
else
rm -rf $rvm_ruby_src_path
__rvm_run "svn.checkout" "svn checkout -q ${rvm_rev/-r/-r } $rvm_url $rvm_ruby_src_path"
fi
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
fi
fi
- cd $rvm_ruby_src_path
- if [[ $? -gt 0 ]] ; then result=$? ; __rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; __rvm_pushpop ; return $result ; fi
+ builtin builtin cd $rvm_ruby_src_path
+ if [[ $? -gt 0 ]] ; then result=$? ; $rvm_scripts_path/log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; __rvm_pushpop ; return $result ; fi
if [[ -z "$rvm_ruby_configure" ]] && [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
rvm_autoconf="$(which autoconf)"
- if [[ $? -gt 0 ]] ; then __rvm_log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
+ if [[ $? -gt 0 ]] ; then $rvm_scripts_path/log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
__rvm_run "autoconf" "$rvm_autoconf" "Running autoconf"
# if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi # Don't barf on autoconf fail...
fi
if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
- __rvm_log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
+ (($rvm_debug_flag)) && $rvm_scripts_path/log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
elif [[ ! -z "$rvm_ruby_configure" ]] ; then
__rvm_run "configure" "$rvm_ruby_configure"
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
elif [[ -s ./configure ]] ; then
__rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags $configure_parameters" "Configuring $rvm_ruby_package_name, this may take a while depending on your cpu(s)..."
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
unset configure_parameters
else
- __rvm_log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
+ $rvm_scripts_path/log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
fi
rvm_ruby_make=${rvm_ruby_make:-"/usr/bin/make"}
__rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
rvm_ruby_make_install=${rvm_ruby_make_install:-"/usr/bin/make install"}
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_package_name"
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
- __rvm_log "info" "Installation of $rvm_ruby_package_name is complete."
+ $rvm_scripts_path/log "info" "Installation of $rvm_ruby_package_name is complete."
GEM_HOME="$rvm_ruby_gem_home" ; export GEM_HOME
GEM_PATH="$rvm_ruby_gem_home" ; export GEM_PATH
__rvm_rubygems_setup
@@ -129,19 +129,20 @@
macruby_path="/usr/local/bin"
# TODO: configure & make variables should be set here.
rvm_ruby_configure=" true "
rvm_ruby_make="rake"
rvm_ruby_make_install="sudo rake install"
- rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_repo_url")"
+ rvm_url="$($rvm_scripts_path/db "$rvm_config_path/db" "${rvm_ruby_interpreter}_repo_url")"
rvm_ruby_repo_url=$rvm_url
__rvm_install_source $*
else # if [[ "nightly" = "$rvm_ruby_version" ]] ; then
macruby_path="/usr/local/bin"
# TODO: Separated nightly from head.
- rvm_url="$(__rvm_db "macruby_nightly_url")"
- __rvm_log "info" "Retrieving the latest nightly macruby build..."
- __rvm_fetch "$rvm_url"
+ rvm_url="$($rvm_scripts_path/db "$rvm_config_path/db" "macruby_nightly_url")"
+ $rvm_scripts_path/log "info" "Retrieving the latest nightly macruby build..."
+ $rvm_scripts_path/fetch "$rvm_url"
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
mv "$rvm_archives_path/macruby_nightly-latest.pkg" "$rvm_archives_path/macruby_nightly.pkg"
__rvm_run "macruby/extract" "sudo installer -pkg '$rvm_path/archives/macruby_nightly.pkg' -target '/'"
mkdir -p "$rvm_ruby_home/bin"
fi
@@ -167,31 +168,31 @@
done
unset file_name ruby_wrapper binary_name files prefix
done
__rvm_irbrc
else
- __rvm_log "fail" "MacRuby can only be installed on a Darwin OS."
+ $rvm_scripts_path/log "fail" "MacRuby can only be installed on a Darwin OS."
fi
;;
ree)
if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1\.8/')" ]] && [[ -z "$rvm_head_flag" ]] ; then
- rvm_url="$(__rvm_db "ree_${rvm_ruby_version}_url")/$rvm_ruby_package_file.tar.gz"
- __rvm_log "info" "Installing Ruby Enterprise Edition from source to: $rvm_ruby_home"
+ rvm_url="$($rvm_scripts_path/db "$rvm_config_path/db" "ree_${rvm_ruby_version}_url")/$rvm_ruby_package_file.tar.gz"
+ $rvm_scripts_path/log "info" "Installing Ruby Enterprise Edition from source to: $rvm_ruby_home"
__rvm_pushpop "$rvm_src_path"
if [[ -z "$rvm_force_flag" ]] && [[ -d "$rvm_ruby_src_path" ]] && [[ ! -x "$rvm_ruby_src_path/installer" ]] ; then
- __rvm_log "It appears that the archive has already been extracted. Skipping extract (use --force to force re-download and extract)."
+ $rvm_scripts_path/log "It appears that the archive has already been extracted. Skipping extract (use --force to force re-download and extract)."
else
- __rvm_log "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..."
- __rvm_fetch "$rvm_url"
- if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
+ $rvm_scripts_path/log "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..."
+ $rvm_scripts_path/fetch "$rvm_url"
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
rm -rf "$rvm_ruby_src_path"
__rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_file..."
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
mv "$rvm_src_path/$rvm_ruby_package_file" "$rvm_ruby_src_path"
fi
- cd "$rvm_ruby_src_path"
+ builtin cd "$rvm_ruby_src_path"
mkdir -p "$rvm_ruby_log_path"
mkdir -p "${rvm_ruby_home}/lib/ruby/gems/1.8/gems"
if [[ ! -z "$rvm_ruby_configure_flags" ]] ; then
rvm_ruby_configure_flags="$(echo $rvm_ruby_configure_flags | sed 's#--#-c --#g')"
@@ -216,24 +217,24 @@
__rvm_irbrc
__rvm_bin_scripts
__rvm_post_install
__rvm_pushpop
else
- rvm_url="$(__rvm_db "ree_${rvm_ruby_version}_repo_url")"
+ rvm_url="$($rvm_scripts_path/db "$rvm_config_path/db" "ree_${rvm_ruby_version}_repo_url")"
if [[ -z "$rvm_url" ]] ; then
- __rvm_log "fail" "rvm does not know the rvm repo url for 'ree_${rvm_ruby_version}'"
+ $rvm_scripts_path/log "fail" "rvm does not know the rvm repo url for 'ree_${rvm_ruby_version}'"
result=1
else
rvm_ruby_repo_url=$rvm_url
__rvm_make_flags
__rvm_install_source $*
fi
fi
;;
rbx|rubinius)
- __rvm_log "info" "Installing pre-requisites"
+ $rvm_scripts_path/log "info" "Installing pre-requisites"
# prereqs, 1.8.6+ + rake. Yes this could all be one line... not pushing our luck.
echo "$(export rvm_install_on_use_flag=1 ; rvm 1.8.7)" # This should install if missing.
# TODO: use 'rvm gems load' here:
unset CFLAGS LDFLAGS ARCHFLAGS # Important.
__rvm_unset_ruby_variables ; rvm_ruby_string="rbx-head" ; __rvm_select
@@ -244,15 +245,15 @@
rvm_ruby_repo_url="$rvm_rubinius_repo_url"
rvm_ruby_home="$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version"
if [[ ! -d "$rvm_ruby_home" ]] || [[ ! -d "$rvm_ruby_home/.git" ]] ; then
- rm -rf "$rvm_ruby_home" ; cd "$rvm_home"
+ rm -rf "$rvm_ruby_home" ; builtin cd "$rvm_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"
+ builtin cd "$rvm_ruby_home"
else
- cd "$rvm_ruby_home"
+ builtin cd "$rvm_ruby_home"
__rvm_run "rbx.repo" "git pull origin master" "Pulling from origin master"
fi
#if [[ ! -x "$rvm_ruby_distclean" ]] ; then
# __rvm_run "rake.distclean" "\$(rvm 1.8.7 ; rake distclean --trace)" "Running distclean."
@@ -260,11 +261,11 @@
# For Installer, can do this once it's ready:
# RBX_PREFIX="$rvm_ruby_home" ; export RBX_PREFIX
# Also see 'rakelib/configuration.rake'
- cd "$rvm_ruby_home"
+ builtin cd "$rvm_ruby_home"
# TODO: Once installer is done add the prefix:
#rvm_ruby_configure="./configure --prefix=$rvm_ruby_home" ; message="Configuring rbx"
rvm_ruby_configure="./configure" ; message="Configuring rbx"
if [[ ! -z "$rvm_jit_flag" ]] ; then
rvm_ruby_configure="$rvm_ruby_configure --enable-llvm" ; message="$message with LLVM enabled"
@@ -332,13 +333,13 @@
mkdir -p "$rvm_ruby_log_path" "$rvm_ruby_src_path"
__rvm_pushpop $rvm_src_path
if [[ "$rvm_head_flag" -eq 1 ]] || [[ ! -z "$rvm_ruby_revision" ]] ; then
if [[ -d "$rvm_ruby_src_path/.git" ]] ; then
- cd "$rvm_ruby_src_path"
+ builtin cd "$rvm_ruby_src_path"
if [[ -z "$rvm_ruby_revision" ]] ; then
- __rvm_log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
+ $rvm_scripts_path/log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
git pull origin master
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
else
if [[ -z "$rvm_ruby_sha" ]] ; then
git checkout HEAD
@@ -347,33 +348,34 @@
fi
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
fi
else
rm -rf "$rvm_ruby_src_path"
- __rvm_log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
+ $rvm_scripts_path/log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
git clone --depth 1 "$rvm_ruby_repo_url" "$rvm_ruby_src_path"
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
fi
- cd "$rvm_ruby_src_path"
+ builtin cd "$rvm_ruby_src_path"
ant dist
else
if [[ -z "$rvm_force_flag" ]] && [[ -f $rvm_package_file ]] && [[ -s $rvm_package_file ]] ; then
- __rvm_log "info" "It appears that $rvm_package_file has already been downloaded, skipping. Use --force to force re-download."
+ $rvm_scripts_path/log "info" "It appears that $rvm_package_file has already been downloaded, skipping. Use --force to force re-download."
else
- __rvm_log "info" "Downloading $rvm_package_file, this may take a while depending on your connection..."
- __rvm_fetch "$rvm_url"
+ $rvm_scripts_path/log "info" "Downloading $rvm_package_file, this may take a while depending on your connection..."
+ $rvm_scripts_path/fetch "$rvm_url"
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
fi
__rvm_run "extract" "tar zxf $rvm_archives_path/$rvm_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_package_file..."
if [[ "$rvm_package_file" != "$rvm_ruby_string" ]] ; then
mv "$rvm_src_path/$rvm_package_file" "$rvm_src_path/$rvm_ruby_string"
fi
- cd "$rvm_ruby_src_path"
+ builtin cd "$rvm_ruby_src_path"
fi
mkdir -p "$rvm_ruby_home/bin/"
- cd "$rvm_ruby_src_path/tool/nailgun" && /usr/bin/make $rvm_make_flags
+ builtin cd "$rvm_ruby_src_path/tool/nailgun" && /usr/bin/make $rvm_make_flags
__rvm_pushpop
if [[ -z "$rvm_ruby_home" ]] || [[ "$rvm_ruby_home" = "/" ]] ; then echo "WTH?!?! rvm_ruby_home == / ??? not removing." ; return 1000000 ; fi
rm -rf $rvm_ruby_home
@@ -417,44 +419,44 @@
# rvm_ruby_revision="head"
if [[ ! -d "$rvm_ruby_src_path" ]] || [[ ! -d "$rvm_ruby_src_path/.git" ]] ; then
rm -rf $rvm_ruby_src_path
__rvm_run "mput.repo" "git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path" "Cloning $rvm_ruby_repo_url"
- cd $rvm_ruby_home
+ builtin cd $rvm_ruby_home
else
- cd $rvm_ruby_home
+ builtin cd $rvm_ruby_home
__rvm_run "mput.repo" "git pull origin trunk" "Pulling from origin trunk"
fi
if [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then
rvm_autoconf="$(which autoconf)"
- if [[ $? -gt 0 ]] ; then __rvm_log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
+ if [[ $? -gt 0 ]] ; then $rvm_scripts_path/log "fail" "rvm expects autoconf" ; result=$? ; return $result ; fi
__rvm_run "autoconf" "$rvm_autoconf" "Running autoconf"
# if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi # Don't barf on autoconf fail...
fi
if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
- __rvm_log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
+ (($rvm_debug_flag)) && $rvm_scripts_path/log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
elif [[ ! -z "rvm_ruby_configure" ]] ; then
$rvm_ruby_configure
elif [[ -s ./configure ]] ; then
__rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags $configure_parameters" "Configuring $rvm_ruby_package_name using $rvm_ruby_configure_flags, this may take a while depending on your cpu(s)..."
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
unset configure_parameters
else
- __rvm_log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
+ $rvm_scripts_path/log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
fi
rvm_ruby_make=${rvm_ruby_make:-"/usr/bin/make"}
__rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_package_name, this may take a while, depending on your cpu(s)..."
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
rvm_ruby_make_install=${rvm_ruby_make_install:-"/usr/bin/make install"}
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_package_name"
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
- __rvm_log "info" "Installation of $rvm_ruby_package_name is complete."
+ $rvm_scripts_path/log "info" "Installation of $rvm_ruby_package_name is complete."
GEM_HOME="$rvm_ruby_gem_home" ; export GEM_HOME
GEM_PATH="$rvm_ruby_gem_home" ; export GEM_PATH
__rvm_rubygems_setup
@@ -468,14 +470,14 @@
__rvm_make_flags
__rvm_install_source $*
;;
default)
- __rvm_log "fail" "must specify a ruby interpreter to install."
+ $rvm_scripts_path/log "fail" "must specify a ruby interpreter to install."
;;
- *) __rvm_log "fail" "Ruby interpreter '$rvm_ruby_interpreter' is not known."
+ *) $rvm_scripts_path/log "fail" "Ruby interpreter '$rvm_ruby_interpreter' is not known."
esac
if [[ ! -z "$ruby_options" ]] ; then RUBYOPT=$ruby_options ; export RUBYOPT ; fi
}
@@ -507,11 +509,11 @@
eval "__rvm_${rvm_action}_ruby"
__rvm_unset_ruby_variables
fi
done < <(\ls $rvm_path/*/bin/ruby 2> /dev/null)
else
- __rvm_log "warn" 'Really? Install all? See "rvm list --all" and limit the selection to something more sane please :)'
+ $rvm_scripts_path/log "warn" 'Really? Install all? See "rvm list --all" and limit the selection to something more sane please :)'
fi
fi
__rvm_state
if [[ ! -z "$rvm_summary_flag" ]] ; then __rvm_summary ; fi
@@ -523,42 +525,42 @@
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
if [[ ! -z "$rvm_ruby_package_name" ]] ; then
for dir in $rvm_path ; do
if [[ -d $dir/$rvm_ruby_package_name ]] ; then
- __rvm_log "info" "Removing $dir/$rvm_ruby_package_name..."
+ $rvm_scripts_path/log "info" "Removing $dir/$rvm_ruby_package_name..."
rm -rf $dir/$rvm_ruby_package_name
else
- __rvm_log "info" "$dir/$rvm_ruby_package_name has already been removed."
+ $rvm_scripts_path/log "info" "$dir/$rvm_ruby_package_name has already been removed."
fi
if [[ -e $rvm_bin_path/$rvm_ruby_package_name ]] ; then
rm -f $rvm_bin_path/$rvm_ruby_package_name
fi
done ; unset dir
rm -rf $rvm_gem_path/$rvm_ruby_interpreter/$rvm_ruby_version*/
else
- __rvm_log "fail" "Cannot uninstall unknown package '$rvm_ruby_package_name'"
+ $rvm_scripts_path/log "fail" "Cannot uninstall unknown package '$rvm_ruby_package_name'"
fi
}
__rvm_remove_ruby() {
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
if [[ ! -z "$rvm_ruby_string" ]] ; then
for dir in $rvm_src_path $rvm_path ; do
if [[ -d $dir/$rvm_ruby_string ]] ; then
- __rvm_log "info" "Removing $dir/$rvm_ruby_string..."
+ $rvm_scripts_path/log "info" "Removing $dir/$rvm_ruby_string..."
rm -rf $dir/$rvm_ruby_package_name
else
- __rvm_log "info" "it seems that $dir/$rvm_ruby_string is already non existent."
+ $rvm_scripts_path/log "info" "it seems that $dir/$rvm_ruby_string is already non existent."
fi
if [[ -e $rvm_bin_path/$rvm_ruby_string ]] ; then
rm -f $rvm_bin_path/$rvm_ruby_string
fi
done ; unset dir
else
- __rvm_log "fail" "Cannot uninstall unknown package '$rvm_ruby_package_name'"
+ $rvm_scripts_path/log "fail" "Cannot uninstall unknown package '$rvm_ruby_package_name'"
fi
}
__rvm_post_install() {
binaries="${binaries:-"gem irb erb ri rdoc testrb rake"}"
@@ -573,17 +575,17 @@
__rvm_inject_ruby_shebang "$rvm_ruby_home/bin/$binary"
chmod +x "$rvm_ruby_home/bin/$binary"
fi
done ; unset binary binaries
- __rvm_log "info" "Installing gems for $rvm_ruby_package_name."
+ $rvm_scripts_path/log "info" "Installing gems for $rvm_ruby_package_name."
for rvm_gem_name in rake ; do
__rvm_run "gems.install" "$rvm_ruby_home/bin/gem install $rvm_gem_name --no-rdoc --no-ri -q" "Installing $rvm_gem_name"
done ; unset rvm_gem_name
- __rvm_log "info" "Installation of gems for $rvm_ruby_package_name is complete."
+ $rvm_scripts_path/log "info" "Installation of gems for $rvm_ruby_package_name is complete."
binary=rake
if [[ -x $rvm_ruby_gem_home/bin/$binary ]] ; then
if [[ "$rvm_ruby_gem_home" != "$rvm_ruby_home" ]] ; then
cp $rvm_ruby_gem_home/bin/$binary $rvm_ruby_home/bin/$binary
@@ -602,31 +604,32 @@
__rvm_run "rubygems.update" "$rvm_ruby_home/bin/gem update --system" "Updating rubygems for $rvm_ruby_string"
__rvm_inject_ruby_shebang "$rvm_ruby_home/bin/gem"
__rvm_inject_gem_env "$rvm_ruby_home/bin/gem"
elif [[ ! -z "$(echo $rvm_ruby_interpreter | awk '/^rbx|jruby/')" ]] ; then
- __rvm_log "debug" "Skipping rubygems update for $rvm_ruby_version"
+ (($rvm_debug_flag)) && $rvm_scripts_path/log "debug" "Skipping rubygems update for $rvm_ruby_version"
else
- __rvm_log "info" "Installing rubygems dedicated to $rvm_ruby_package_name..."
+ $rvm_scripts_path/log "info" "Installing rubygems dedicated to $rvm_ruby_package_name..."
rvm_gem_package_name="rubygems-1.3.5"
rvm_gem_url="http://rubyforge.org/frs/download.php/60718/$rvm_gem_package_name.tgz"
# Sanity check...
if [[ ! -f "$rvm_src_path/$rvm_gem_package_name/setup.rb" ]]; then rm -rf "$rvm_src_path/$rvm_gem_package_name" ; fi
if [[ ! -d "$rvm_src_path/$rvm_gem_package_name" ]] ; then
- __rvm_log "info" "Retrieving $rvm_gem_package_name"
- __rvm_fetch "$rvm_gem_url"
+ $rvm_scripts_path/log "info" "Retrieving $rvm_gem_package_name"
+ $rvm_scripts_path/fetch "$rvm_gem_url"
+ result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
mkdir -p "$rvm_src_path/$rvm_gem_package_name"
__rvm_run "rubygems.extract" "tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_src_path" "Extracting $rvm_gem_package_name"
fi
- cd "$rvm_src_path/$rvm_gem_package_name"
+ builtin cd "$rvm_src_path/$rvm_gem_package_name"
__rvm_run "rubygems.install" "GEM_PATH=$rvm_gem_path GEM_HOME=$rvm_ruby_gem_home $rvm_ruby_home/bin/ruby $rvm_src_path/$rvm_gem_package_name/setup.rb" "Installing rubygems for $rvm_ruby_home/bin/ruby"
result=$?
if [[ $result -eq 0 ]] ; then
- __rvm_log "info" "Installation of rubygems $rvm_ruby_package_name completed successfully."
+ $rvm_scripts_path/log "info" "Installation of rubygems $rvm_ruby_package_name completed successfully."
else
- __rvm_log "warning" "Installation of rubygems $rvm_ruby_package_name did not complete successfully."
+ $rvm_scripts_path/log "warning" "Installation of rubygems $rvm_ruby_package_name did not complete successfully."
fi
__rvm_inject_ruby_shebang "$rvm_ruby_home/bin/gem"
fi
return $result
}
@@ -662,14 +665,14 @@
actual_file="$1"
fi
}
__rvm_install_llvm() {
- cd "$rvm_src_path"
+ builtin cd "$rvm_src_path"
if [[ ! -d "$rvm_src_path/llvm/.svn" ]] ; then
rm -rf "$rvm_src_path/llvm"
svn co -r 82747 https://llvm.org/svn/llvm-project/llvm/trunk llvm
- cd "$rvm_src_path/llvm"
+ builtin cd "$rvm_src_path/llvm"
./configure --enable-bindings=none
UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make -j2
sudo env UNIVERSAL=1 UNIVERSAL_ARCH="i386 x86_64" ENABLE_OPTIMIZED=1 make install
fi
}