scripts/manage in rvm-1.0.19 vs scripts/manage in rvm-1.0.20
- old
+ new
@@ -20,11 +20,11 @@
__rvm_check_for_bison()
{
if [[ ${rvm_head_flag:-0} -gt 0 ]]; then
command -v bison > /dev/null
result=$?
- if [[ $? -gt 0 ]] ; then
+ if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "fail" \
"\nbison is not available in your path. \nPlease ensure bison is installed before compiling from head.\n"
fi
fi
@@ -167,11 +167,11 @@
fi
__rvm_apply_patches
result="$?"
- if [[ "$result" -gt 0 ]]; then
+ if [[ $result -gt 0 ]]; then
"$rvm_path/scripts/log" "fail" \
"There has been an error applying the specified patches. Halting the installation."
return $result
fi
@@ -192,11 +192,11 @@
if [[ -n "${rvm_ruby_configure:-""}" ]] ; then
__rvm_run "configure" "$rvm_ruby_configure"
result=$?
- if [[ "$result" -gt 0 ]] ; then
+ if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "error" \
"There has been an error while configuring. Halting the installation."
return $result
fi
@@ -221,11 +221,11 @@
local configure_command="./configure --prefix=$rvm_ruby_home ${db_configure_flags:-""} ${rvm_configure_flags:-""} ${configure_parameters:-""}"
__rvm_run "configure" "$configure_command" "$rvm_ruby_string - #configuring "
result=$?
- if [[ "$result" -gt 0 ]] ; then
+ if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "error" \
"There has been an error while running configure. Halting the installation."
return $result
fi
@@ -237,11 +237,11 @@
rvm_ruby_make=${rvm_ruby_make:-"make"}
__rvm_run "make" "$rvm_ruby_make ${rvm_make_flags:-""}" "$rvm_ruby_string - #compiling "
result=$?
- if [[ "$result" -gt 0 ]] ; then
+ if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "error" \
"There has been an error while running make. Halting the installation."
return $result
fi
@@ -252,11 +252,11 @@
rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
__rvm_run "install" "$rvm_ruby_make_install" "$rvm_ruby_string - #installing "
result=$?
- if [[ "$result" -gt 0 ]] ; then
+ if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "error" \
"There has been an error while running make install. Halting the installation."
return $result
fi
@@ -288,11 +288,11 @@
unset RUBYOPT
# Check for clang if the flag is set
__rvm_check_for_clang
- result="$?"
+ result=$?
[[ $result -gt 0 ]] && return $result
case "$rvm_ruby_interpreter" in
macruby)
@@ -1082,11 +1082,11 @@
\nHalting installation."
return $result
fi
fi
- if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
+ 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
@@ -1333,9 +1333,12 @@
\nHalting the installation."
return 1
;;
esac
+ if [[ -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" ]] ; then
+ rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
+ fi
mv "/tmp/rvm_src_$$/$(builtin cd /tmp/rvm_src_$$ ; ls)" "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" ; rm -rf "/tmp/rvm_src_$$"
if [[ -n "${rvm_ruby_name:-""}" && -d "${rvm_src_path:-"$rvm_path/src"}/$(echo $rvm_ruby_string | sed -e 's/-n.*//')" ]] ; then
mv "${rvm_src_path:-"$rvm_path/src"}/$(echo "$rvm_ruby_string" | sed -e 's/-n.*//')" "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
fi