From 3329fc805c956e84e39d64ff35071156150b23dc Mon Sep 17 00:00:00 2001 From: mpapis Date: Thu, 6 Oct 2011 20:32:59 +0200 Subject: [PATCH] fix = to == - for #475 --- binscripts/rvm-prompt | 4 +-- scripts/alias | 2 +- scripts/cli | 44 ++++++++++++++++---------------- scripts/completion | 2 +- scripts/db | 2 +- scripts/default | 6 ++--- scripts/docs | 2 +- scripts/env | 2 +- scripts/extras/rails | 6 ++--- scripts/functions/build | 10 ++++---- scripts/functions/cleanup | 4 +-- scripts/functions/gemset | 2 +- scripts/functions/implode | 10 ++++---- scripts/functions/manage/base | 10 ++++---- scripts/functions/manage/jruby | 2 +- scripts/functions/manage/macruby | 6 ++--- scripts/functions/manage/ree | 2 +- scripts/functions/pkg | 14 +++++----- scripts/functions/rvmrc | 2 +- scripts/gemsets | 8 +++--- scripts/hash | 2 +- scripts/hook | 2 +- scripts/info | 2 +- scripts/list | 12 ++++----- scripts/manage | 2 +- scripts/migrate | 8 +++--- scripts/monitor | 10 ++++---- scripts/requirements | 4 +-- scripts/selector | 18 ++++++------- scripts/set | 6 ++--- scripts/snapshot | 4 +-- scripts/upgrade | 2 +- scripts/wrapper | 2 +- 33 files changed, 107 insertions(+), 107 deletions(-) diff --git a/binscripts/rvm-prompt b/binscripts/rvm-prompt index 4e0e485a22..226e3001c8 100755 --- a/binscripts/rvm-prompt +++ b/binscripts/rvm-prompt @@ -9,7 +9,7 @@ add() if [[ -n "$format" ]] ; then - [[ ${previous_is_format_var:-0} = 1 ]] && eval "${token}_prefix_flag=1" + [[ ${previous_is_format_var:-0} == 1 ]] && eval "${token}_prefix_flag=1" format="${format}\$${token}" @@ -93,7 +93,7 @@ if [[ -n "$ruby" && -n "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; then # Only people who explicitely ask for this will have the # slight performance penalty associated. - if [[ "$(rvm tools identifier)" = "$(rvm alias show default)" ]] ; then + if [[ "$(rvm tools identifier)" == "$(rvm alias show default)" ]] ; then exit 0 diff --git a/scripts/alias b/scripts/alias index 7cc85199dd..b053bc8106 100755 --- a/scripts/alias +++ b/scripts/alias @@ -100,7 +100,7 @@ alias_create() { result=1 else - if [[ "default" = "$alias_name" ]] ; then + if [[ "default" == "$alias_name" ]] ; then rvm_alias="" fi diff --git a/scripts/cli b/scripts/cli index 3e06fbb6e1..963e32ade6 100644 --- a/scripts/cli +++ b/scripts/cli @@ -53,7 +53,7 @@ __rvm_parse_args() use) rvm_action="$rvm_token" rvm_verbose_flag=1 - if [[ "ruby" = "$next_token" ]] + if [[ "ruby" == "$next_token" ]] then if (( $# > 0 )) then @@ -84,12 +84,12 @@ __rvm_parse_args() then rvm_ruby_args="help" - elif [[ "clear" = "$next_token" ]] + elif [[ "clear" == "$next_token" ]] then __rvm_gemset_clear rvm_ruby_args="clear" - elif [[ "use" = "$next_token" ]] + elif [[ "use" == "$next_token" ]] then rvm_use_flag=1 rvm_ruby_args="$next_token $@" @@ -117,7 +117,7 @@ __rvm_parse_args() ;; esac - elif [[ "delete" = "$next_token" ]] + elif [[ "delete" == "$next_token" ]] then rvm_delete_flag=1 rvm_ruby_args="$next_token $@" @@ -154,13 +154,13 @@ __rvm_parse_args() rvm_action="gemset" rvm_gemdir_flag=1 - if [[ "system" = "$next_token" ]] + if [[ "system" == "$next_token" ]] then rvm_system_flag=1 if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi fi - if [[ "user" = "$next_token" ]] + if [[ "user" == "$next_token" ]] then rvm_user_flag=1 if [[ $# -gt 0 ]] ; then next_token="$1" ; shift ; else next_token="" ; fi @@ -169,7 +169,7 @@ __rvm_parse_args() pkg) rvm_action="$rvm_token" - if [[ "$next_token" = "--only-path" ]] + if [[ "$next_token" == "--only-path" ]] then shift rvm_only_path_flag=1 @@ -187,19 +187,19 @@ __rvm_parse_args() do|ruby|rake|gem|rubydo|rakedo|gemdo) - if [[ "do" = "${rvm_action:-""}" ]] ; then rvm_action="ruby" ; fi + if [[ "do" == "${rvm_action:-""}" ]] ; then rvm_action="ruby" ; fi rvm_action=${rvm_token//do} - if [[ "rake" = "${rvm_action:-""}" || "gem" = "${rvm_action:-""}" || "ruby" = "${rvm_action:-""}" ]] ; then + if [[ "rake" == "${rvm_action:-""}" || "gem" == "${rvm_action:-""}" || "ruby" == "${rvm_action:-""}" ]] ; then if [[ -z "$next_token" ]] then - if [[ "gem" = "${rvm_action:-""}" ]] + if [[ "gem" == "${rvm_action:-""}" ]] then rvm_action="error" rvm_error_message="'rvm $rvm_action' must be followed by arguments." - elif [[ "ruby" = "${rvm_action:-""}" ]] + elif [[ "ruby" == "${rvm_action:-""}" ]] then if echo "${rvm_ruby_strings:-""}" | \grep ',' >/dev/null 2>&1 then @@ -210,12 +210,12 @@ __rvm_parse_args() rvm_error_message="rvm X,Y,Z '$rvm_action' must be followed by arguments." fi fi - elif [[ "-S" = "$next_token" ]] + elif [[ "-S" == "$next_token" ]] then rvm_action="ruby" rvm_ruby_args="${flag:-""} $next_token $(__rvm_quote_args "$@")" rvm_parse_break=1 - elif [[ "-e" = "$next_token" ]] + elif [[ "-e" == "$next_token" ]] then rvm_action="ruby" IFS="\n" ; rvm_ruby_args="${flag:-""} $next_token '$@'" ; IFS=" " @@ -281,7 +281,7 @@ __rvm_parse_args() ;; inspect|ls|list|info|strings|get|current) - if [[ "ls" = "$rvm_action" ]]; then rvm_action="list" ; fi + if [[ "ls" == "$rvm_action" ]]; then rvm_action="list" ; fi rvm_action="$rvm_token" rvm_ruby_args="$next_token $@" @@ -375,7 +375,7 @@ __rvm_parse_args() then # TODO: Middle should be convertable to a case statement for further # efficiency only have to deal with the first and last parts. - if [[ "gemset" = "$rvm_action" ]] + if [[ "gemset" == "$rvm_action" ]] then case "$rvm_token" in *${rvm_gemset_separator:-"@"}*) @@ -438,7 +438,7 @@ __rvm_parse_args() jruby*|ree*|kiji*|macruby*|rbx*|rubinius*|goruby|ironruby*|default*|maglev*|all) rvm_action="${rvm_action:-use}" - if [[ "rubinius" = "$rvm_token" ]] ; then rvm_token="rbx"; fi + if [[ "rubinius" == "$rvm_token" ]] ; then rvm_token="rbx"; fi rvm_ruby_interpreter="$rvm_token" rvm_ruby_string="$rvm_token" rvm_ruby_strings="$rvm_token" @@ -453,7 +453,7 @@ __rvm_parse_args() rvm_ruby_args="$rvm_token" rvm_ruby_file="$rvm_token" - if [[ -z "${rvm_action:-""}" || "$rvm_action" = "use" ]]; then + if [[ -z "${rvm_action:-""}" || "$rvm_action" == "use" ]]; then rvm_action="ruby" fi ;; @@ -477,7 +477,7 @@ __rvm_parse_args() rvm_error_message="Unrecognized command line argument(s): '$rvm_token $@'" fi - if [[ "error" = "${rvm_action:-""}" ]] ; then break ; fi + if [[ "error" == "${rvm_action:-""}" ]] ; then break ; fi ;; esac @@ -559,7 +559,7 @@ __rvm_parse_args() ;; --bin) - if [[ "update" = "${rvm_action:-""}" ]] ; then + if [[ "update" == "${rvm_action:-""}" ]] ; then rvm_bin_flag=1 else rvm_bin_path="$next_token" @@ -739,7 +739,7 @@ __rvm_parse_args() [[ -n "${ZSH_VERSION:-""}" ]] || set -o errtrace # errexit pipefail - if [[ "$rvm_token" = "--trace" ]] + if [[ "$rvm_token" == "--trace" ]] then export rvm_trace_flag=1 set -o xtrace @@ -879,7 +879,7 @@ rvm() next_token="" fi - if [[ "$next_token" = "${rvm_action}" ]] + if [[ "$next_token" == "${rvm_action}" ]] then shift fi @@ -956,7 +956,7 @@ rvm() if [[ ${rvm_delete_flag:-0} -eq 1 ]] ; then gem_prefix="$(echo "${GEM_HOME:-""}" | \sed 's/'${rvm_gemset_separator:-"@"}'.*$//')" - if [[ "${GEM_HOME:-""}" = "${gem_prefix}${rvm_gemset_separator:-"@"}${rvm_gemset_name}" ]] ; then + if [[ "${GEM_HOME:-""}" == "${gem_prefix}${rvm_gemset_separator:-"@"}${rvm_gemset_name}" ]] ; then rvm_ruby_gem_home="$gem_prefix" GEM_HOME="$rvm_ruby_gem_home" GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}global" diff --git a/scripts/completion b/scripts/completion index e31e2230c0..2bc15de984 100644 --- a/scripts/completion +++ b/scripts/completion @@ -16,7 +16,7 @@ __rvm_subcommand() while [[ $c -lt $COMP_CWORD ]] ; do word="${COMP_WORDS[c]}" for subcommand in $1; do - if [[ "$subcommand" = "$word" ]]; then + if [[ "$subcommand" == "$word" ]]; then echo "$subcommand" return fi diff --git a/scripts/db b/scripts/db index 77e7de3040..49142f8a55 100755 --- a/scripts/db +++ b/scripts/db @@ -47,7 +47,7 @@ else value="$*" - if [[ "unset" = "$value" || "delete" = "$value" ]] + if [[ "unset" == "$value" || "delete" == "$value" ]] then \sed -e "s#^$escaped_key=.*\$##" -e '/^$/d' "$database_file" \ > "$database_file.new" diff --git a/scripts/default b/scripts/default index b66e5d4beb..3bc2e754b0 100644 --- a/scripts/default +++ b/scripts/default @@ -48,13 +48,13 @@ args=($*) action="${args[0]}" args=${args[@]:1} -if [[ "list" = "$action" ]] ; then +if [[ "list" == "$action" ]] ; then default_list -elif [[ "clear" = "$action" ]] ; then +elif [[ "clear" == "$action" ]] ; then default_clear -elif [[ "help" = "$action" ]] ; then +elif [[ "help" == "$action" ]] ; then usage ; exit 0 else diff --git a/scripts/docs b/scripts/docs index 7fe95d0f2f..1ce346385c 100755 --- a/scripts/docs +++ b/scripts/docs @@ -5,7 +5,7 @@ source "$rvm_scripts_path/base" rvm_docs_ruby_string="$(__rvm_env_string | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')" -if [[ "$rvm_docs_ruby_string" = "system" || -z "$rvm_docs_ruby_string" ]]; then +if [[ "$rvm_docs_ruby_string" == "system" || -z "$rvm_docs_ruby_string" ]]; then rvm_error "Currently 'rvm docs ...' does not work with non-rvm rubies." diff --git a/scripts/env b/scripts/env index 1000792ac2..3492ca559d 100755 --- a/scripts/env +++ b/scripts/env @@ -24,7 +24,7 @@ fi # Exit when we encounter an unknown environment name. __rvm_become "$environment_name" -if [[ "$?" = 0 ]]; then +if [[ "$?" == 0 ]]; then __rvm_use environment_file_path="$rvm_environments_path/$(__rvm_env_string)" # Echo the path or environment file. diff --git a/scripts/extras/rails b/scripts/extras/rails index f5a6ae9f63..e75576867a 100644 --- a/scripts/extras/rails +++ b/scripts/extras/rails @@ -122,7 +122,7 @@ rails_routes() md5_cached="" fi - if [[ -s "$cache_file" && $md5_current = $md5_cached ]]; then + if [[ -s "$cache_file" && $md5_current == $md5_cached ]]; then routes=$(cat -v "$cache_file") else routes=$(rake routes 2>/dev/null) @@ -155,7 +155,7 @@ rails_routes() results=() for condition in "${ands[@]}" ; do for route in ${routes[@]} ; do - if [[ ${route} = ${condition} ]]; then + if [[ ${route} == ${condition} ]]; then results=(${results[@]} ${route}) fi done @@ -226,7 +226,7 @@ r() { rails_version=${rails_version%%.*} if [[ $rails_version -ge 3 ]]; then rails new $args - elif [[ $rails_version = 1 || $rails_version = 2 ]] ; then + elif [[ $rails_version == 1 || $rails_version == 2 ]] ; then rails $args fi ;; diff --git a/scripts/functions/build b/scripts/functions/build index ce6078b9f7..eab8b0ceb4 100644 --- a/scripts/functions/build +++ b/scripts/functions/build @@ -7,7 +7,7 @@ __rvm_setup_compile_environment() export CC="/usr/bin/gcc-4.2" fi - if [[ "Darwin" = "$(uname)" ]] + if [[ "Darwin" == "$(uname)" ]] then rvm_configure_env=() local architectures="${rvm_architectures:-"-arch x86_64"}" @@ -33,24 +33,24 @@ __rvm_setup_compile_environment() __rvm_make_flags() { # This is only an issue with Darwin :/ - if [[ "$MACHTYPE" = *darwin* ]] + if [[ "$MACHTYPE" == *darwin* ]] then # \ls /usr/lib/gcc/x86_64-apple-darwin10 # Set the build & host type - if [[ "Power Macintosh" = "$(/usr/sbin/sysctl -n hw.machine)" ]] + if [[ "Power Macintosh" == "$(/usr/sbin/sysctl -n hw.machine)" ]] then true # Do nothing ? elif [[ "$(/usr/sbin/sysctl -n hw.cpu64bit_capable)" = 1 || \ "$(/usr/sbin/sysctl -n hw.optional.x86_64)" = 1 ]] then # 64 bit capable - if [[ "-arch x86_64" = "${rvm_archflags:-""}" ]] + if [[ "-arch x86_64" == "${rvm_archflags:-""}" ]] then rvm_configure_flags="${rvm_configure_flags} \ --build=x86_64-apple-darwin$(uname -r) \ --host=x86_64-apple-darwin$(uname -r)" - elif [[ "-arch i386" = "${rvm_archflags:-""}" ]] + elif [[ "-arch i386" == "${rvm_archflags:-""}" ]] then rvm_configure_flags="${rvm_configure_flags} \ --build=i386-apple-darwin$(uname -r) \ diff --git a/scripts/functions/cleanup b/scripts/functions/cleanup index 97e013de67..a76030778e 100644 --- a/scripts/functions/cleanup +++ b/scripts/functions/cleanup @@ -52,7 +52,7 @@ __rvm_reboot() read response - if [[ "yes" = "$response" ]] ; then + if [[ "yes" == "$response" ]] ; then builtin cd $rvm_path command -v __rvm_reset >> /dev/null 2>&1 || \ @@ -61,7 +61,7 @@ __rvm_reboot() mv "$rvm_archives_path" "$HOME/.archives" - if [[ "/" = "$rvm_path" ]] ; then + if [[ "/" == "$rvm_path" ]] ; then rvm_error "remove '/' ?!... NO!" else if [[ -d "$rvm_path" ]] ; then __rvm_rm_rf "$rvm_path" ; fi diff --git a/scripts/functions/gemset b/scripts/functions/gemset index 28eff72bdf..90041d2ae7 100644 --- a/scripts/functions/gemset +++ b/scripts/functions/gemset @@ -8,7 +8,7 @@ __rvm_current_gemset() # We only care about the stuff to the right of the separator. current_gemset="${current_gemset##*${rvm_gemset_separator:-@}}" - if [[ "${current_gemset}" = "${GEM_HOME:-}" ]] ; then + if [[ "${current_gemset}" == "${GEM_HOME:-}" ]] ; then echo '' else echo "${current_gemset}" diff --git a/scripts/functions/implode b/scripts/functions/implode index d4e248242e..3c3947f15b 100644 --- a/scripts/functions/implode +++ b/scripts/functions/implode @@ -14,7 +14,7 @@ __rvm_implode_binaries() rvm_log "Removing rvm wrappers in $rvm_bin_path" \find "$rvm_bin_path" -type l | while read symlinked_rvm_file; do - if [[ "$(readlink "$symlinked_rvm_file")" = "$rvm_wrappers_path/"* ]]; then + if [[ "$(readlink "$symlinked_rvm_file")" == "$rvm_wrappers_path/"* ]]; then __rvm_rm_rf "$symlinked_rvm_file" fi done @@ -33,9 +33,9 @@ __rvm_implode() read response - if [[ "yes" = "$response" ]] ; then + if [[ "yes" == "$response" ]] ; then - if [[ "/" = "$rvm_path" ]] ; then + if [[ "/" == "$rvm_path" ]] ; then rvm_error "remove '/' ?!... Ni!" @@ -52,7 +52,7 @@ __rvm_implode() echo "$rvm_path has been removed." - if [[ "$rvm_path" = "/usr/local/rvm"* && -f "/usr/local/lib/rvm" ]]; then + if [[ "$rvm_path" == "/usr/local/rvm"* && -f "/usr/local/lib/rvm" ]]; then rvm_log "Removing the rvm loader at /usr/local/lib/rvm" fi @@ -66,7 +66,7 @@ __rvm_implode() fi break - elif [[ "no" = "$response" ]] ; then + elif [[ "no" == "$response" ]] ; then rvm_log "Psycologist intervened, cancelling implosion, crisis avoided :)" break diff --git a/scripts/functions/manage/base b/scripts/functions/manage/base index 2feeb1e075..31f80ca7ab 100644 --- a/scripts/functions/manage/base +++ b/scripts/functions/manage/base @@ -483,7 +483,7 @@ __rvm_fetch_ruby() rvm_ruby_package_file="${rvm_ruby_package_file:-"$rvm_ruby_package_name"}" - if [[ "ruby" = "$rvm_ruby_interpreter" ]] + if [[ "ruby" == "$rvm_ruby_interpreter" ]] then rvm_archive_extension="${rvm_archive_extension:-tar.bz2}" else @@ -735,7 +735,7 @@ __rvm_fetch_ruby() then true "${rvm_ruby_url:="$rvm_ruby_repo_url/trunk"}" - elif [[ "${rvm_ruby_major_version:-""}" = "9" ]] + elif [[ "${rvm_ruby_major_version:-""}" == "9" ]] then if [[ -z "${rvm_ruby_minor_version:-""}" || "${rvm_ruby_minor_version:-""}" = 3 ]] @@ -1084,7 +1084,7 @@ __rvm_post_install() __rvm_generate_default_docs() { - if [[ "$rvm_docs_flag" = "1" && "$rvm_ruby_interpreter" != "macruby" ]] + if [[ "$rvm_docs_flag" == "1" && "$rvm_ruby_interpreter" != "macruby" ]] then __rvm_run_with_env "docs.generate" "$rvm_ruby_string" \ "rvm docs generate-ri" "Attempting to generate ri documentation..." @@ -1179,7 +1179,7 @@ __rvm_manage_rubies() manage_result="$result" fi - if (( result == 0 )) && [[ "$action" = "install" ]] + if (( result == 0 )) && [[ "$action" == "install" ]] then __rvm_record_install "$current_ruby_string" fi @@ -1206,7 +1206,7 @@ __rvm_manage_rubies() (( result == 0 || manage_result > 0 )) || manage_result="$result" # record as current_manage_string to prevent it being overridden. - if (( result == 0 )) && [[ "$action" = "install" ]] + if (( result == 0 )) && [[ "$action" == "install" ]] then __rvm_record_install "$ruby_string" fi diff --git a/scripts/functions/manage/jruby b/scripts/functions/manage/jruby index 027bcc031f..c1a414c9e9 100644 --- a/scripts/functions/manage/jruby +++ b/scripts/functions/manage/jruby @@ -8,7 +8,7 @@ jruby_install() return 1 fi - if [[ "Darwin" = "$(uname)" ]] + if [[ "Darwin" == "$(uname)" ]] then java_version=$(java -version 2>&1 | awk -F'"' '/ version /{print $2}') case "$java_version" in diff --git a/scripts/functions/manage/macruby b/scripts/functions/manage/macruby index 21eaf1a9ff..06f94d7189 100644 --- a/scripts/functions/manage/macruby +++ b/scripts/functions/manage/macruby @@ -2,7 +2,7 @@ macruby_install() { - if [[ "Darwin" = "$(uname)" ]] + if [[ "Darwin" == "$(uname)" ]] then if (( rvm_head_flag == 1 )) then @@ -30,7 +30,7 @@ macruby_install() return $result fi - elif [[ "nightly" = "$rvm_ruby_version" ]] ; then + elif [[ "nightly" == "$rvm_ruby_version" ]] ; then __rvm_db "macruby_nightly_version" "macruby_nightly_version" macruby_path="/Library/Frameworks/MacRuby.framework/Versions/${macruby_nightly_version}/usr/bin" unset macruby_nightly_version @@ -114,7 +114,7 @@ RubyWrapper chmod +x $file_name fi - if [[ "$binary_name" = "ruby" ]] + if [[ "$binary_name" == "ruby" ]] then echo "$ruby_wrapper" \ > "${rvm_bin_path:-"$rvm_bin_path/bin"}/$rvm_ruby_string" diff --git a/scripts/functions/manage/ree b/scripts/functions/manage/ree index 89f56a839c..02cb57d069 100644 --- a/scripts/functions/manage/ree +++ b/scripts/functions/manage/ree @@ -55,7 +55,7 @@ ree_install() rvm_configure_flags="${rvm_configure_flags//--/-c --}" fi - if [[ "Darwin" = "$(uname)" && ("1.8.6" = "$rvm_ruby_version" || "1.8.7" = "$rvm_ruby_version") && ! "$rvm_ree_options" =~ "--no-tcmalloc" ]] + if [[ "Darwin" == "$(uname)" && ("1.8.6" == "$rvm_ruby_version" || "1.8.7" == "$rvm_ruby_version") && ! "$rvm_ree_options" =~ "--no-tcmalloc" ]] then rvm_ree_options="${rvm_ree_options} --no-tcmalloc" fi diff --git a/scripts/functions/pkg b/scripts/functions/pkg index 747809dd73..0e56beda43 100644 --- a/scripts/functions/pkg +++ b/scripts/functions/pkg @@ -69,7 +69,7 @@ install_package() unset configure_flags - if [[ "$action" = "uninstall" ]] ; then + if [[ "$action" == "uninstall" ]] ; then __rvm_run "$package/make.uninstall" \ "/usr/bin/make uninstall" \ @@ -125,7 +125,7 @@ curl() openssl() { package="openssl" ; version="0.9.8n" ; archive_format="tar.gz" - if [[ "Darwin" = "$(uname)" ]] ; then + if [[ "Darwin" == "$(uname)" ]] ; then if [[ ! -z "$rvm_archflags" ]]; then @@ -141,16 +141,16 @@ openssl() hw_cpu64bit=$(sysctl hw.cpu64bit_capable | awk '{print $2}') fi - if [[ "Power Macintosh" = "$hw_machine" ]] ; then + if [[ "Power Macintosh" == "$hw_machine" ]] ; then - if [[ $hw_cpu64bit = 1 ]]; then + if [[ $hw_cpu64bit == 1 ]]; then openssl_os="darwin64-ppc-cc" else openssl_os="darwin-ppc-cc" fi else - if [[ $hw_cpu64bit = 1 ]]; then + if [[ $hw_cpu64bit == 1 ]]; then openssl_os="darwin64-x86_64-cc" else openssl_os="darwin-i386-cc" @@ -207,7 +207,7 @@ gettext() libxml2() { package="libxml2" ; version="2.7.3" ; archive_format="tar.gz" - if [[ "Darwin" = "$(uname)" ]] ; then + if [[ "Darwin" == "$(uname)" ]] ; then configure="./configure --prefix=$rvm_usr_path --build=i686-apple-darwin$(uname -r) --host=i686-apple-darwin$(uname -r)" fi install_package @@ -225,7 +225,7 @@ libxslt() libyaml() { package="yaml" ; version="0.1.4" ; archive_format="tar.gz" - if [[ "Darwin" = "$(uname)" ]] + if [[ "Darwin" == "$(uname)" ]] then unset rvm_configure_env fi diff --git a/scripts/functions/rvmrc b/scripts/functions/rvmrc index a97b7fc859..dd912da4f7 100644 --- a/scripts/functions/rvmrc +++ b/scripts/functions/rvmrc @@ -304,7 +304,7 @@ __rvm_project_rvmrc() while : ; do - if [[ -z "$working_dir" || "$HOME" = "$working_dir" || "/" = "$working_dir" ]] + if [[ -z "$working_dir" || "$HOME" == "$working_dir" || "/" == "$working_dir" ]] then if [[ -n "${rvm_current_rvmrc:-""}" ]] then diff --git a/scripts/gemsets b/scripts/gemsets index 2cdcf7bb6c..44b820640c 100644 --- a/scripts/gemsets +++ b/scripts/gemsets @@ -157,7 +157,7 @@ gemset_create() continue fi - if [[ -z "$gemset" || "$gemset" = *"${rvm_gemset_separator:-"@"}" ]] + if [[ -z "$gemset" || "$gemset" == *"${rvm_gemset_separator:-"@"}" ]] then rvm_error "Can not create gemset '$gemset', Missing name. " continue @@ -207,7 +207,7 @@ gemset_list() for gemset in "${rvm_gems_path:-${rvm_path}/gems}/${rvm_ruby_string}${rvm_gemset_separator:-@}"* do gemset="${gemset##*${rvm_gemset_separator:-@}}" - if [[ "${gemset}" = "${current_gemset}" ]] + if [[ "${gemset}" == "${current_gemset}" ]] then if [[ "${args[0]:-""}" != "strings" ]] then @@ -264,7 +264,7 @@ gemset_delete() printf "(anything other than 'yes' will cancel) > " read response - if [[ "yes" = "$response" ]] + if [[ "yes" == "$response" ]] then if [[ -L "$gemdir/cache" ]] then @@ -309,7 +309,7 @@ gemset_empty() echo -n "(anything other than 'yes' will cancel) > " read response - if [[ "yes" = "$response" ]] + if [[ "yes" == "$response" ]] then for entry in "$gemdir"/bin/* "$gemdir"/doc/* "$gemdir"/gems/* "$gemdir"/specifications/* ; do __rvm_rm_rf "$entry" diff --git a/scripts/hash b/scripts/hash index c65dc63cc3..cbd8512f78 100755 --- a/scripts/hash +++ b/scripts/hash @@ -23,7 +23,7 @@ hash() eval "length=\${#_hash_${hash_name}_keys[@]}" for (( index=$__array_start ; index < $length; index++ )) ; do eval "key=\"\${_hash_${hash_name}_keys[$index]}\"" - if [[ "$hash_key" = "$key" ]] ; then + if [[ "$hash_key" == "$key" ]] ; then eval "echo -n \${_hash_${hash_name}_values[$index]}" break fi diff --git a/scripts/hook b/scripts/hook index b438a2bcab..97ad127ab4 100755 --- a/scripts/hook +++ b/scripts/hook @@ -6,7 +6,7 @@ true ${rvm_verbose_flag:=0} ${rvm_debug_flag:=0} "${rvm_hook:=}" if [[ -n "$rvm_hook" ]] then - if [[ "$PWD/.rvm/hooks/$rvm_hook" = "$rvm_hooks_path/$rvm_hook" ]] + if [[ "$PWD/.rvm/hooks/$rvm_hook" == "$rvm_hooks_path/$rvm_hook" ]] then hooks=( "$rvm_hooks_path/$rvm_hook") else diff --git a/scripts/info b/scripts/info index c4d4f0bb82..8b851dd99d 100755 --- a/scripts/info +++ b/scripts/info @@ -105,7 +105,7 @@ $(__rvm_version) permissions: $(\ls -la "$rvm_path" "$rvm_rubies_path") " - if [[ "Darwin" = "$(uname)" ]] ; then + if [[ "Darwin" == "$(uname)" ]] ; then rvm_info="$rvm_info uname -r: $(uname -r) uname -m: $(uname -m) diff --git a/scripts/list b/scripts/list index adc33b1fb4..508d80ae9f 100755 --- a/scripts/list +++ b/scripts/list @@ -24,7 +24,7 @@ list_gemsets() { local all_rubies version versions ruby_version_name current_ruby selected system_ruby system_version string binary - if [[ "${1:-""}" = "strings" ]] + if [[ "${1:-""}" == "strings" ]] then list_gemset_strings return 0 @@ -64,7 +64,7 @@ list_gemsets() printf "\n" - if [[ "$version" = "$current_ruby" ]] + if [[ "$version" == "$current_ruby" ]] then printf "=> " else @@ -110,7 +110,7 @@ list_default() { local version string - if [[ "${args[0]:-""}" = "string" ]] + if [[ "${args[0]:-""}" == "string" ]] then "$rvm_scripts_path/alias" show default 2>/dev/null | \ awk -F"${rvm_gemset_separator:-"@"}" '{print $1}' | \ @@ -218,7 +218,7 @@ list_known_strings() list_known() { - if [[ "${1:-""}" = "strings" ]] + if [[ "${1:-""}" == "strings" ]] then list_known_strings return 0 @@ -249,7 +249,7 @@ list_rubies() local current_ruby rubies version selected system_ruby system_version \ string binary - if [[ "${1:-""}" = "strings" ]] + if [[ "${1:-""}" == "strings" ]] then list_rubies_strings return 0 @@ -287,7 +287,7 @@ list_rubies() printf "\n" - if [[ "$version" = "$current_ruby" ]]; then + if [[ "$version" == "$current_ruby" ]]; then printf "=> " else printf " " diff --git a/scripts/manage b/scripts/manage index 94725a0c85..85c56a245f 100755 --- a/scripts/manage +++ b/scripts/manage @@ -1,7 +1,7 @@ #!/usr/bin/env bash sys=$( uname -s ) -if [[ "${sys}" = AIX ]] +if [[ "${sys}" == AIX ]] then name_opt=-name else diff --git a/scripts/migrate b/scripts/migrate index 122e63445c..61a5d4a440 100755 --- a/scripts/migrate +++ b/scripts/migrate @@ -56,7 +56,7 @@ migrate_rubies() elif [[ -z "$expanded_destination" ]]; then die_with_error "Could not expand destination ruby '$destination_ruby'" - elif [[ "$expanded_destination" = "$expanded_source" ]]; then + elif [[ "$expanded_destination" == "$expanded_source" ]]; then die_with_error "Source and Destination Ruby are the same ($expanded_destination)" elif [[ ! -d "$rvm_rubies_path/$expanded_source" ]]; then @@ -73,7 +73,7 @@ migrate_rubies() echo "Moving gemsets..." while read -r origin_gemset; do - [[ "$origin_gemset" = "$expanded_source" || "$origin_gemset" = "${expanded_source}${rvm_gemset_separator:-"@"}"* ]] || continue + [[ "$origin_gemset" == "$expanded_source" || "$origin_gemset" == "${expanded_source}${rvm_gemset_separator:-"@"}"* ]] || continue destination_gemset="$expanded_destination" @@ -114,7 +114,7 @@ migrate_rubies() migrate_alias_name="${alias_pair/=*/}" - if [[ "$migrate_ruby_name" = "$expanded_source" || "$migrate_ruby_name" = "${expanded_source}${rvm_gemset_separator:-"@"}"* ]]; then + if [[ "$migrate_ruby_name" == "$expanded_source" || "$migrate_ruby_name" == "${expanded_source}${rvm_gemset_separator:-"@"}"* ]]; then migrate_new_alias_name="${migrate_ruby_name/$expanded_source/$expanded_destination}" @@ -147,7 +147,7 @@ migrate_rubies() linked_binary_name="$(basename "$expanded_symlink")" - [[ "$binary_name" = "$linked_binary_name-$expanded_source" || "$binary_name" = "$expanded_source" ]] && continue + [[ "$binary_name" == "$linked_binary_name-$expanded_source" || "$binary_name" == "$expanded_source" ]] && continue new_wrapper_destination="${expanded_symlink/$expanded_source/$expanded_destination}" diff --git a/scripts/monitor b/scripts/monitor index 5f55a94d0a..112c8bb2d8 100755 --- a/scripts/monitor +++ b/scripts/monitor @@ -9,7 +9,7 @@ rvm_monitor_sleep="${rvm_monitor_sleep:-2}" timestamp() { - if [[ "Darwin" = "$(uname)" ]] ; then + if [[ "Darwin" == "$(uname)" ]] ; then echo $(stat -f "%m" $1) else echo $(stat -c "%Y" $1) @@ -65,11 +65,11 @@ while : ; do if [[ "$(array_length "changed_${framework}_files")" -gt 0 ]] ; then rvm_ruby_strings=$original_ruby_strings rvm_ruby_string=$original_ruby_string - if [[ "spec" = "$framework" ]] ; then + if [[ "spec" == "$framework" ]] ; then rvm_action="spec" rvm_ruby_args="spec/spec_helper.rb ${changed_spec_files[*]}" "$rvm_scripts_path/set" $rvm_action $rvm_ruby_args - elif [[ "test" = "$framework" ]] ; then + elif [[ "test" == "$framework" ]] ; then rvm_action="ruby" rvm_ruby_args=" -r$(echo "${changed_test_files[*]}" | sed 's/ / -r/g') test/test_helper.rb" "$rvm_scripts_path/set" $rvm_action $rvm_ruby_args @@ -80,11 +80,11 @@ while : ; do if [[ "$(array_length "changed_code_files")" -gt 0 ]] ; then rvm_ruby_strings=$original_ruby_strings rvm_ruby_string=$original_ruby_string - if [[ "spec" = "$framework" ]] ; then + if [[ "spec" == "$framework" ]] ; then rvm_action="spec" rvm_ruby_args="spec/" "$rvm_scripts_path/set" $rvm_action $rvm_ruby_args - elif [[ "test" = "$framework" ]] ; then + elif [[ "test" == "$framework" ]] ; then rvm_action="rake" rvm_ruby_args="test" "$rvm_scripts_path/set" "$rvm_action" $rvm_ruby_args diff --git a/scripts/requirements b/scripts/requirements index 36ffd6efd3..981f9cf659 100755 --- a/scripts/requirements +++ b/scripts/requirements @@ -2,7 +2,7 @@ system="$(uname)" -if [[ "Linux" = "$system" ]] +if [[ "Linux" == "$system" ]] then for file in /etc/*-release do @@ -125,7 +125,7 @@ dependencies: ironruby: #The Mono Runtime and Development Platform (version 2.6 or greater is recommended). " fi -elif [[ "$MACHTYPE" = *darwin* ]] +elif [[ "$MACHTYPE" == *darwin* ]] then release="( $(sw_vers -productName) )" diff --git a/scripts/selector b/scripts/selector index 0d89f54455..1d0ef7c6d4 100755 --- a/scripts/selector +++ b/scripts/selector @@ -47,7 +47,7 @@ __rvm_select() case "$rvm_ruby_interpreter" in macruby) - if [[ "Darwin" = "$(uname)" ]] + if [[ "Darwin" == "$(uname)" ]] then rvm_ruby_package_name="${rvm_ruby_interpreter}-${rvm_ruby_version}" if (( ${rvm_head_flag:=0} == 1 )) @@ -57,7 +57,7 @@ __rvm_select() __rvm_db "macruby_repo_url" "rvm_ruby_repo_url" rvm_ruby_url="$rvm_ruby_repo_url" - elif [[ "nightly" = "${rvm_ruby_version:-""}" ]] + elif [[ "nightly" == "${rvm_ruby_version:-""}" ]] then __rvm_db "macruby_nightly_url" "rvm_ruby_url" rvm_ruby_package_name="${rvm_ruby_interpreter}_nightly-${rvm_ruby_version}" @@ -89,7 +89,7 @@ __rvm_select() # rbx-* => * is a remote branch, eg rbx-master, rbx-2.0pre # rbx-t1.2.3 => tag 1.2.3 of master branch # - if [[ "${rvm_ruby_version}" = "2.0pre" ]] + if [[ "${rvm_ruby_version}" == "2.0pre" ]] then rvm_ruby_repo_branch="hydra" fi @@ -150,7 +150,7 @@ __rvm_select() maglev_url="$(__rvm_db "maglev_url")" system="$(uname -s)" - if [[ "$MACHTYPE" = x86_64-apple-darwin* ]] + if [[ "$MACHTYPE" == x86_64-apple-darwin* ]] then arch="i386" # Anyone else hear circus musik? ;) else @@ -340,7 +340,7 @@ __rvm_select() rvm_ruby_binary="$rvm_ruby_home/bin/ruby" rvm_ruby_irbrc="$rvm_ruby_home/.irbrc" - if [[ "maglev" = "$rvm_ruby_interpreter" ]] + if [[ "maglev" == "$rvm_ruby_interpreter" ]] then export MAGLEV_HOME="$rvm_ruby_home" export GEMSTONE_GLOBAL_DIR=$MAGLEV_HOME @@ -443,7 +443,7 @@ __rvm_use() return $? fi - if [[ "system" = ${rvm_ruby_interpreter:="system"} ]] + if [[ "system" == ${rvm_ruby_interpreter:=="system"} ]] then __rvm_use_system else @@ -455,7 +455,7 @@ __rvm_use() IRBRC="$rvm_ruby_irbrc" # Handle MagLev pre-installed gems - if [[ "maglev" = "$rvm_ruby_interpreter" ]] + if [[ "maglev" == "$rvm_ruby_interpreter" ]] then GEM_PATH="$GEM_PATH:$MAGLEV_HOME/lib/maglev/gems/1.8/" fi @@ -583,7 +583,7 @@ __rvm_use() ruby_alias="" ; rvm_ruby_alias="" fi - if [[ "maglev" = "${rvm_ruby_interpreter:-""}" ]] + if [[ "maglev" == "${rvm_ruby_interpreter:-""}" ]] then export MAGLEV_HOME="$rvm_ruby_home" export GEMSTONE_GLOBAL_DIR=$MAGLEV_HOME @@ -648,7 +648,7 @@ __rvm_ruby_string() && [[ -n "$expanded_alias_name" ]] then rvm_ruby_string="$expanded_alias_name" - elif [[ "$rvm_ruby_string" = default ]] + elif [[ "$rvm_ruby_string" == default ]] then # Default is not a known value. Instead, we need to therefore set it to system. rvm_ruby_string="system" diff --git a/scripts/set b/scripts/set index e6f9494de6..9f595b3e07 100755 --- a/scripts/set +++ b/scripts/set @@ -23,7 +23,7 @@ __rvm_ruby_do() rvm_hook="before_do" ; source "$rvm_scripts_path/hook" - if [[ "$action" = "exec" ]] + if [[ "$action" == "exec" ]] then command="${args[@]}" # rvm exec is a special case. else @@ -37,7 +37,7 @@ __rvm_ruby_do() elif [[ -x "$rvm_ruby_gem_home/bin/$binary" ]] then binary="$rvm_ruby_gem_home/bin/$binary" - elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(command -v $binary)" ]] + elif [[ "system" == "$rvm_ruby_string" ]] && [[ -x "$(command -v $binary)" ]] then binary="$(basename $(command -v $binary) 2>/dev/null)" else @@ -55,7 +55,7 @@ __rvm_ruby_do() load_path="$(dirname $(command -v $binary) 2>/dev/null):$rvm_ruby_load_path" # TODO: the else case below should be run if $args =~ /\.rb$/ - if [[ "ruby" = "$(basename $binary)" && "$rvm_benchmark_flag" -ne 1 ]] + if [[ "ruby" == "$(basename $binary)" && "$rvm_benchmark_flag" -ne 1 ]] then case "${args[@]}" in (exec[[:space:]]*) diff --git a/scripts/snapshot b/scripts/snapshot index 23ec222629..a5a863b953 100755 --- a/scripts/snapshot +++ b/scripts/snapshot @@ -1,7 +1,7 @@ #!/usr/bin/env bash sys=$( uname -s ) -if [[ "${sys}" = AIX ]] ; then +if [[ "${sys}" == AIX ]] ; then name_opt=-name else name_opt=-iname @@ -237,7 +237,7 @@ snapshot_load() local alias_ruby="${package_info/*=}" "$rvm_scripts_path/alias" create "$alias_name" "$alias_ruby" - if [[ "$alias_name" = "default" ]]; then + if [[ "$alias_name" == "default" ]]; then (source "$rvm_scripts_path/rvm" && rvm use "$alias_ruby" --default) >/dev/null 2>&1 result="$?" __error_on_result "$result" "Error setting default to $alias_ruby" && return "$result" diff --git a/scripts/upgrade b/scripts/upgrade index a82bcde41f..b8b1164cd2 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -129,7 +129,7 @@ if [[ -z "${source_ruby:-""}" ]] ; then exit 1 fi -if [[ "help" = "$source_ruby" ]] ; then +if [[ "help" == "$source_ruby" ]] ; then usage exit 0 fi diff --git a/scripts/wrapper b/scripts/wrapper index 62cd969da8..ad52314b70 100755 --- a/scripts/wrapper +++ b/scripts/wrapper @@ -97,7 +97,7 @@ symlink_binary() wrap_binary() { # We wrap when the given binary is in the path or override_check is set to one. - if [[ "$override_check" = "1" ]] || command -v $binary_name > /dev/null + if [[ "$override_check" == "1" ]] || command -v $binary_name > /dev/null then wrap else