scripts/manage in rvm-0.0.99 vs scripts/manage in rvm-0.0.999

- old
+ new

@@ -4,10 +4,11 @@ original_ruby_string=$rvm_ruby_string source $rvm_scripts_path/initialize source $rvm_scripts_path/utility source $rvm_scripts_path/selector +source $rvm_scripts_path/libraries trap "rm -f $rvm_path/tmp/$$* > /dev/null 2>&1 ; exit" 0 1 2 3 15 if [[ ! -z "$rvm_trace_flag" ]] ; then set -x ; export rvm_trace_flag ; fi @@ -18,40 +19,52 @@ mkdir -p "$rvm_ruby_log_path" __rvm_pushpop "$rvm_src_path" if [[ ! -z "$rvm_force_flag" ]] ; then rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi result=0 - __rvm_fetch_ruby || (result=$? && return $result) + __rvm_fetch_ruby + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error fetching the ruby interpreter. Aborting the installation." ; __rvm_pushpop ; return $result + fi - builtin cd $rvm_ruby_src_path || (result=$? ; $rvm_scripts_path/log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log" ; __rvm_pushpop ; return $result) + builtin cd $rvm_ruby_src_path + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error, source directory is missing. Did the download or extraction fail? Aborting the installation." ; __rvm_pushpop ; return $result + fi if [[ -d "${rvm_path}/usr/bin" ]] ; then export PATH="${rvm_path}/usr/bin:${PATH}" ; fi if [[ -z "$rvm_ruby_configure" ]] && [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then if which autoconf &> /dev/null ; then __rvm_run "autoconf" "autoconf" "Running autoconf" else - $rvm_scripts_path/log "fail" "rvm expects autoconf" result=$? ; return $result + result=$? ; $rvm_scripts_path/log "fail" "rvm requires autoconf to install the selected ruby interpreter however autoconf was not found in the PATH." ; return $result fi fi if [[ "1.8.5" = "$rvm_ruby_version" ]] ; then # How to install ruby 1.8.5... "sneaky sneaky, sir" - if [[ ! -d "$HOME/.rvm/src/ruby-1.8.7-p248/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p248 1>/dev/null ; fi - if [[ ! -d "$HOME/.rvm/src/ruby-1.8.6-p383/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p383 1>/dev/null ; fi + if [[ ! -d "$HOME/.rvm/src/ruby-1.8.7-p248/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p248 > /dev/null ; fi + if [[ ! -d "$HOME/.rvm/src/ruby-1.8.6-p383/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p383 > /dev/null ; fi cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/extconf.rb ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/ cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/openssl_missing.* ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/ cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/ossl_hmac.c ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/ cp ~/.rvm/src/ruby-1.8.6-p383/ext/readline/* ~/.rvm/src/ruby-1.8.5-p231/ext/readline/ fi if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then (($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" || (result=$? && return $result) + __rvm_run "configure" "$rvm_ruby_configure" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while configuring. Aborting the installation." ; __rvm_pushpop ; return $result + fi elif [[ -s ./configure ]] ; then - __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags $configure_parameters" "Configuring $rvm_ruby_string, this may take a while depending on your cpu(s)..." || (result=$? && return $result) + __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags $configure_parameters" "Configuring $rvm_ruby_string, this may take a while depending on your cpu(s)..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while running configure. Aborting the installation." ; __rvm_pushpop ; return $result + fi unset configure_parameters else $rvm_scripts_path/log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?" fi @@ -60,14 +73,20 @@ patch -p1 $patch done fi rvm_ruby_make=${rvm_ruby_make:-"make"} - __rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while, depending on your cpu(s)..." || (result=$? && return $result) + __rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while, depending on your cpu(s)..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while running make. Aborting the installation." ; __rvm_pushpop ; return $result + fi rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"} - __rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string" || (result=$? && return $result) + __rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while running make install. Aborting the installation." ; __rvm_pushpop ; return $result + fi $rvm_scripts_path/log "info" "Installation of $rvm_ruby_string is complete." GEM_HOME="$rvm_ruby_gem_home" ; export GEM_HOME GEM_PATH="$rvm_ruby_gem_home" ; export GEM_PATH @@ -86,25 +105,32 @@ case "$rvm_ruby_interpreter" in macruby) if [[ "Darwin" = "$(uname)" ]] ; then if [[ "$rvm_head_flag" = 1 ]] ; then - __rvm_install_llvm + if [[ ! -z "$rvm_llvm_flag" ]] ; then __rvm_install_llvm ; fi 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_db "${rvm_ruby_interpreter}_repo_url" "rvm_url" rvm_ruby_repo_url=$rvm_url __rvm_install_source $* + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to install from source. Aborting the installation." ; return $result + fi else # if [[ "nightly" = "$rvm_ruby_version" ]] ; then macruby_path="/usr/local/bin" # TODO: Separated nightly from head. __rvm_db "macruby_nightly_url" "rvm_url" $rvm_scripts_path/log "info" "Retrieving the latest nightly macruby build..." - $rvm_scripts_path/fetch "$rvm_url" || (result=$? && return $result) + $rvm_scripts_path/fetch "$rvm_url" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; 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 @@ -120,12 +146,11 @@ PATH="$rvm_ruby_home/bin:$rvm_ruby_gem_home/bin:\$PATH" ; export PATH exec $macruby_path/mac$binary_name $prefix "\$@" RubyWrapper ) - files="$rvm_ruby_home/bin/$binary_name $rvm_path/bin/$binary_name-$rvm_ruby_string" - for file_name in $(echo $files) ; do + for file_name in "$rvm_ruby_home/bin/$binary_name" "$rvm_path/bin/$binary_name-$rvm_ruby_string" ; do rm -f $file_name echo "$ruby_wrapper" > $file_name if [[ -f $file_name ]] ; then chmod +x $file_name ; fi done unset file_name ruby_wrapper binary_name files prefix @@ -143,13 +168,21 @@ __rvm_pushpop "$rvm_src_path" if [[ -z "$rvm_force_flag" ]] && [[ -d "$rvm_ruby_src_path" ]] && [[ ! -x "$rvm_ruby_src_path/installer" ]] ; then $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_scripts_path/log "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..." - $rvm_scripts_path/fetch "$rvm_url" || (result=$? && return $result) + $rvm_scripts_path/fetch "$rvm_url" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; 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..." || (result=$? && return $result) + __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_file..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi + mv "$rvm_src_path/$rvm_ruby_package_file" "$rvm_ruby_src_path" fi builtin cd "$rvm_ruby_src_path" mkdir -p "$rvm_ruby_log_path" @@ -160,11 +193,15 @@ if [[ "Darwin" = "$(uname)" ]] && [[ "1.8.6" = "$rvm_ruby_version" ]] && [[ -z "$rvm_ree_options" ]] ; then rvm_ree_options="${rvm_ree_options} --no-tcmalloc" fi - __rvm_run "install" "./installer -a $rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level $rvm_ree_options --dont-install-useful-gems $rvm_ruby_configure_flags" "Installing $rvm_ruby_string, this may take a while, depending on your cpu(s)..." || (result=$? && return $result) + __rvm_run "install" "./installer -a $rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level $rvm_ree_options --dont-install-useful-gems $rvm_ruby_configure_flags" "Installing $rvm_ruby_string, this may take a while, depending on your cpu(s)..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to run the ree installer. Aborting the installation." ; __rvm_pushpop ; return $result + fi + chmod +x $rvm_ruby_home/bin/* __rvm_rubygems_setup for rvm_gem_name in rake ; do @@ -205,13 +242,19 @@ PATH=$rvm_bin_path:$PATH ; export PATH if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1\.0/')" ]] && [[ -z "$rvm_head_flag" ]] ; then if [[ ! -f "$rvm_archives_path/$rvm_ruby_package_file.tar.gz" ]] ; then $rvm_scripts_path/log "info" "Downloading $rvm_ruby_file, this may take a while depending on your connection..." - $rvm_scripts_path/fetch "$rvm_url" || (result=$? && return $result) + $rvm_scripts_path/fetch "$rvm_url" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi fi - __rvm_run "extract" "tar xzf $rvm_archives_path/$(basename $rvm_url) -C $rvm_src_path" "Extracting $(basename $rvm_url) ..." || (result=$? && return $result) + __rvm_run "extract" "tar xzf $rvm_archives_path/$(basename $rvm_url) -C $rvm_src_path" "Extracting $(basename $rvm_url) ..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi mv "$rvm_src_path/rubinius-$rvm_ruby_version-${rvm_ruby_patch_level/^p//}" $rvm_ruby_src_path else __rvm_db "rubinius_repo_url" "rvm_ruby_repo_url" #rvm_ruby_home="$rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version" if [[ ! -d "$rvm_ruby_src_path" ]] || [[ ! -d "$rvm_ruby_src_path/.git" ]] ; then @@ -220,34 +263,43 @@ builtin cd "$rvm_ruby_src_path" else builtin cd "$rvm_ruby_src_path" __rvm_run "rbx.repo" "git pull origin master" "Pulling from origin master" fi + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while fetching the rbx git repo. Aborting the installation." ; __rvm_pushpop ; return $result + fi fi #if [[ ! -x "$rvm_ruby_distclean" ]] ; then # __rvm_run "rake.distclean" "\$(rvm 1.8.7 ; rake distclean --trace)" "Running distclean." #fi builtin cd "$rvm_ruby_src_path" chmod +x ./configure rvm_ruby_configure="./configure --prefix=$rvm_ruby_home" ; message="Configuring rbx" - - if [[ "$rvm_jit_flag" -eq 0 ]] && [[ "rc1" != "$rvm_ruby_patch_level" ]] ; then - rvm_ruby_configure="$rvm_ruby_configure --disable-llvm" ; message="$message with LLVM disabled" + if [[ "$rvm_llvm_flag" = "0" ]] ; then + rvm_ruby_configure="$rvm_ruby_configure --disable-llvm" else - rvm_ruby_configure="$rvm_ruby_configure" ; message="$message with LLVM enabled" + if [[ "$rvm_ruby_patch_level" = "rc1" ]] ; then + rvm_ruby_configure="$rvm_ruby_configure --enable-llvm" + fi fi - __rvm_run "configure" "$rvm_ruby_configure" "$message" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while running '$rvm_ruby_configure'. Aborting the installation." ; __rvm_pushpop ; return $result + fi if [[ "$rvm_trace_flag" -eq 1 ]] ; then rvm_ruby_make="$rvm_bin_path/rvm 1.8.7 rake install --trace" ; message="Compiling rbx" else rvm_ruby_make="$rvm_bin_path/rvm 1.8.7 rake install" ; message="Compiling rbx" fi __rvm_run "rake" "$rvm_ruby_make" "$message" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while running '$rvm_ruby_configure'. Aborting the installation." ; __rvm_pushpop ; return $result + fi 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 @@ -286,14 +338,15 @@ echo -e "java must be installed and in your path in order to install JRuby." ; return 1 fi mkdir -p "$rvm_ruby_log_path" "$rvm_ruby_src_path" __rvm_pushpop $rvm_src_path - __rvm_fetch_ruby || (result=$? && return $result) + __rvm_fetch_ruby + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi - # if [[ -z "$rvm_head_flag" ]] ; then __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." ; fi - builtin cd "$rvm_ruby_src_path" if [[ ! -z "$rvm_head_flag" ]] ; then __rvm_run "ant.dist" "ant dist" "Running 'ant dist' (this could take a few minutes) ..." ; fi mkdir -p "$rvm_ruby_home/bin/" __rvm_run "nailgun" "builtin cd \"$rvm_ruby_src_path/tool/nailgun\" && ./configure --prefix=$rvm_ruby_home && make $rvm_make_flags" "Building Nailgun" @@ -329,11 +382,11 @@ echo -e "mono must be installed and in your path in order to install IronRuby." ; return 1 fi if [[ "$rvm_head_flag" = 1 ]] ; then mono_version="$(mono -V | head -n 1 | cut -d ' ' -f5)" - if [[ "$mono_version" =~ ([0-9]+)\.([0-9]+)\.?([0-9]+)? ]] ; then + if $rvm_scripts_path/match "$mono_version" "([0-9]+)\.([0-9]+)\.?([0-9]+)?" ; then if [[ ${BASH_REMATCH[1]} -lt 2 ]] || ( [[ ${BASH_REMATCH[1]} -eq 2 ]] && [[ ${BASH_REMATCH[2]} -lt 6 ]] ) ; then echo -e "Mono 2.6 (or greater) must be installed and in your path in order to build IronRuby from the repository." echo -e "Version detected: ${BASH_REMATCH[0]}" return 1 fi @@ -358,14 +411,19 @@ cp -r $rvm_ruby_src_path/Merlin/Main/Languages/Ruby/Scripts/bin/* $rvm_ruby_home/bin/ cp -r $rvm_ruby_src_path/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p*/lib/ruby/* $rvm_ruby_home/lib/ruby cp -r $rvm_ruby_src_path/ruby_home/lib/IronRuby else $rvm_scripts_path/log "info" "Retrieving IronRuby" - $rvm_scripts_path/fetch "$rvm_url" || (result=$? && return $result) + $rvm_scripts_path/fetch "$rvm_url" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi __rvm_run "extract" "unzip $rvm_archives_path/$rvm_ruby_package_file ironruby/bin/* ironruby/lib/* -d $rvm_ruby_home" "Extracting $rvm_ruby_package_file ..." - if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi mv $rvm_ruby_home/ironruby/* $rvm_ruby_home rm -rf $rvm_ruby_home/ironruby mv $rvm_ruby_home/lib/ironruby $rvm_ruby_home/lib/IronRuby fi @@ -418,29 +476,42 @@ if [[ ! -s "$rvm_ruby_src_path/configure" ]] ; then if which autoconf &> /dev/null ; then __rvm_run "autoconf" "autoconf" "Running autoconf" else - $rvm_scripts_path/log "fail" "rvm expects autoconf" ; result=$? ; return $result + $rvm_scripts_path/log "fail" "rvm expects autoconf to install this ruby interpreter, autoconf was not found in PATH. Aborting installation." ; result=$? ; return $result fi fi if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then (($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" || (result=$? && return $result) + __rvm_run "configure" "$rvm_ruby_configure" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi + elif [[ -s ./configure ]] ; then - __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags" "Configuring $rvm_ruby_string using $rvm_ruby_configure_flags, this may take a while depending on your cpu(s)..." || (result=$? && return $result) + __rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags" "Configuring $rvm_ruby_string using $rvm_ruby_configure_flags, this may take a while depending on your cpu(s)..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi else $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:-"make"} - __rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while, depending on your cpu(s)..." || (result=$? && return $result) + __rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while, depending on your cpu(s)..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to run make. Aborting the installation." ; __rvm_pushpop ; return $result + fi rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"} - __rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string" || (result=$? && return $result) + __rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to run make install. Aborting the installation." ; __rvm_pushpop ; return $result + fi $rvm_scripts_path/log "info" "Installation of $rvm_ruby_string is complete." GEM_HOME="$rvm_ruby_gem_home" ; export GEM_HOME GEM_PATH="$rvm_ruby_gem_home" ; export GEM_PATH @@ -484,39 +555,59 @@ rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_url")/$rvm_ruby_version/$rvm_ruby_package_file.$rvm_archive_extension" else rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_url")/$rvm_ruby_package_file.$rvm_archive_extension" fi $rvm_scripts_path/log "info" "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..." - $rvm_scripts_path/fetch "$rvm_url" || (result=$? && return $result) + $rvm_scripts_path/fetch "$rvm_url" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi + fi - __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." || (result=$? && return $result) + __rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..." + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi + else if [[ ! -z "$(echo $rvm_url | awk '/^git/')" ]] ; then if [[ -d "$rvm_ruby_src_path/.git" ]] ; then builtin cd $rvm_ruby_src_path if [[ -z "$rvm_ruby_revision" ]] ; then $rvm_scripts_path/log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..." - git pull origin master || (result=$? && return $result) + git pull origin master + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to update the source from the remote repository. Aborting the installation." ; __rvm_pushpop ; return $result + fi else if [[ -z "$rvm_ruby_sha" ]] ; then git checkout HEAD else git checkout $(echo $rvm_ruby_sha | sed 's#^s##') - fi || (result=$? && return $result) + fi + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to checkout the source branch. Aborting the installation." ; __rvm_pushpop ; return $result + fi fi else $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 || (result=$? && return $result) + git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the repository. Aborting the installation." ; __rvm_pushpop ; return $result + fi fi else if [[ ! -z "$rvm_head_flag" ]] || [[ "trunk" = "$rvm_ruby_revision" ]] ; then rvm_url="${rvm_url:-"$rvm_ruby_repo_url/trunk"}" rvm_rev="" elif [[ ! -z "$rvm_ruby_tag" ]] ; then # TODO: Check if tag v is valid rvm_url="${rvm_url:-"$rvm_ruby_repo_url/tags/$(echo $rvm_ruby_tag | sed 's/^t//')"}" rvm_rev="" + elif [[ "$rvm_major_version.$rvm_minor_version" = "8.8" ]] ; then + rvm_url="${rvm_url:-"$rvm_ruby_repo_url/branches/ruby_1_${rvm_major_version}"}" + rvm_rev="-$rvm_ruby_revision" else rvm_url="${rvm_url:-"$rvm_ruby_repo_url/branches/ruby_1_${rvm_major_version}_${rvm_minor_version}"}" rvm_rev="-$rvm_ruby_revision" fi @@ -529,11 +620,15 @@ __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 || (result=$? && return $result) + fi + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch / update the source. Aborting the installation." ; __rvm_pushpop ; return $result + fi + fi fi } __rvm_uninstall_ruby() { @@ -629,10 +724,13 @@ # 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_scripts_path/log "info" "Retrieving $rvm_gem_package_name" - $rvm_scripts_path/fetch "$rvm_gem_url" || (result=$? && return $result) + $rvm_scripts_path/fetch "$rvm_gem_url" + result=$? ; if [[ "$result" -gt 0 ]] ; then + $rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; 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 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"