scripts/utility in rvm-0.1.42 vs scripts/utility in rvm-0.1.43
- old
+ new
@@ -83,10 +83,16 @@
fi
done
echo "$quoted_string" | sed -e 's/^ *//g' -e 's/ *$//g'
}
+__rvm_quote_args_with_shift() {
+ local shift_value="$1"; shift
+ local program_args=( "$@" )
+ __rvm_quote_args "${program_args[@]:$shift_value}"
+}
+
__rvm_warn_on_rubyopt() {
if [[ -n "$RUBYOPT" ]]; then
$rvm_scripts_path/log "warn" "Please note: You have the RUBYOPT environment variable set and this may interfere with normal rvm operations. We sugges unsetting it."
return 1
else
@@ -178,11 +184,11 @@
__rvm_cleanup_variables() {
__rvm_unset_ruby_variables
if [[ "$rvm_sticky_flag" = "1" ]] ; then export rvm_gemset_name ; else unset rvm_gemset_name ; fi
- unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_import_flag rvm_export_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_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_sticky_flag rvm_rvmrc_flag rvm_gems_flag rvm_only_path_flag rvm_docs_flag rvm_ruby_aliases rvm_ruby_aliases rvm_patch_names rvm_clang_flag
+ unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_import_flag rvm_export_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_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag rvm_ruby_bits rvm_sticky_flag rvm_rvmrc_flag rvm_gems_flag rvm_only_path_flag rvm_docs_flag rvm_ruby_aliases rvm_ruby_aliases rvm_patch_names rvm_clang_flag rvm_install_arguments
}
# Unset ruby-specific variables
__rvm_unset_ruby_variables() {
unset rvm_ruby_interpreter rvm_ruby_version rvm_url 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_release_version 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_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_head_flag rvm_ruby_configure rvm_ruby_mode rvm_ruby_package_file rvm_ruby_package_name rvm_ruby_gem_path rvm_ruby_name rvm_ruby_alias rvm_ruby_strings rvm_ruby_repo_path
@@ -215,13 +221,13 @@
__rvm_ensure_has_18_compat_ruby() {
if [[ -z "$(__rvm_18_compat_ruby)" ]]; then
# TODO: install currently doesn't return the correct status.
local compat_result=0
- if ! ( rvm install 1.8.7 ); then
- $rvm_scripts_path/log "fatal" "To proceed rvm requires a 1.8-compatible ruby is installed. We attempted to install 1.8.7 automatically but it failed."
- $rvm_scripts_path/log "fatal" "Please install it manually (or a compatible alternative) to proceed."
+ if ! ( $rvm_scripts_path/manage install 1.8.7 ); then
+ $rvm_scripts_path/log "fail" "To proceed rvm requires a 1.8-compatible ruby is installed. We attempted to install 1.8.7 automatically but it failed."
+ $rvm_scripts_path/log "fail" "Please install it manually (or a compatible alternative) to proceed."
compat_result=1
fi
unset original_ruby
return $compat_result
fi
@@ -783,6 +789,40 @@
else
cwd=$(dirname "$cwd")
fi
fi
done
+}
+
+__rvm_record_install() {
+ [[ -z "$1" ]] && return
+ local recorded_ruby_name="$($rvm_scripts_path/tools strings "$1")"
+ local rvm_install_record_file="$rvm_config_path/installs"
+ local rvm_install_command="$(echo "$recorded_ruby_name $rvm_install_arguments" | __rvm_strip)"
+ touch "$rvm_install_record_file"
+ rm -f "$rvm_install_record_file.tmp"
+ cat "$rvm_install_record_file" | grep -v "^$recorded_ruby_name " > "$rvm_install_record_file.tmp"
+ echo "$rvm_install_command" >> "$rvm_install_record_file.tmp"
+ rm -f "$rvm_install_record_file"
+ mv "$rvm_install_record_file.tmp" "$rvm_install_record_file"
+}
+
+__rvm_remove_install_record() {
+ local recorded_ruby_name="$($rvm_scripts_path/tools strings "$1")"
+ local rvm_install_record_file="$rvm_config_path/installs"
+ if [[ -s "$rvm_install_record_file" ]]; then
+ mv "$rvm_install_record_file" "$rvm_install_record_file.tmp"
+ cat "$rvm_install_record_file.tmp" | grep -v "^$recorded_ruby_name " > "$rvm_install_record_file"
+ rm -f "$rvm_install_record_file.tmp"
+ fi
+}
+
+__rvm_recorded_install_command() {
+ local recorded_ruby_name="$($rvm_scripts_path/tools strings "$1" | awk -F"$rvm_gemset_separator" '{print $1}')"
+ [[ -z "$recorded_ruby_name" ]] && return 1
+ local recorded_ruby_match="^$recorded_ruby_name "
+ if [[ -s "$rvm_config_path/installs" ]] && grep -q "$recorded_ruby_match" "$rvm_config_path/installs" ; then
+ cat "$rvm_config_path/installs" | grep "$recorded_ruby_match" | head -n1
+ else
+ return 1
+ fi
}