scripts/utility in rvm-0.0.64 vs scripts/utility in rvm-0.0.65
- old
+ new
@@ -32,15 +32,26 @@
Info
unset full_version
}
function __rvm_debug {
- __rvm_log "debug" "\nPATH:\n$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
+ __rvm_log "debug" "PATH:\n$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
+ __rvm_log "debug" "uname -a: $(uname -a)"
+ if [[ "Darwin" = "$(uname)" ]] ; then
+ __rvm_log "debug" "uname -r: $(uname -r)"
+ __rvm_log "debug" "uname -m: $(uname -m)"
+ __rvm_log "debug" "sw_vers: $(sw_vers | tr "\n" ',')"
+ __rvm_log "debug" "ARCHFLAGS: $ARCHFLAGS"
+ __rvm_log "debug" "LDFLAGS: $LDFLAGS"
+ __rvm_log "debug" "CFLAGS: $CFLAGS"
+ __rvm_log "debug" "/Developer/SDKs/*:$(ls /Developer/SDKs/ | tr "\n" ',')"
+ fi
+
for file_name in ~/.bash_profile ~/.bashrc ~/.zshrc ; do
if [[ -s "$file_name" ]] ; then
- __rvm_log "debug" "\n$file_name:\n$(grep 'rvm' $file_name)"
+ __rvm_log "debug" "$file_name:\n$(grep 'rvm' $file_name)"
fi
done
for file_name in $rvm_path/default $rvm_path/system $rvm_path/config/db ~/.rvmrc ~/.gemrc; do
if [[ -f "$file_name" ]] && [[ -s "$file_name" ]] ; then
@@ -111,15 +122,15 @@
unset log_file command
}
function __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
+ 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_ruby_configure
}
function __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_configure 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
+ 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
}
# TODO: root user loadng of /etc/rvmrc
function __rvm_load_rvmrc {
if [[ -s ~/.rvmrc ]] ; then source ~/.rvmrc ; fi
@@ -691,21 +702,23 @@
if [[ -d "$rvm_ruby_home" ]] && [[ ! -s "$rvm_ruby_irbrc" ]] ; then
rvm_ruby_irbrc_file=$(cat <<-Config
require "irb/completion" rescue nil
+require "irb/ext/save-history"
+IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-history"
+
@prompt = {
:PROMPT_I => "${rvm_ruby_package_name} > ", # default prompt
:PROMPT_S => "${rvm_ruby_package_name}%l> ", # known continuation
:PROMPT_C => "${rvm_ruby_package_name} > ",
:PROMPT_N => "${rvm_ruby_package_name} ?> ", # unknown continuation
:RETURN => " => %s \n",
:AUTO_INDENT => true
}
-@prompt_mode = :DEFAULT
-IRB.conf[:PROMPT][@prompt_mode] = @prompt
-IRB.conf[:PROMPT_MODE] = @prompt_mode
+IRB.conf[:PROMPT][:RVM] = @prompt
+IRB.conf[:PROMPT_MODE] = :RVM
load '$HOME/.irbrc' if File.exists?('$HOME/.irbrc') rescue nil
Config
)
@@ -834,21 +847,30 @@
}
__rvm_make_flags() {
PATH=${rvm_path}/usr/bin:$PATH ; export PATH
if [[ "Darwin" = "$(uname)" ]] ; then
- sdk="$(/bin/ls -t /Developer/SDKs/ | head -n 1)"
- if [[ "Darwin" = "$(uname)" ]] ; then
- rvm_archflags="-arch $(uname -m)"
- if [[ "-arch x86_64" = "$rvm_archflags" ]] ; then
- openssl_os="os/compiler darwin64-x86_64-cc"
+ if [[ -z "$rvm_archflags" ]] ; then
+ if [[ $(echo "scale=4; $(uname -r | awk -F'.' '{print $1"."$2}') >= 10.0" | bc) -eq 1 ]] ; then
+ rvm_archflags="-arch x86_64"
else
- openssl_os="os/compiler darwin-i386-cc"
+ rvm_archflags="-arch i386"
fi
fi
- CFLAGS="-isysroot /Developer/SDKs/$sdk $rvm_archflags" ; export CFLAGS
- LDFLAGS="-Wl,-syslibroot /Developer/SDKs/$sdk $rvm_archflags" ; export LDFLAGS
- # CXXFLAGS="-mmacosx-version-min="$(sw_vers -productVersion | awk -F'.' '{print $1"."$2}')" -isysroot /Developer/SDKs/$sdk " ; export CXXFLAGS
+
+ if [[ -z "$rvm_sdk" ]] ; then
+ rvm_sdk="$(ls /Developer/SDKs/ | sort | tail -n 1)"
+ fi
+
+ if [[ "-arch x86_64" = "$rvm_archflags" ]] ; then
+ openssl_os="os/compiler darwin64-x86_64-cc"
+ else
+ openssl_os="os/compiler darwin-i386-cc"
+ 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
ARCHFLAGS="$rvm_archflags" ; export ARCHFLAGS
fi
}
__rvm_monitor() {