scripts/manage in rvm-1.1.0 vs scripts/manage in rvm-1.1.1

- old
+ new

@@ -991,19 +991,17 @@ mkdir -p "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" "$rvm_ruby_home" unzip -o -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" \ "${rvm_archives_path:-"$rvm_path/archives"}/${rvm_ruby_package_file}" >> \ - "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/extract.log" 2>> \ - "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/extract.error.log" + "${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/extract.log" 2>&1 result=$? if [[ "$result" -gt 1 ]] ; then "$rvm_path/scripts/log" "error" \ - "There has been an error while trying to extract $rvm_ruby_package_file. \ - \nHalting the installation." + "There has been an error while trying to extract $rvm_ruby_package_file.\n${rvm_log_path:-"$rvm_path/log"}/$rvm_ruby_string/extract.log might have more details.\nHalting the installation." return $result fi for dir in bin lib silverlight ; do @@ -1041,127 +1039,10 @@ __rvm_run "gems.install" \ "PATH=\"$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin:$rvm_ruby_home/bin:$PATH\" GEM_HOME=\"$rvm_ruby_gem_home\" GEM_PATH=\"$rvm_ruby_gem_home:$rvm_ruby_global_gems_path\" $rvm_ruby_home/bin/gem install --no-rdoc --no-ri rake $rvm_gem_options" \ "Installing $rvm_gem_name to $dir" ;; - mput|shyouhei) - - if [[ ${rvm_make_flags_flag:-0} -eq 1 ]] ; then __rvm_make_flags ; fi - - unset GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC - - __rvm_remove_rvm_from_path - - __rvm_conditionally_add_bin_path ; export PATH - - builtin hash -r - - rvm_ruby_home="$rvm_path/rubies/$rvm_ruby_interpreter-$rvm_ruby_version" - - __rvm_fetch_from_github "mput" "trunk" - - __rvm_apply_patches ; result=$? - - if [[ "$result" -gt 0 ]] ; then - "$rvm_path/scripts/log" "error" \ - "There has been an error while trying to apply patches to mput. \ - \nHalting the installation." - return $result - fi - - if [[ ! -s "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/configure" ]] ; then - - if command -v autoconf &> /dev/null ; then - - __rvm_run "autoconf" "autoconf" "Running autoconf" - - else - "$rvm_path/scripts/log" "fail" \ - "rvm expects autoconf to install this ruby interpreter, autoconf was not found in PATH. \ - \nHalting installation." - return $result - fi - fi - - if [[ -s ./Makefile && -z "$rvm_reconfigure_flag" ]] ; then - - if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then - "$rvm_path/scripts/log" "debug" \ - "Skipping configure step, Makefile exists so configure must have already been run." - fi - - elif [[ -n "$rvm_ruby_configure" ]] ; then - - __rvm_run "configure" "$rvm_ruby_configure" - result=$? - - if [[ "$result" -gt 0 ]] ; then - "$rvm_path/scripts/log" "error" \ - "There has been an error while trying to configure the source. \ - \nHalting the installation." - return $result - fi - - elif [[ -s ./configure ]] ; then - local configure_command="./configure --prefix=$rvm_ruby_home $rvm_configure_flags" - - __rvm_run "configure" "" \ - "Configuring $rvm_ruby_string using $rvm_configure_flags, this may take a while depending on your cpu(s)..." - result=$? - - if [[ "$result" -gt 0 ]] ; then - "$rvm_path/scripts/log" "error" \ - "There has been an error while trying to configure the source.\ - \nHalting the installation." - return $result - fi - - else - "$rvm_path/scripts/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=$? - - if [[ "$result" -gt 0 ]] ; then - "$rvm_path/scripts/log" "error" \ - "There has been an error while trying to run make.\ - \nHalting the installation." - 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=$? - - if [[ "$result" -gt 0 ]] ; then - "$rvm_path/scripts/log" "error" \ - "There has been an error while trying to run make install. \ - \nHalting the installation." - return $result - fi - - "$rvm_path/scripts/log" "info" \ - "Installation of $rvm_ruby_string is complete." - - export GEM_HOME="$rvm_ruby_gem_home" - export GEM_PATH="$rvm_ruby_gem_path" - - __rvm_rubygems_setup - - __rvm_bin_script - - __rvm_run "chmod.bin" "chmod +x $rvm_ruby_home/bin/*" - - __rvm_post_install - ;; - ruby) __rvm_check_for_bison # && Run like hell... if [[ $? -gt 0 ]] ; then return $result ; fi @@ -1221,10 +1102,12 @@ builtin cd "${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string" __rvm_run "$1.repo" "git pull origin $branch" "Pulling from origin $branch" fi + rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" + __rvm_run "$1.copy" "\\cp -R \"${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string\" \"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string\"" "Copying from repo to source..." builtin cd "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" return ${result:-0} @@ -1824,12 +1707,11 @@ __rvm_rubygems_setup() { local home path dir directory_name version_number ruby_lib_gem_path - if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.9/')" \ - || -n "$(echo "$rvm_ruby_interpreter" | awk '/^mput/')" ]] ; then + if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.9/')" ]] ; then install=0 elif [[ "$rvm_ruby_string" = "ruby-head" ]] ; then install=0 @@ -2051,26 +1933,34 @@ rvm_ruby_string="${rvm_ruby_string:-""//${rvm_gemset_separator:-"@"}*}" # Given list of ruby strings. if [[ -n "${rubies_string:-""}" ]] ;then - for rvm_ruby_string in "${rubies_string//,/ }" ; do - current_manage_ruby_string="$rvm_ruby_string" + rubies=(${rubies_string//,/ }) + for rvm_ruby_string in "${rubies[@]}" ; do + + current_ruby_string="$rvm_ruby_string" + + rvm_hook="before_install" ; source "$rvm_path/scripts/hook" + eval "__rvm_${action}_ruby" result="$?" if [[ "$result" -gt 0 && "$manage_result" = 0 ]]; then manage_result="$result" fi if [[ "$result" = 0 && "$action" = "install" ]] ; then - __rvm_record_install "$current_manage_ruby_string" + __rvm_record_install "$current_ruby_string" fi - unset current_manage_ruby_string + unset current_ruby_string __rvm_unset_ruby_variables + + rvm_hook="after_install" ; source "$rvm_path/scripts/hook" + done else # all if [[ "$action" != "install" && "$action" != "remove" \