scripts/utility in rvm-0.0.78 vs scripts/utility in rvm-0.0.79
- old
+ new
@@ -128,11 +128,11 @@
unset log_file command
}
__rvm_cleanup_variables() {
__rvm_unset_ruby_variables
- unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file rvm_src_path rvm_path rvm_prefix_path rvm_gem_path rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_config_path rvm_bin_path rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_log_path rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags
+ unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file rvm_src_path rvm_path rvm_prefix_path rvm_gem_path rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_config_path rvm_bin_path rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_log_path rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags CFLAGS LDFLAGS ARCHFLAGS
}
__rvm_unset_ruby_variables() {
unset rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_ruby_binary rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_string rvm_ruby_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_head_flag rvm_ruby_configure
}
@@ -336,10 +336,11 @@
}
__rvm_gem_sync() {
if [[ ! -z "$rvm_source_gem_path" ]] ; then
for rvm_gem_name_version in $rvm_source_gem_path/gems/* ; do
+ rvm_gem_name_version=$(basename $rvm_gem_name_version)
rvm_gem_name="${rvm_gem_name_version%-*}"
rvm_gem_version="${rvm_gem_name_version##*-}"
if [[ -d $GEM_HOME/gems/$rvm_gem_name_version ]] ; then
echo "$rvm_gem_name_version already installed."
else
@@ -570,11 +571,11 @@
else
if [[ -d "$rvm_path" ]] ; then rm -rf "$rvm_path/" ; fi
fi
gem install rvm --no-rdoc --no-ri -q
__rvm_update_rvm
- source ~/.rvm/scripts/rvm
+ source $rvm_path/scripts/rvm
else
__rvm_log "info" "Carry on then..."
fi ; unset response
}
@@ -635,17 +636,17 @@
done
elif [[ ! -z "$rvm_ruby_interpreter" ]] ; then
unset rvm_ruby_string rvm_ruby_version
__rvm_ruby_do
else # all
- while read -r bin_line
- do # Keep this on second line damnit!
- if [[ -x "$bin_line" ]] ; then
- rvm_ruby_string="$(dirname $bin_line | xargs dirname | xargs basename)"
+ rubies=($(\ls $rvm_path/*/bin/ruby))
+ for full_binary in ${rubies[@]} ; do
+ if [[ -x "$full_binary" ]] ; then
+ rvm_ruby_string="$(dirname $full_binary | xargs dirname | xargs basename)"
__rvm_ruby_do
fi
- done < <(\ls $rvm_path/*/bin/ruby 2> /dev/null)
+ done ; unset full_binary rubies
fi
if [[ ! -z "$rvm_summary_flag" ]] ; then __rvm_summary ; fi
if [[ ! -z "$rvm_yaml_flag" ]] ; then __rvm_yaml ; fi
if [[ ! -z "$rvm_json_flag" ]] ; then __rvm_json ; fi
@@ -874,11 +875,13 @@
# This is only an issue with Darwin :/
if [[ "Darwin" = "$(uname)" ]] ; then
# ls /usr/lib/gcc/i686-apple-darwin10
# Set the build & host type
- if [[ $(sysctl hw.cpu64bit_capable | awk '{print $2}') = 1 ]] ; then # we could also use: sysctl hw.optional.x86_64
+ if [[ "Power Macintosh" = "$(sysctl hw.machine | awk -F: '{print $2}' | sed 's/^ //')" ]] ; then
+ : # Do nothing ?
+ elif [[ $(sysctl hw.cpu64bit_capable | awk '{print $2}') = 1 ]] ; then # we could also use: sysctl hw.optional.x86_64
# 64 bit capable
if [[ "-arch x86_64" = "$rvm_archflags" ]] ; then
rvm_ruby_configure_flags="${rvm_ruby_configure_flags} --build=i686-apple-darwin$(uname -r) --host=i686-apple-darwin$(uname -r)"
elif [[ "-arch i386" = "$rvm_archflags" ]] ; then
rvm_ruby_configure_flags="${rvm_ruby_configure_flags} --build=i386-apple-darwin$(uname -r) --host=i386-apple-darwin$(uname -r)"
@@ -889,16 +892,18 @@
else
# 32 bit capable only
if [[ -z "$rvm_archflags" ]] ; then rvm_archflags="-arch i386" ; fi
rvm_ruby_configure_flags="${rvm_ruby_configure_flags} --build=i386-apple-darwin$(uname -r) --host=i386-apple-darwin$(uname -r)"
fi
- ARCHFLAGS="$rvm_archflags" ; export ARCHFLAGS
- # Use the latest sdk available.
- if [[ -z "$rvm_sdk" ]] ; then rvm_sdk="$(basename -a /Developer/SDKs/* | awk '/^M/' | sort | tail -n 1)" ; fi
- CFLAGS="-isysroot /Developer/SDKs/$rvm_sdk $rvm_archflags" ; export CFLAGS
- LDFLAGS="-Wl,-syslibroot /Developer/SDKs/$rvm_sdk $rvm_archflags" ; export LDFLAGS
- # CXXFLAGS="-mmacosx-version-min="$(sw_vers -productVersion | awk -F'.' '{print $1"."$2}')" -isysroot /Developer/SDKs/$rvm_sdk " ; export CXXFLAGS
+ if [[ ! -z "$rvm_archflags" ]] ; then
+ ARCHFLAGS="$rvm_archflags" ; export ARCHFLAGS
+ # Use the latest sdk available.
+ if [[ -z "$rvm_sdk" ]] ; then rvm_sdk="$(basename -a /Developer/SDKs/* | awk '/^M/' | sort | tail -n 1)" ; fi
+ CFLAGS="-isysroot /Developer/SDKs/$rvm_sdk $rvm_archflags" ; export CFLAGS
+ LDFLAGS="-Wl,-syslibroot /Developer/SDKs/$rvm_sdk $rvm_archflags" ; export LDFLAGS
+ # CXXFLAGS="-mmacosx-version-min="$(sw_vers -productVersion | awk -F'.' '{print $1"."$2}')" -isysroot /Developer/SDKs/$rvm_sdk " ; export CXXFLAGS
+ fi
fi
}
__rvm_monitor() {
if [[ -d "test/" ]] ; then test_timestamp=$(timestamp "test/") ; fi