Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into hotfix/1.25.20

  • Loading branch information...
commit 780470e743ebd122da405f6eb3fea65ec371dde4 2 parents 28a6941 + 4be1cbe
@mpapis mpapis authored
Showing with 591 additions and 330 deletions.
  1. +1 −1  bin/rvm-prompt
  2. +2 −2 config/db
  3. +3 −3 config/known
  4. +2 −2 config/known_strings
  5. +1 −0  config/md5
  6. +1 −0  config/sha512
  7. +11 −0 patches/ruby/changeset_r45225.diff
  8. +22 −0 patches/ruby/changeset_r45240.diff
  9. +1 −0  patchsets/ruby/1.9.3/p545/float_warnings
  10. +18 −0 patchsets/ruby/1.9.3/p545/railsexpress
  11. +0 −2  patchsets/ruby/2.0.0/default
  12. +4 −0 patchsets/ruby/2.0.0/p0/default
  13. +4 −0 patchsets/ruby/2.0.0/p195/default
  14. +4 −0 patchsets/ruby/2.0.0/p247/default
  15. +4 −0 patchsets/ruby/2.0.0/p353/default
  16. +2 −0  patchsets/ruby/2.0.0/p451/default
  17. +1 −0  patchsets/ruby/2.0.0/p451/float_warnings
  18. +5 −0 patchsets/ruby/2.0.0/p451/railsexpress
  19. +2 −0  patchsets/ruby/2.1.0/default
  20. +2 −0  patchsets/ruby/2.1.1/default
  21. +1 −0  patchsets/ruby/2.1.1/float_warnings
  22. +10 −0 patchsets/ruby/2.1.1/railsexpress
  23. +1 −1  rvm-test
  24. +1 −1  rvm-test-rvm1/load_ruby-version_comment_test.sh
  25. +3 −3 rvm-test-rvm1/rvm_project_rvmrc_comment_test.sh
  26. +19 −22 scripts/base
  27. +14 −3 scripts/cli
  28. +24 −9 scripts/external
  29. +2 −1  scripts/functions/build
  30. +11 −4 scripts/functions/build_config_system
  31. +3 −1 scripts/functions/build_requirements_helpers
  32. +10 −9 scripts/functions/cleanup
  33. +3 −1 scripts/functions/cli
  34. +10 −5 scripts/functions/environment
  35. +3 −1 scripts/functions/gemset
  36. +143 −120 scripts/functions/installer
  37. +11 −11 scripts/functions/manage/base_remove
  38. +8 −1 scripts/functions/manage/ree
  39. +7 −0 scripts/functions/osx-ssl-certs
  40. +16 −2 scripts/functions/requirements/centos
  41. +10 −2 scripts/functions/requirements/osx_port
  42. +1 −0  scripts/functions/requirements/scientific
  43. +1 −2  scripts/functions/requirements/ubuntu
  44. +2 −2 scripts/functions/rubygems
  45. +42 −39 scripts/functions/rvmrc
  46. +2 −1  scripts/functions/rvmrc_project
  47. +8 −3 scripts/{ → functions}/selector
  48. +1 −1  scripts/{ → functions}/selector_gemsets
  49. +3 −1 scripts/{ → functions}/selector_interpreters
  50. +2 −1  scripts/{ → functions}/selector_late
  51. +8 −4 scripts/{ → functions}/selector_parse
  52. +5 −2 scripts/functions/support
  53. +28 −8 scripts/functions/utility
  54. +25 −10 scripts/functions/utility_logging
  55. +1 −1  scripts/functions/utility_system
  56. +46 −42 scripts/rvm
  57. +14 −4 scripts/set
  58. +2 −2 scripts/upgrade
View
2  bin/rvm-prompt
@@ -131,7 +131,7 @@ then
(1.9.2) unicode="➈❷" ;;
(1.9.3) unicode="➈❸" ;;
(2.0.0) unicode="" ;;
- (2.1.0) unicode="➋➀" ;;
+ (2.1.*) unicode="➋➀" ;;
(*) unicode="⦿" ;;
esac ;;
(*) unicode="⦿" ;;
View
4 config/db
@@ -37,7 +37,7 @@ ruby_head_rubygems_version=head
gem_gem-wrappers_version=>=1.2.4
gem_gem-empty_version=>=1.0.0
gem_rdoc_version=>=4.1.1
-rbx_version=2.2.5
+rbx_version=2.2.6
rbx_1.0.0_patch_level=20100514
rbx_1.0.1_patch_level=20100603
rbx_1.1.0_patch_level=20100923
@@ -64,7 +64,7 @@ kiji_version=head
mruby_repo_url=git://github.com/mruby/mruby.git
mruby_url=https://github.com/mruby/mruby/archive
mruby_version=1.0.0
-jruby_version=1.7.10
+jruby_version=1.7.11
jruby_repo_url=git://github.com/jruby/jruby.git
jruby_url=http://jruby.org.s3.amazonaws.com/downloads
macruby_version=0.12
View
6 config/known
@@ -6,7 +6,7 @@
[ruby-]1.9.3[-p545]
[ruby-]2.0.0-p353
[ruby-]2.0.0[-p451]
-[ruby-]2.1.1
+[ruby-]2.1[.1]
[ruby-]2.1-head
ruby-head
@@ -29,13 +29,13 @@ mruby[-head]
jruby-1.6.8
jruby-1.7.6
jruby-1.7.9
-jruby[-1.7.10]
+jruby[-1.7.11]
jruby-head
# Rubinius
rbx-2.0.0
rbx-2.1.1
-rbx[-2.2.5]
+rbx[-2.2.6]
rbx-head
# Ruby Enterprise Edition
View
4 config/known_strings
@@ -1,10 +1,10 @@
# this strings are matched only when partial version was provided
jruby-1.5.6
jruby-1.6.8
-jruby-1.7.10
+jruby-1.7.11
rbx-2.0.0
rbx-2.1.0
-rbx-2.2.5
+rbx-2.2.6
ree-1.8.6
ree-1.8.7-2012.02
maglev-1.0.0
View
1  config/md5
@@ -29,6 +29,7 @@ http://jruby.org.s3.amazonaws.com/downloads/1.7.7/jruby-bin-1.7.7.tar.gz=9d6df21
http://jruby.org.s3.amazonaws.com/downloads/1.7.8/jruby-bin-1.7.8.tar.gz=1e68f39d6dba7b6d9db81e24bb6b7d0a
http://jruby.org.s3.amazonaws.com/downloads/1.7.9/jruby-bin-1.7.9.tar.gz=b2e44f1f44837c07068ee453a89f4b55
http://jruby.org.s3.amazonaws.com/downloads/1.7.10/jruby-bin-1.7.10.tar.gz=c84fe9245a73f9cd29f56343b7d2e39a
+http://jruby.org.s3.amazonaws.com/downloads/1.7.11/jruby-bin-1.7.11.tar.gz=d6e6ab72426fa7fdc9ae55950980d877
http://releases.rubini.us/rubinius-2.0.0.tar.bz2=62e379e044c822b81e7b20a27daf133e
http://releases.rubini.us/rubinius-2.1.0.tar.bz2=908053f38fd840c75a93aab7487c20a5
http://releases.rubini.us/rubinius-2.1.1.tar.bz2=6b4df0caec5ea88373e113f97a3b4c72
View
1  config/sha512
@@ -13,6 +13,7 @@ http://jruby.org.s3.amazonaws.com/downloads/1.7.7/jruby-bin-1.7.7.tar.gz=71da2e7
http://jruby.org.s3.amazonaws.com/downloads/1.7.8/jruby-bin-1.7.8.tar.gz=42d54243653ec260abdafecce1143161be63fcc38a80f71ab70fcece4bf91545a2b12ed2319f9fd6f6b41916c398a9a8e89e7f0389f59da56f2739665e74522d
http://jruby.org.s3.amazonaws.com/downloads/1.7.9/jruby-bin-1.7.9.tar.gz=f519f53b1d9f57cfe28982ad70b892dc6fc20fe6601d98d65a1dca9f617a0eb8fff74d0fd82ddb858fe105d05ca7c7bbf3a987677ae0363caa2981bea358c096
http://jruby.org.s3.amazonaws.com/downloads/1.7.10/jruby-bin-1.7.10.tar.gz=160b701f2f500dfab64beb635e5c4dc57760dd422d0fffe8d3cf8d84ee6ea17a877ef77a0087b4888ea9db64ce7750de01a73a51530aa6666a2efdcdccdb89e0
+http://jruby.org.s3.amazonaws.com/downloads/1.7.11/jruby-bin-1.7.11.tar.gz=a53b0fa327b98344cb4a8aad1ba537ddacb709a0e173b1e32656de8a610cb9896e9a4554d54d0d01d2361f8ff1539a0e2ee01308f670df2004225231b704065c
https://rvm.io/binaries/amazon/2013.03/x86_64/ruby-1.9.3-p448.tar.bz2=2e7bc5f6d501928f01de2a6d9035f56f40678d410bc0629ef00e0e70565b49991c4570f19c34faa1bfef2ad4cb460e4c28ee2eaf5c0696a403d0847f17d4c22a
https://rvm.io/binaries/amazon/2013.03/x86_64/ruby-2.0.0-p247.tar.bz2=6929240b591970249153fd7cb9aae47821a3efe60cdda3bfacc334cd7301635d6b71bdbd5e122b5e17d02559b6bad8711ecfbf38aa6f947ed28b5b1154a38efd
https://rvm.io/binaries/arch/libc-2.15/x86_64/ruby-1.9.3-p194.tar.bz2=289f3921543eb096b0d50a2ce7f8655176f6f4dbc8a52aa1342b5238e33f36c9dc78948e4144f41eeca616920ba3422adb0a17d216ec7d2cfaae51f570c1f9b3
View
11 patches/ruby/changeset_r45225.diff
@@ -0,0 +1,11 @@
+--- a/ext/readline/readline.c (revision 45224)
++++ b/ext/readline/readline.c (revision 45225)
+@@ -1974,7 +1974,7 @@
+
+ rl_attempted_completion_function = readline_attempted_completion_function;
+ #if defined(HAVE_RL_PRE_INPUT_HOOK)
+- rl_pre_input_hook = (Function *)readline_pre_input_hook;
++ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
+ #endif
+ #ifdef HAVE_RL_CATCH_SIGNALS
+ rl_catch_signals = 0;
View
22 patches/ruby/changeset_r45240.diff
@@ -0,0 +1,22 @@
+--- a/ext/readline/extconf.rb (revision 45239)
++++ b/ext/readline/extconf.rb (revision 45240)
+@@ -19,6 +19,10 @@
+ return super(func, headers)
+ end
+
++def readline.have_type(type)
++ return super(type, headers)
++end
++
+ dir_config('curses')
+ dir_config('ncurses')
+ dir_config('termcap')
+@@ -94,4 +98,8 @@
+ readline.have_func("rl_redisplay")
+ readline.have_func("rl_insert_text")
+ readline.have_func("rl_delete_text")
++unless readline.have_type("rl_hook_func_t")
++ $DEFS << "-Drl_hook_func_t=Function"
++end
++
+ create_makefile("readline")
View
1  patchsets/ruby/1.9.3/p545/float_warnings
@@ -0,0 +1 @@
+https://raw.github.com/knugie/rvm-patchsets/master/patches/ruby/1.9.3/p545/float_warnings/01-bigdecimal_float_warning.patch
View
18 patchsets/ruby/1.9.3/p545/railsexpress
@@ -0,0 +1,18 @@
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/01-fix-make-clean.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/02-railsbench-gc.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/03-display-more-detailed-stack-trace.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/04-fork-support-for-gc-logging.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/05-track-live-dataset-size.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/06-webrick_204_304_keep_alive_fix.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/07-export-a-few-more-symbols-for-ruby-prof.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/08-thread-variables.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/09-faster-loading.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/10-falcon-st-opt.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/11-falcon-sparse-array.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/12-falcon-array-queue.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/13-railsbench-gc-fixes.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/14-show-full-backtrace-on-stack-overflow.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/15-configurable-fiber-stack-sizes.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/16-backport-psych-20.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/17-fix-missing-c-return-event.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p545/railsexpress/18-fix-process-daemon-call.patch
View
2  patchsets/ruby/2.0.0/default
@@ -1,2 +0,0 @@
-libyaml015
-GH-488
View
4 patchsets/ruby/2.0.0/p0/default
@@ -0,0 +1,4 @@
+libyaml015
+GH-488
+changeset_r45225
+changeset_r45240
View
4 patchsets/ruby/2.0.0/p195/default
@@ -0,0 +1,4 @@
+libyaml015
+GH-488
+changeset_r45225
+changeset_r45240
View
4 patchsets/ruby/2.0.0/p247/default
@@ -0,0 +1,4 @@
+libyaml015
+GH-488
+changeset_r45225
+changeset_r45240
View
4 patchsets/ruby/2.0.0/p353/default
@@ -0,0 +1,4 @@
+libyaml015
+GH-488
+changeset_r45225
+changeset_r45240
View
2  patchsets/ruby/2.0.0/p451/default
@@ -0,0 +1,2 @@
+changeset_r45225
+changeset_r45240
View
1  patchsets/ruby/2.0.0/p451/float_warnings
@@ -0,0 +1 @@
+https://raw.github.com/knugie/rvm-patchsets/master/patches/ruby/2.0.0/p451/float_warnings/01-bigdecimal_float_warning.patch
View
5 patchsets/ruby/2.0.0/p451/railsexpress
@@ -0,0 +1,5 @@
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p451/railsexpress/01-zero-broken-tests.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p451/railsexpress/02-railsexpress-gc.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p451/railsexpress/03-display-more-detailed-stack-trace.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p451/railsexpress/04-show-full-backtrace-on-stack-overflow.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.0.0/p451/railsexpress/05-fix-missing-c-return-event.patch
View
2  patchsets/ruby/2.1.0/default
@@ -1,2 +1,4 @@
libyaml015
GH-488
+changeset_r45225
+changeset_r45240
View
2  patchsets/ruby/2.1.1/default
@@ -0,0 +1,2 @@
+changeset_r45225
+changeset_r45240
View
1  patchsets/ruby/2.1.1/float_warnings
@@ -0,0 +1 @@
+https://raw.github.com/knugie/rvm-patchsets/master/patches/ruby/2.1.1/float_warnings/01-bigdecimal_float_warning.patch
View
10 patchsets/ruby/2.1.1/railsexpress
@@ -0,0 +1,10 @@
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/01-zero-broken-tests.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/02-improve-gc-stats.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/03-display-more-detailed-stack-trace.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/04-show-full-backtrace-on-stack-overflow.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/05-fix-missing-c-return-event.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/06-backport-006e66b6680f60adfb434ee7397f0dbc77de7873.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/07-funny-falcon-stc-density.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/08-funny-falcon-stc-pool-allocation.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/09-aman-opt-aset-aref-str.patch
+https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/2.1.1/railsexpress/10-funny-falcon-method-cache.patch
2  rvm-test
@@ -1 +1 @@
-Subproject commit 3a8647d2a042a65a1c9d5ff4ab2d51066ee3f365
+Subproject commit b10b64575dda67a4fbe12acd4e9dcfdcd2487e8e
View
2  rvm-test-rvm1/load_ruby-version_comment_test.sh
@@ -10,7 +10,7 @@ PATH="$( echo $PATH | sed 's/^.*rvm[^:]*://' )" # env[PATH]!=/rvm/
"$rvm_path/bin/rvm" alias delete default # status=0
"$rvm_path/bin/rvm" alias create default 1.9.3-p448 # status=0
-echo "2.0.0" > .ruby-version
+echo "2.0.0-p353" > .ruby-version
echo "@test" > .ruby-gemset
source "$rvm_path/scripts/rvm"
# env[GEM_HOME]=/2.0.0-p353@test$/
View
6 rvm-test-rvm1/rvm_project_rvmrc_comment_test.sh
@@ -22,7 +22,7 @@ rvm_project_rvmrc_default=1 rvm_promptless=1 __rvm_project_rvmrc
# env[PATH]=/1.9.3-p448/
: load project
-echo "2.0.0" > .ruby-version
+echo "2.0.0-p353" > .ruby-version
rvm use system
# env[GEM_HOME]=/^$/
source "$rvm_path/scripts/initialize"
@@ -66,7 +66,7 @@ rvm_project_rvmrc_default=1 rvm_promptless=1 __rvm_project_rvmrc
# env[PATH]=/1.9.3-p448/
: load project
-echo "2.0.0" > .ruby-version
+echo "2.0.0-p353" > .ruby-version
rvm use default
# env[GEM_HOME]=/1.9.3-p448$/
# env[PATH]=/1.9.3-p448/
@@ -113,7 +113,7 @@ rvm_project_rvmrc_default=1 rvm_promptless=1 __rvm_project_rvmrc
# env[PATH]=/1.9.3-p448/
: load project
-echo "2.0.0" > .ruby-version
+echo "2.0.0-p353" > .ruby-version
rvm use system
source "$rvm_path/scripts/initialize"
# env[rvm_rubies_path]!=/^$/
View
41 scripts/base
@@ -90,28 +90,25 @@ fi
true ${rvm_scripts_path:="$rvm_path/scripts"}
-source "${rvm_scripts_path}/initialize"
-
# Load the general scripts.
# Use rvm_base_except="selector", for example, to override the loading.
-case " ${rvm_base_except:-} " in
- (*[[:space:]]selector[[:space:]]*)
- true # do not load.
- ;;
- (*)
- source "${rvm_scripts_path}/selector"
- source "${rvm_scripts_path}/selector_gemsets"
- source "${rvm_scripts_path}/selector_late"
- source "${rvm_scripts_path}/selector_parse"
- source "${rvm_scripts_path}/selector_interpreters"
- ;;
-esac
+load_rvm_scripts()
+{
+ typeset -a scripts
+ scripts=(
+ selector logging db support utility init cleanup env rvmrc install environment gemset checksum list
+ )
+
+ source "${rvm_scripts_path}/initialize"
+
-typeset -a scripts
-scripts=(
- logging db support utility init cleanup env rvmrc install environment gemset checksum list
-)
-for entry in ${scripts[@]}
-do source "${rvm_scripts_path}/functions/$entry"
-done
-unset scripts entry rvm_base_except
+ for entry in ${scripts[@]}
+ do
+ [[ " ${rvm_base_except:-} " == *" $entry "* ]] ||
+ source "${rvm_scripts_path}/functions/$entry" ||
+ return $?
+ done
+
+ unset rvm_base_except
+}
+load_rvm_scripts
View
17 scripts/cli
@@ -56,7 +56,14 @@ __rvm_parse_args_find_known_flags()
__rvm_parse_args_error_finding_project_file()
{
- rvm_error_message="Could not determine which Ruby to use; $rvm_token should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile."
+ case $? in
+ 101)
+ rvm_error_message="Could not use ruby/gemset from the project file, try 'rvm use $rvm_token' for better explanation."
+ ;;
+ *)
+ rvm_error_message="Could not determine which Ruby to use; $rvm_token should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile."
+ ;;
+ esac
rvm_action="error"
}
@@ -891,8 +898,12 @@ rvm()
unset rvm_ruby_string
export rvm_ruby_strings rvm_in_flag
- "$rvm_scripts_path/set" "$rvm_action" "${rvm_ruby_args[@]}"
- result=$?
+ result=0
+ # run in a subprocess only when a function, when called via PATH just replace the process
+ if rvm_is_a_shell_function
+ then "$rvm_scripts_path/set" "$rvm_action" "${rvm_ruby_args[@]}" || result=$?
+ else exec "$rvm_scripts_path/set" "$rvm_action" "${rvm_ruby_args[@]}" || result=$?
+ fi
# Restore the state pre-sets.
[[ -n "$old_rvm_ruby_string" ]] && rvm_ruby_string=$old_rvm_ruby_string
View
33 scripts/external
@@ -328,7 +328,7 @@ external_propose_name()
external_import_configure()
{
- typeset platform architecture libc
+ typeset platform architecture libc __tmp
if (( ${rvm_install_flag:-0} > 0 ))
then err_command=rvm_warn
@@ -358,6 +358,17 @@ external_import_configure()
rvm_ruby_string="${rvm_ruby_string##*/}"
rvm_ruby_string="${rvm_ruby_string/bin-/}"
rvm_ruby_string="${rvm_ruby_string%.t*}"
+ if
+ [[ -n "${rvm_ruby_name}" ]]
+ then
+ __tmp="$rvm_ruby_string"
+ rvm_ruby_string="${rvm_ruby_name}"
+ if
+ [[ "${rvm_ruby_name}" == "${__tmp}"* ]]
+ then
+ detected_rvm_ruby_name="${rvm_ruby_name#${__tmp}-}"
+ fi
+ fi
__rvm_ruby_package_file "${rvm_ruby_string}"
if
[[ "${rvm_ruby_package_file}" == *bin-* ]]
@@ -398,6 +409,7 @@ external_import_download()
external_import_validate_archive()
{
typeset -a downloaded_names path_to_bin_ruby
+ typeset short_ruby_string
__rvm_read_lines path_to_bin_ruby <(
__rvm_package_list "$rvm_archives_path/${rvm_ruby_package_file}" | __rvm_grep "bin/ruby$"
@@ -405,27 +417,30 @@ external_import_validate_archive()
__rvm_read_lines downloaded_names <(
__rvm_package_list "$rvm_archives_path/${rvm_ruby_package_file}" | __rvm_awk -F/ '{print $1}' | sort -u
)
+ short_ruby_string="${rvm_ruby_string%-${detected_rvm_ruby_name:-}}"
if
[[ "${#path_to_bin_ruby[*]}" -eq 1 ]]
then
__path_to_extract="${path_to_bin_ruby[*]}"
__path_to_extract="${__path_to_extract%bin/ruby}"
elif
- [[ "${rvm_ruby_string}" == "${downloaded_names[*]}" ]]
+ [[ "${short_ruby_string}" == "${downloaded_names[*]}" ]]
then
- __path_to_extract="${rvm_ruby_string}"
+ __path_to_extract="${short_ruby_string}"
elif
- [[ "${rvm_ruby_string/-bin-/-}" == "${downloaded_names[*]}" ]]
+ [[ "${short_ruby_string/-bin-/-}" == "${downloaded_names[*]}" ]]
then
- rvm_ruby_string="${rvm_ruby_string/-bin-/-}"
- __path_to_extract="${rvm_ruby_string}"
+ if [[ -z "${rvm_ruby_string}" ]]
+ then rvm_ruby_string="${short_ruby_string/-bin-/-}"
+ fi
+ __path_to_extract="${short_ruby_string}"
elif
- [[ "${rvm_ruby_string/rbx-/rubinius-}" == "${downloaded_names[*]}" ]]
+ [[ "${short_ruby_string/rbx-/rubinius-}" == "${downloaded_names[*]}" ]]
then
- __path_to_extract="${rvm_ruby_string/rbx-/rubinius-}"
+ __path_to_extract="${short_ruby_string/rbx-/rubinius-}"
else
$err_command "The downloaded package for ${rvm_ruby_url},
-Does not contains single 'bin/ruby' or '${rvm_ruby_string}',
+Does not contains single 'bin/ruby' or '${short_ruby_string}',
Only '${downloaded_names[*]}' were found instead."
return 4
fi
View
3  scripts/functions/build
@@ -308,7 +308,8 @@ __rvm_mri_rubies()
# with things like rbx etc which require a ruby be installed.
__rvm_mri_ruby()
{
- __rvm_mri_rubies "${1:-"ruby-1.9|ruby-2"}" | sort |
+ __rvm_mri_rubies "${1:-"ruby-1.9|ruby-2"}" |
+ __rvm_version_sort |
__rvm_awk 'BEGIN{ selected=$0 } /'"$(__rvm_env_string)"'/{ selected=$0 } END {print $0}'
}
View
15 scripts/functions/build_config_system
@@ -111,8 +111,10 @@ __rvm_setup_compile_environment_system_BSD()
then
export AUTOCONF_VERSION
AUTOCONF_VERSION="$(
- ls -1 /usr/local/bin/autoreconf-* | __rvm_awk -F- '{print $NF}' |
- __rvm_version_sort | __rvm_tail -n 1
+ ls -1 /usr/local/bin/autoreconf-* |
+ __rvm_awk -F- '{print $NF}' |
+ __rvm_version_sort |
+ __rvm_tail -n 1
)"
fi
if
@@ -121,8 +123,10 @@ __rvm_setup_compile_environment_system_BSD()
export AUTOMAKE_VERSION
# FreeBSD might have automake-wrapper
AUTOMAKE_VERSION="$(
- ls -1 /usr/local/bin/automake-1* | __rvm_awk -F- '{print $NF}' |
- __rvm_version_sort | __rvm_tail -n 1
+ ls -1 /usr/local/bin/automake-1* |
+ __rvm_awk -F- '{print $NF}' |
+ __rvm_version_sort |
+ __rvm_tail -n 1
)"
fi
}
@@ -325,6 +329,9 @@ __rvm_setup_compile_environment_flags_tcltk()
{
case "$1" in
(ruby*|ree*)
+ typeset __ruby_version="${1#*-}"
+ __ruby_version="${__ruby_version%%-*}"
+ __rvm_version_compare ${__ruby_version} -ge 2.1.1 ||
[[ " ${rvm_configure_flags[*]} " == *" --with-tcl "* ]] ||
[[ " ${rvm_configure_flags[*]} " == *" --with-tk "* ]] ||
[[ " ${rvm_configure_flags[*]} " == *" --without-tcl "* ]] ||
View
4 scripts/functions/build_requirements_helpers
@@ -127,7 +127,9 @@ requirements_version_minimal()
then return 0
fi
typeset latest_version="$(
- requirements_${__lib_type}_version_list $1 | __rvm_version_sort | __rvm_tail -n 1
+ requirements_${__lib_type}_version_list $1 |
+ __rvm_version_sort |
+ __rvm_tail -n 1
)"
if
[[ -z "${latest_version}" ]] ||
View
19 scripts/functions/cleanup
@@ -31,13 +31,13 @@ __rvm_rm_rf_verbose()
return 1
;;
(*)
- [[ -n "${target}" ]] ||
- {
+ if
+ [[ -z "${target}" ]]
+ then
rvm_debug "__rvm_rm_rf target not given"
return 1
- }
- if
- [[ -d "${target}" ]] # Directory
+ elif
+ [[ -d "${target}" ]] # directory
then
\rm -rf "${target}" ||
{
@@ -46,7 +46,7 @@ __rvm_rm_rf_verbose()
return $ret
}
elif
- [[ -f "${target}" || -L "${target}" ]] # File / Symbolic Link
+ [[ -f "${target}" || -L "${target}" ]] # file / broken symbolic link
then
\rm -f "${target}" ||
{
@@ -56,17 +56,18 @@ __rvm_rm_rf_verbose()
}
else
rvm_debug "__rvm_rm_rf already gone: $*"
- return 0 # already gone!?
fi
;;
esac
+ true # for OSX
}
# Cleans up temp folders for a given prefix ($1),
# or the current process id.
__rvm_cleanup_tmp()
{
- if [[ -d "${rvm_tmp_path}/" ]]
+ if
+ [[ -d "${rvm_tmp_path}/" ]]
then
case "${rvm_tmp_path%\/}" in
*tmp)
@@ -74,5 +75,5 @@ __rvm_cleanup_tmp()
;;
esac
fi
- return 0
+ true # for osx
}
View
4 scripts/functions/cli
@@ -217,7 +217,9 @@ __rvm_cli_autoupdate_execute()
__rvm_cli_autoupdate()
{
- [[ " $* " == *" install "* && " $* " != *" help install "* ]] || return 0
+ [[ " $* " == *" install "* && " $* " != *" help install "* ]] ||
+ [[ " $* " == *" list known "* ]] ||
+ return 0
typeset online_version version_release
case "${rvm_autoupdate_flag:-1}" in
View
15 scripts/functions/environment
@@ -283,10 +283,15 @@ __rvm_teardown()
__rvm_teardown_if_broken()
{
- if __function_on_stack __rvm_load_project_config
- then true # inside of loading .rvmrc
- elif (( ${__rvm_env_loaded:-0} > 0 ))
- then __rvm_teardown_final
+ if
+ __function_on_stack __rvm_load_project_config ||
+ __function_on_stack __rvm_with
+ then
+ true # inside of loading .rvmrc / __rvm_with
+ elif
+ (( ${__rvm_env_loaded:-0} > 0 ))
+ then
+ __rvm_teardown_final
fi
}
@@ -340,7 +345,7 @@ __rvm_ensure_is_a_function()
{
if [[ ${rvm_reload_flag:=0} == 1 ]] || ! is_a_function rvm
then
- for script in version selector selector_gemsets selector_late cd functions/cli cli override_gem
+ for script in version functions/selector cd functions/cli cli override_gem
do
if [[ -f "$rvm_scripts_path/$script" ]]
then
View
4 scripts/functions/gemset
@@ -162,7 +162,9 @@ gem_install_force()
install_params=()
__available_gem="$( ls -v1 "${rvm_path}/gem-cache"/${gem_name}-${version_check}.gem 2>/dev/null | tail -n 1 )"
- if [[ -z "${__available_gem}" && -n "${gem_version}" ]]
+ if [[ -n "${__available_gem}" ]]
+ then install_params+=( --local )
+ elif [[ -n "${gem_version}" ]]
then install_params+=( -v "${gem_version}" )
fi
View
263 scripts/functions/installer
@@ -1,15 +1,50 @@
#!/usr/bin/env bash
-install_rvm_step()
+install_run_debug_time()
{
- typeset __status=0
+ # 1st s = start, 1st e = end, 1st d = difference, 2nd s = seconds, 2nd n = nanoseconds
+ typeset __ss __sn __es __en __ds __dn __time __status=0
rvm_debug "step> '$1' started"
- $1 || __status=$?
+ __ss="$(date +%s:%N)"
+ "$@" || __status=$?
+ __es="$(date +%s:%N)"
+
+ # split seconds and nano
+ __sn="${__ss#*:}"
+ __sn="${__sn#%N}"
+ __sn="${__sn##*(0)}"
+ __ss="${__ss%:*}"
+ __ss="${__ss##*(0)}"
+ __en="${__es#*:}"
+ __en="${__en#%N}"
+ __en="${__en##*(0)}"
+ __es="${__es%:*}"
+ __es="${__es##*(0)}"
+
+ __ds="$(( __es - __ss ))"
+ __dn=""
+ if
+ [[ -n "${__sn}" && -n "${__en}" ]]
+ then
+ __dn="$(( __en - __sn ))"
+ if
+ (( __dn < 0 ))
+ then
+ __dn="$(( __dn + 1000000000 ))"
+ __ds="$(( __ds - 1 ))"
+ fi
+ fi
+ __time="${__ds}${__dn:+"$(printf ".%09d" "$__dn")"} seconds"
- rvm_debug "step< '$1' finished with ${__status}"
+ rvm_debug "step< '$1' finished with status 0 in ${__time}"
+}
- (( __status == 0 )) || {
+install_rvm_step()
+{
+ install_run_debug_time $1 ||
+ {
+ typeset __status=$?
rvm_error "Installer failed at step '$1' with status ${__status}, please run it with --debug and report a bug."
return ${__status}
}
@@ -35,13 +70,16 @@ install_rvm()
create_install_paths
load_custom_flags
save_custom_flags
+ install_rvm_directories
install_rvm_files
+ install_rvm_scripts
+ cleanup_old_help_and_docs_files
install_rvm_hooks
+ remove_old_hooks
install_binaries
install_gemsets
install_patchsets
install_man_pages
- ensure_scripts_are_executable
setup_configuration_files
)
# not using elif for clarity
@@ -343,7 +381,7 @@ cleanse_old_entities()
#
for script in utility array
do
- if [[ -f "$rvm_path/scripts/${script}" ]]
+ if test -f "$rvm_path/scripts/${script}"
then \rm -f "$rvm_path/scripts/${script}"
fi
done
@@ -389,6 +427,18 @@ save_custom_flags()
true # no failing from grep filtering
}
+install_rvm_directories()
+{
+ for entry in $(__rvm_find -L config patches patchsets gem-cache contrib examples lib hooks help docs scripts -type d 2>/dev/null)
+ do
+ # Target is supposed to be a directory, remove if it is a file.
+ if [[ -f "$rvm_path/$entry" ]]
+ then \rm -f "$rvm_path/$entry"
+ fi
+ [[ -d "$rvm_path/$entry" ]] || mkdir -p "$rvm_path/$entry"
+ done
+}
+
install_rvm_files()
{
for file in README LICENCE VERSION
@@ -396,38 +446,46 @@ install_rvm_files()
__rvm_cp -f "$source_path/${file}" "$rvm_path/${file}"
done
- for directory in config contrib scripts examples lib help docs patches gem-cache
+ for entry in $(__rvm_find -L config patches gem-cache contrib examples lib help docs -type f 2>/dev/null)
do
- for entry in $(__rvm_find $directory 2>/dev/null)
- do
- if
- [[ -f "$source_path/$entry" ]] &&
- [[ "$entry" == "scripts/extras/completion.zsh/_rvm" || "$entry" == "scripts/zsh/Completion/_rvm" ]]
- then
- if __rvm_rm_rf "$rvm_path/$entry" 2>/dev/null
- then __rvm_cp -f "$source_path/$entry" "$rvm_path/$entry"
- else rvm_log " Can not update '$entry', it's a conflict between Zsh and multiuser installation, prefix the command with 'rvmsudo' to update this file."
- fi
- elif
- [[ -f "$source_path/$entry" ]]
- then
- # Target is supposed to be a file, remove if it is a directory.
- if [[ -d "$rvm_path/$entry" ]]
- then __rvm_rm_rf "$rvm_path/$entry"
- fi
- __rvm_cp -f "$source_path/$entry" "$rvm_path/$entry"
- elif
- [[ -d "$source_path/$entry" ]]
- then
- # Target is supposed to be a directory, remove if it is a file.
- if [[ -f "$rvm_path/$entry" ]]
- then \rm -f "$rvm_path/$entry"
- fi
- [[ -d "$rvm_path/$entry" ]] || mkdir -p "$rvm_path/$entry"
+ # Target is supposed to be a file, remove if it is a directory.
+ if [[ -d "$rvm_path/$entry" ]]
+ then __rvm_rm_rf "$rvm_path/$entry"
+ fi
+ \cat < "$source_path/$entry" > "$rvm_path/$entry"
+ if [[ -x "$source_path/$entry" ]]
+ then chmod +x "$rvm_path/$entry"
+ fi
+ done
+}
+
+install_rvm_scripts()
+{
+ for entry in $(__rvm_find -L scripts -type f 2>/dev/null)
+ do
+ # Target is supposed to be a file, remove if it is a directory.
+ if [[ -d "$rvm_path/$entry" ]]
+ then __rvm_rm_rf "$rvm_path/$entry"
+ fi
+ if
+ [[ "$entry" == "scripts/extras/completion.zsh/_rvm" || "$entry" == "scripts/zsh/Completion/_rvm" ]]
+ then
+ if [[ ! -f "$rvm_path/$entry" ]] || __rvm_rm_rf "$rvm_path/$entry" 2>/dev/null
+ then __rvm_cp -f "$source_path/$entry" "$rvm_path/$entry"
+ else rvm_log " Can not update '$entry', it's a conflict between Zsh and multiuser installation, prefix the command with 'rvmsudo' to update this file."
fi
- done
+ else
+ \cat < "$source_path/$entry" > "$rvm_path/$entry"
+ if [[ -x "$source_path/$entry" ]]
+ then chmod +x "$rvm_path/$entry"
+ fi
+ fi
done
- # cleanup old help and docs files
+ true # for osx
+}
+
+cleanup_old_help_and_docs_files()
+{
find "$rvm_path/help" -type f \! \( -name '*.md' -o -name '*.txt' \) -delete
find "$rvm_path/docs" -type f \! \( -name '*.md' -o -name '*.txt' \) -delete
true # for osx
@@ -437,43 +495,33 @@ install_rvm_hooks()
{
typeset hook_x_flag entry name
- for entry in $(__rvm_find hooks 2>/dev/null)
+ for entry in $(__rvm_find -L hooks -type f 2>/dev/null)
do
+ # Target is supposed to be a file, remove if it is a directory.
+ if [[ -d "$rvm_path/$entry" ]]
+ then __rvm_rm_rf "$rvm_path/$entry"
+ fi
+ # Source is first level hook (after_use) and target is custom user hook, preserve it
if
- [[ -f "$source_path/$entry" ]]
+ [[ -f "$rvm_path/$entry" ]] &&
+ __rvm_grep -E '^hooks/[[:alpha:]]+_[[:alpha:]]+$' >/dev/null <<<"$entry" &&
+ ! __rvm_grep "$(basename ${entry})_\*" "$rvm_path/$entry" >/dev/null
then
- # Target is supposed to be a file, remove if it is a directory.
- if [[ -d "$rvm_path/$entry" ]]
- then __rvm_rm_rf "$rvm_path/$entry"
- fi
- # Source is first level hook (after_use) and target is custom user hook, preserve it
- if
- [[ -f "$rvm_path/$entry" ]] &&
- echo "$entry" | __rvm_grep -E '^hooks/[[:alpha:]]+_[[:alpha:]]+$' >/dev/null &&
- ! __rvm_grep "$(basename ${entry})_\*" "$rvm_path/$entry" >/dev/null
- then
- \mv -f "$rvm_path/$entry" "$rvm_path/${entry}_custom"
- fi
- hook_x_flag=0
- [[ -x "$rvm_path/$entry" ]] || hook_x_flag=$?
+ \mv -f "$rvm_path/$entry" "$rvm_path/${entry}_custom"
+ fi
+ hook_x_flag=0
+ [[ -x "$rvm_path/$entry" ]] || hook_x_flag=$?
- __rvm_cp -f "$source_path/$entry" "$rvm_path/$entry"
+ __rvm_cp -f "$source_path/$entry" "$rvm_path/$entry"
- if (( hook_x_flag == 0 ))
- then [[ -x "$rvm_path/$entry" ]] || chmod a+rx "$rvm_path/$entry"
- fi
- elif
- [[ -d "$source_path/$entry" ]]
- then
- # Target is supposed to be a directory, remove if it is a file.
- if [[ -f "$rvm_path/$entry" ]]
- then \rm -f "$rvm_path/$entry"
- fi
- [[ -d "$rvm_path/$entry" ]] || mkdir -p "$rvm_path/$entry"
+ if (( hook_x_flag == 0 ))
+ then [[ -x "$rvm_path/$entry" ]] || chmod a+rx "$rvm_path/$entry"
fi
done
+}
- #remove unneeded files
+remove_old_hooks()
+{
for entry in after_use_custom after_use after_cd
do
name=${entry#after_}
@@ -500,8 +548,10 @@ install_binaries()
for file in "${files[@]}"
do
- # Ensure binscripts are always available in rvm_path/bin first.
- [[ ! -f "${rvm_bin_path}/${file}" ]] || \rm -f "${rvm_bin_path}/${file}"
+ if [[ -e "${rvm_bin_path}/${file}" ]] &&
+ [[ ! -f "${rvm_bin_path}/${file}" || -L "${rvm_bin_path}/${file}" ]]
+ then \rm -f "${rvm_bin_path}/${file}"
+ fi
if
[[ -L "${source_path}/bin/${file}" ]]
@@ -561,29 +611,23 @@ install_gemsets()
then __rvm_find "$rvm_path/gemsets" -type f -delete
fi
- if
- [[ -d gemsets/ ]]
- then
- [[ -d "$rvm_path/gemsets" ]] || mkdir -p "$rvm_path/gemsets"
+ [[ -d "$rvm_path/gemsets" ]] || mkdir -p "$rvm_path/gemsets"
- __rvm_read_lines gemset_files <(
- __rvm_find "${PWD%%+(\/)}/gemsets" "${name_opt}" '*.gems' |
- __rvm_sed 's/^\.\///'
- )
+ __rvm_read_lines gemset_files <(
+ __rvm_find "gemsets" "${name_opt}" '*.gems'
+ )
- for gemset_file in "${gemset_files[@]}"
- do
- cwd="${PWD//\//\\/}\/gemsets\/"
- destination="$rvm_path/gemsets/${gemset_file/$cwd}"
- if
- [[ ! -s "$destination" ]]
- then
- destination_path="${destination%/*}"
- [[ -d "$destination_path" ]] || mkdir -p "$destination_path"
- \cat < "$gemset_file" > "$destination"
- fi
- done
- fi
+ for gemset_file in "${gemset_files[@]}"
+ do
+ destination="$rvm_path/gemsets/${gemset_file#gemsets/}"
+ if
+ [[ ! -s "$destination" ]]
+ then
+ destination_path="${destination%/*}"
+ [[ -d "$destination_path" ]] || mkdir -p "$destination_path"
+ \cat < "$gemset_file" > "$destination"
+ fi
+ done
update_gemsets_rvmrc rvm_without_gems "${rvm_without_gems}"
update_gemsets_rvmrc rvm_with_gems "${rvm_with_gems}"
@@ -602,7 +646,7 @@ install_patchsets()
then
[[ -d "$rvm_path/patchsets" ]] || mkdir -p "$rvm_path/patchsets"
patchsets=($(
- __rvm_find patchsets/ -type f "${name_opt}" '*'
+ __rvm_find patchsets/ -type f
))
for patchset_file in "${patchsets[@]}"
do
@@ -610,9 +654,9 @@ install_patchsets()
if
[[ ! -s "$destination" || "${patchset_file##*/}" == "default" ]]
then
- destination_path="${destination%/*}"
- [[ -d "$destination_path" ]] || mkdir -p "$destination_path"
- [[ ! -f "$destination" ]] || \rm -f "$destination"
+ if [[ -d "$destination" ]]
+ then \rm -f "$destination"
+ fi
\cat < "$patchset_file" > "$destination"
fi
done
@@ -643,22 +687,6 @@ install_man_pages()
done
}
-ensure_scripts_are_executable()
-{
- typeset __file
- typeset -a __failed_files
- __failed_files=()
- for __file in "$rvm_scripts_path"/*
- do
- if [[ -s "${__file}" && ! -x "${__file}" ]]
- then chmod a+rx "${__file}" || __failed_files+=( "${__file}" )
- fi
- done
- if (( ${#__failed_files[@]} > 0 ))
- then permissions_warning "Failed to set permissions of: ${__failed_files[*]}"
- fi
-}
-
setup_configuration_files()
{
typeset _save_dir
@@ -680,7 +708,6 @@ setup_configuration_files()
[[ -s user/db ]] ||
echo '# User settings, overrides db settings and persists across installs.' >> user/db
- [[ -d user ]] || mkdir user
[[ -f user/rvmrcs ]] || > user/rvmrcs
[[ -f user/md5 ]] || > user/md5
[[ -f user/sha512 ]] || > user/sha512
@@ -904,7 +931,7 @@ setup_etc_bashrc()
[[ ! -f "${new_content_path}" ]] || \rm -f "${new_content_path}"
{
print_etc_bashrc_change # prepend
- \cat "${system_bashrc_file}" | __rvm_grep -v "|| export PATH=\"\${PATH}:\""
+ __rvm_grep -v "|| export PATH=\"\${PATH}:\"" < "${system_bashrc_file}"
true
} > "${new_content_path}" &&
\mv "${new_content_path}" "${system_bashrc_file}" 2>/dev/null ||
@@ -1177,7 +1204,7 @@ migrate_old_gemsets()
for gemset in "$rvm_path"/gems/*\@
do
- new_path=$(echo $gemset | __rvm_sed -e 's#\@$##')
+ new_path="$( __rvm_sed -e 's#\@$##' <<<"$gemset" )"
if
[[ -d "$gemset" && ! -d "$new_path" ]]
then
@@ -1256,13 +1283,15 @@ update_gemsets_install_rvm()
# rvm /gems
paths=($(
- __rvm_find "$rvm_path/gems" -maxdepth 1 "${name_opt}" '*@global' | __rvm_sed 's/^\.\///'
+ __rvm_find "$rvm_path/gems" -maxdepth 1 "${name_opt}" '*@global'
))
for _gem in rvm gem-wrappers
do
[[ " ${rvm_without_gems:-} " == *" ${_gem} "* ]] ||
{
+ missing=()
+
for _iterator in "${paths[@]}"
do
# skip unless this ruby is installed
@@ -1276,7 +1305,7 @@ update_gemsets_install_rvm()
# rvm /gems @global /gems
found=($(
[[ ! -d "${_current_path}" ]] ||
- __rvm_find "${_current_path}" -maxdepth 1 "${name_opt}" ${_gem}-'*' | __rvm_sed 's/^\.\///'
+ __rvm_find "${_current_path}" -maxdepth 1 "${name_opt}" ${_gem}-'*'
))
(( ${#found[@]} > 0 )) || missing+=( "${installed}=${_iterator}" )
done
@@ -1286,7 +1315,6 @@ update_gemsets_install_rvm()
then
for _iterator in "${missing[@]}"
do
- printf "%b" "installing ${_gem} in ${__gem_home##*/}"
__gem_home="${_iterator#*=}"
_iterator="${_iterator%%=*}"
__rvm_with "${__gem_home##*/}" gem_install ${_gem}
@@ -1382,12 +1410,7 @@ cleanup_tmp_files()
(( ${#files[@]} > 0 ))
then
rvm_out " Cleanup any .swp files."
- for file in "${files[@]}"
- do
- if [[ -f "$file" ]]
- then \rm -f "$file"
- fi
- done
+ \rm -f "${files[@]}"
fi
}
View
22 scripts/functions/manage/base_remove
@@ -36,20 +36,20 @@ __rvm_remove_ruby()
typeset __removed_counter=0
__rvm_remove_install_record "$rvm_ruby_string"
- __rvm_remove_src_and_ruby
+ __rvm_remove_src_and_ruby &&
case "${1:-remove}" in
(remove)
- __rvm_remove_gemsets
- __rvm_remove_archives
- __rvm_remove_aliases
- __rvm_remove_wrappers
- __rvm_remove_environments
- __rvm_remove_binaries
+ __rvm_remove_gemsets &&
+ __rvm_remove_archives &&
+ __rvm_remove_aliases &&
+ __rvm_remove_wrappers &&
+ __rvm_remove_environments &&
+ __rvm_remove_binaries &&
__rvm_remove_ruby_done
;;
(uninstall)
- __rvm_remove_gemsets_check
- __rvm_check_default
+ __rvm_remove_gemsets_check &&
+ __rvm_check_default &&
__rvm_remove_ruby_done
;;
(reinstall)
@@ -74,11 +74,11 @@ __rvm_remove_src_and_ruby()
then
let __removed_counter+=1
__rvm_log_command "remove.${_dir##*/}" \
- "$rvm_ruby_string - #removing ${_dir##*/}" \
+ "$rvm_ruby_string - #removing ${_dir##*/}/$rvm_ruby_string" \
__rvm_rm_rf "${_dir}/$rvm_ruby_string" ||
return $?
else
- rvm_debug "$rvm_ruby_string - #already removed ${_dir##*/}"
+ rvm_debug "$rvm_ruby_string - #already removed ${_dir##*/}/$rvm_ruby_string"
fi
done
View
9 scripts/functions/manage/ree
@@ -15,8 +15,14 @@ ree_transform_configure_flags()
ree_install()
{
- if [[ -n "$(echo "$rvm_ruby_version" | __rvm_awk '/^1\.8/{print}')" ]] && (( rvm_head_flag == 0 ))
+ if
+ [[ -n "$(echo "$rvm_ruby_version" | __rvm_awk '/^1\.8/{print}')" ]] && (( rvm_head_flag == 0 ))
then
+ ruby="ruby-1.8.|ree-"
+ __rvm_ensure_has_mri_ruby "$ruby" &&
+ ruby="$(__rvm_mri_ruby "$ruby")" ||
+ return $?
+
rvm_log "Installing Ruby Enterprise Edition from source to: $rvm_ruby_home"
__rvm_cd "${rvm_src_path}"
@@ -96,6 +102,7 @@ ree_install()
fi
__rvm_log_command "install" "$rvm_ruby_string - #installing" \
+ __rvm_with "$ruby" env \
"${rvm_configure_env[@]}" ./installer -a "$rvm_rubies_path/$rvm_ruby_string" "${rvm_ree_options[@]}" "${rvm_configure_flags[@]}" ||
return $?
View
7 scripts/functions/osx-ssl-certs
@@ -49,6 +49,13 @@ requirements_osx_update_openssl_cert_run()
{
typeset __target="$cert_file"
+ if
+ [[ -z "$cert_file" ]]
+ then
+ rvm_error "Empty path passed to certificates update, functions stack: ${FUNCNAME[*]}"
+ return 1
+ fi
+
rvm_log "Updating certificates in '$cert_file'."
requirements_osx_update_openssl_cert_create_dir || return $?
View
18 scripts/functions/requirements/centos
@@ -16,6 +16,11 @@ requirements_centos_lib_available_no_caching()
yum list --quiet "$1" >/dev/null 2>&1 || return $?
}
+requirements_centos_version_list()
+{
+ rpm -q --whatprovides "$1" | sed -e "s#^$1-##"
+}
+
requirements_centos_libs_install()
{
__rvm_try_sudo yum install -y "$@" || return $?
@@ -100,7 +105,7 @@ requirements_centos_define()
else requirements_check libyaml-devel
fi
if
- [[ "${_system_name}" == "Redhat" && ${_system_version:-0} -ge 6 ]] &&
+ [[ "${_system_name_lowercase}" == "redhat" && ${_system_version:-0} -ge 6 ]] &&
! requirements_centos_lib_available libffi-devel
then
rvm_warn "
@@ -113,7 +118,11 @@ Skipping installation of 'libffi-devel', in case you depend on FFI reinstall you
if [[ "${_system_name}" != "Mageia" ]]
then requirements_check glibc-headers
fi
- requirements_check gcc-c++ glibc-devel patch readline readline-devel zlib zlib-devel openssl-devel make bzip2 autoconf automake libtool bison
+ if [[ ${#rvm_patch_names[@]} -gt 0 ]] || [[ "$1" == *"-head" ]]
+ then requirements_version_minimal autoconf 2.67
+ else requirements_check autoconf
+ fi
+ requirements_check gcc-c++ glibc-devel patch readline readline-devel zlib zlib-devel openssl-devel make bzip2 automake libtool bison
;;
esac
}
@@ -153,3 +162,8 @@ requirements_mageia_before()
{
__lib_type=centos
}
+
+requirements_scientific_before()
+{
+ __lib_type=centos
+}
View
12 scripts/functions/requirements/osx_port
@@ -29,6 +29,11 @@ requirements_osx_port_version_list()
port -q installed $1* 2>/dev/null | __rvm_sed -e 's/.* @//' -e 's/_.*//' -e 's/ .*//'
}
+requirements_osx_port_lib_available()
+{
+ port info $1 >/dev/null 2>&1 || return $?
+}
+
requirements_osx_port_lib_installed()
{
port -q installed $1 | __rvm_grep active >/dev/null || return $? ;
@@ -70,7 +75,7 @@ requirements_osx_port_libs_default()
;;
esac
port_libs+=(
- libiconv libyaml libffi readline libksba openssl curl-ca-bundle sqlite3 zlib gdbm
+ libiconv libyaml libffi readline libksba openssl sqlite3 zlib gdbm
)
if
requirements_osx_port_lib_installed ncursesw
@@ -82,6 +87,7 @@ Error! ncursesw was replaced by ncurses a long time ago, please uninstall 'ncurs
else
port_libs+=( ncurses )
fi
+ requirements_check_fallback curl-ca-bundle certsync || return $?
requirements_check "${port_libs[@]}" || return $?
}
@@ -168,7 +174,9 @@ requirements_osx_port_install_port()
macports_version="$(
__rvm_curl https://distfiles.macports.org/MacPorts/ |
__rvm_grep -Eo "<a href=\"MacPorts-[[:digit:]\.]+.tar.bz2\">" |
- __rvm_awk -F'"' '{print $2}' | sort | __rvm_tail -n 1
+ __rvm_awk -F'"' '{print $2}' |
+ __rvm_version_sort |
+ __rvm_tail -n 1
)" #'
macports_version="${macports_version%.tar.bz2}"
: macports_version:${macports_version:=MacPorts-2.1.3}
View
1  scripts/functions/requirements/scientific
View
3  scripts/functions/requirements/ubuntu
@@ -65,10 +65,10 @@ requirements_debian_define()
;;
(jruby*)
+ requirements_check g++
if
is_head_or_disable_binary "$1"
then
- requirements_check g++
update-alternatives --list javac >/dev/null 2>&1 ||
requirements_check_fallback \
openjdk-7-jdk oracle-j2sdk1.7 \
@@ -79,7 +79,6 @@ requirements_debian_define()
else __rvm_which ant >/dev/null || requirements_check ant
fi
else
- requirements_check g++
update-alternatives --list java >/dev/null 2>&1 ||
requirements_check_fallback \
openjdk-7-jre-headless openjdk-7-jdk oracle-j2sdk1.7 \
View
4 scripts/functions/rubygems
@@ -221,12 +221,12 @@ rubygems_setup()
if
__rvm_version_compare "${__current_rubygems_version}" -eq "$version"
then
- rvm_log "Rubygems $version already installed, skipping installation, use --force to reinstall."
+ rvm_log "Rubygems $version already available in installed ruby, skipping installation, use --force to reinstall."
return 0
elif
__rvm_version_compare "${__current_rubygems_version}" -gt "$version"
then
- rvm_log "Installed rubygems ${__current_rubygems_version} is newer then $version, skipping installation, use --force to force installation."
+ rvm_log "Installed rubygems ${__current_rubygems_version} is newer than $version provided with installed ruby, skipping installation, use --force to force installation."
return 0
fi
fi
View
81 scripts/functions/rvmrc
@@ -110,45 +110,7 @@ __rvm_rvmrc_tools()
;;
try_to_read_ruby)
- # make sure the flag is passed on to sub-process $()
- if [[ -n "${rvm_trust_rvmrcs_flag:-}" ]]
- then export rvm_trust_rvmrcs_flag
- fi
-
- case "$rvmrc_path" in
- (*/.rvmrc)
- if ! __rvm_rvmrc_tools is_trusted "$(dirname "$rvmrc_path")" "$(basename "$rvmrc_path")"
- then
- # subprocess to not mess with current process variables
- ( rvm_promptless=1 __rvm_project_rvmrc "$rvmrc_path" >/dev/null 2>&1 )
- fi
-
- if __rvm_rvmrc_tools is_trusted "$(dirname "$rvmrc_path")" "$(basename "$rvmrc_path")"
- then
- rvm_action="${rvm_action:-use}"
- rvm_ruby_string="$(
- rvm_current_rvmrc=""
- rvm_trust_rvmrcs_flag=1
- rvm_is_not_a_shell_function=0
- __rvm_project_rvmrc "$rvmrc_path" >/dev/null 2>&1
- __rvm_env_string
- )"
- rvm_ruby_strings="$rvm_ruby_string"
- else
- return 1
- fi
- ;;
- (*)
- rvm_action="${rvm_action:-use}"
- rvm_ruby_string="$(
- rvm_current_rvmrc=""
- rvm_trust_rvmrcs_flag=1
- __rvm_project_rvmrc "$rvmrc_path" >/dev/null 2>&1
- __rvm_env_string
- )"
- rvm_ruby_strings="$rvm_ruby_string"
- ;;
- esac
+ __rvm_rvmrc_tools_try_to_read_ruby "$@" || return $?
;;
*)
@@ -159,3 +121,44 @@ __rvm_rvmrc_tools()
return $?
}
+
+__rvm_rvmrc_tools_try_to_read_ruby()
+{
+ case "$rvmrc_path" in
+ (*/.rvmrc)
+ # make sure the flag is passed on to sub-process () / $()
+ if [[ -n "${rvm_trust_rvmrcs_flag:-}" ]]
+ then export rvm_trust_rvmrcs_flag
+ fi
+
+ __rvm_rvmrc_tools is_trusted "$(dirname "$rvmrc_path")" "$(basename "$rvmrc_path")" ||
+ (
+ # subprocess to not mess with current process variables
+ rvm_promptless=1 __rvm_project_rvmrc "$rvmrc_path" >/dev/null 2>&1
+ )
+
+ if __rvm_rvmrc_tools is_trusted "$(dirname "$rvmrc_path")" "$(basename "$rvmrc_path")"
+ then __rvm_rvmrc_tools_read_ruby "$@" || return $?
+ else return 1
+ fi
+ ;;
+ (*)
+ __rvm_rvmrc_tools_read_ruby "$@" || return $?
+ ;;
+ esac
+}
+
+__rvm_rvmrc_tools_read_ruby()
+{
+ rvm_ruby_string="$(
+ # subprocess to not mess with current process variables
+ rvm_action="${rvm_action:-use}"
+ rvm_current_rvmrc=""
+ rvm_trust_rvmrcs_flag=1
+ __rvm_project_rvmrc "$rvmrc_path" >/dev/null 2>&1 &&
+ __rvm_env_string
+ )"
+ rvm_ruby_strings="$rvm_ruby_string"
+ [[ -n "$rvm_ruby_string" ]] || return 101
+ true
+}
View
3  scripts/functions/rvmrc_project
@@ -77,7 +77,8 @@ __rvm_load_project_config()
__rvm_ensure_is_a_function
unset GEM_HOME GEM_PATH
- rvm_ruby_string="${rvm_previous_environment/system/default}" rvm_action=use source "$1"
+ rvm_ruby_string="${rvm_previous_environment/system/default}" rvm_action=use source "$1" ||
+ return $?
else
return $?
fi
View
11 scripts/selector → scripts/functions/selector
@@ -1,5 +1,10 @@
#!/usr/bin/env bash
+source "${rvm_scripts_path}/functions/selector_gemsets"
+source "${rvm_scripts_path}/functions/selector_late"
+source "${rvm_scripts_path}/functions/selector_parse"
+source "${rvm_scripts_path}/functions/selector_interpreters"
+
__rvm_select_set_variable_defaults()
{
export -a rvm_configure_flags rvm_patch_names rvm_ree_options rvm_make_flags
@@ -366,7 +371,7 @@ __rvm_ruby_string_autodetect()
__rvm_list_strings |
__rvm_grep "^${rvm_ruby_interpreter}-.*${rvm_ruby_name:-}" |
__rvm_awk -F- '{print $2}' |
- \sort |
+ __rvm_version_sort |
__rvm_tail -n 1
)"
fi
@@ -405,7 +410,7 @@ __rvm_ruby_string_autodetect()
new_ruby_string="$(
__rvm_list_strings |
__rvm_grep "^${rvm_ruby_string}.*${rvm_ruby_name:-}" |
- \sort |
+ __rvm_version_sort |
__rvm_tail -n 1
)"
rvm_ruby_string="${new_ruby_string:-$rvm_ruby_string}"
@@ -431,7 +436,7 @@ __rvm_ruby_string_autodetect()
__rvm_list_strings |
__rvm_grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-.*${rvm_ruby_name:-}" |
__rvm_awk -F- '{print $3}' |
- \sort |
+ __rvm_version_sort |
__rvm_tail -n 1
)"
fi
View
2  scripts/selector_gemsets → scripts/functions/selector_gemsets
@@ -154,7 +154,7 @@ __rvm_gemset_use_ensure()
gemset_create "${rvm_expected_gemset_name:-${rvm_gemset_name:-}}"
else
rvm_error "Gemset '${rvm_expected_gemset_name:-${rvm_gemset_name:-}}' does not exist, \
- 'rvm $rvm_ruby_string do rvm gemset create ${rvm_expected_gemset_name:-${rvm_gemset_name:-}}' first, or append '--create'."
+'rvm $rvm_ruby_string do rvm gemset create ${rvm_expected_gemset_name:-${rvm_gemset_name:-}}' first, or append '--create'."
return 2
fi
fi
View
4 scripts/selector_interpreters → scripts/functions/selector_interpreters
@@ -82,7 +82,9 @@ __rvm_select_macruby_nightly_detect()
rvm_ruby_version="$(
__rvm_curl -s "$rvm_ruby_url" |
__rvm_grep -oE "<a href=\"macruby_nightly-[^<]+\.pkg</a>" |
- __rvm_awk -F"[<>]" '{print $3}' | sort | __rvm_tail -n 1
+ __rvm_awk -F"[<>]" '{print $3}' |
+ __rvm_version_sort |
+ __rvm_tail -n 1
)"
[[ -n "${rvm_ruby_version}" ]] ||
{
View
3  scripts/selector_late → scripts/functions/selector_late
@@ -17,7 +17,8 @@ __rvm_select_late_rbx_partial()
__found="$(
__rvm_curl -s $1/index.txt "rubinius-$1" |
__rvm_awk -F"${__ext}" "/${__patern}/"'{print $1}' |
- \sort | \tail -n 1
+ __rvm_version_sort |
+ __rvm_tail -n 1
)"
if
[[ -n "${__found}" ]]
View
12 scripts/selector_parse → scripts/functions/selector_parse
@@ -7,7 +7,7 @@ __rvm_ruby_string_fuzzy_remote_for()
new_ruby_string="$(
__list_remote_$1_for $( __rvm_system_path_for ${2:-$1} ) |
__rvm_awk -F/ '{x=$NF; gsub(".tar.*","",x); gsub("jruby-bin","jruby",x); print x}' |
- \sort -V |
+ __rvm_version_sort |
__rvm_awk '
BEGIN{found=""; any=""}
/^'"${__search}"'$/ {found=$1}
@@ -36,7 +36,10 @@ __rvm_ruby_string_fuzzy()
then __search="${__search%${rvm_ruby_name:-}}.*${rvm_ruby_name:-}"
fi
new_ruby_string="$(
- __rvm_list_strings | __rvm_grep "${__search}" | \sort | __rvm_tail -n 1
+ __rvm_list_strings |
+ __rvm_grep "${__search}" |
+ __rvm_version_sort |
+ __rvm_tail -n 1
)"
if [[ -n "${new_ruby_string}" ]]
then rvm_ruby_string="${new_ruby_string}"
@@ -62,7 +65,7 @@ __rvm_ruby_string_parse_()
rvm_ruby_name="$ruby_name"
if
- [[ -z "${ruby_string}" ]]
+ [[ -z "${ruby_string}" || "${ruby_string}" == "current" ]]
then
if
[[ "${GEM_HOME:-}" == *"${rvm_gems_path}"* ]]
@@ -255,7 +258,8 @@ __rvm_ruby_string_latest()
new_ruby_string="$(
\cat "$rvm_path/config/known_strings" |
__rvm_grep "${check_ruby_string}" |
- sort | __rvm_tail -n 1
+ __rvm_version_sort |
+ __rvm_tail -n 1
)"
if
[[ -n "${new_ruby_string}" ]]
View
7 scripts/functions/support
@@ -241,7 +241,10 @@ __rvm_setup_utils_functions_Other()
then __rvm_which() { command which "$@" || return $?; }
elif which which >/dev/null 2>&1
then __rvm_which() { which "$@" || return $?; }
- else rvm_fail "ERROR: Missing proper 'which' command. Make sure it is installed before using RVM!" 1
+ else
+ typeset __result=$?
+ rvm_error "ERROR: Missing proper 'which' command. Make sure it is installed before using RVM!"
+ return ${__result}
fi
for gnu_util in "${gnu_utils[@]}"
@@ -249,7 +252,7 @@ __rvm_setup_utils_functions_Other()
done
}
-__rvm_setup_utils_functions
+__rvm_setup_utils_functions || return $?
if
[[ ! " ${rvm_tar_options:-} " =~ " --no-same-owner " ]] &&
View
36 scripts/functions/utility
@@ -181,7 +181,7 @@ __rvm_detect_xcode_version_at_least()
# TODO: better semver support
__rvm_version_sort()
{
- LC_ALL=C sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n
+ LC_ALL=C \sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n
}
__rvm_version_compare()
@@ -301,24 +301,44 @@ __rvm_find_first_file()
return 1
}
+file_exists_at_url_command()
+{
+ __rvm_curl --silent --insecure --location --list-only \
+ --max-time ${rvm_max_time_flag:-5} --head "$@" 2>&1 |
+ __rvm_grep -E 'HTTP/[0-9\.]+ 200 OK' >/dev/null 2>&1 ||
+ {
+ typeset __ret=$?
+ case ${__ret} in
+ (28)
+ rvm_warn "RVM was not able to check existence of remote files with timeout of ${rvm_max_time_flag:-3} seconds
+you can increase the timeout by setting it in ~/.rvmrc => rvm_max_time_flag=10"
+ ;;
+ esac
+ return ${__ret}
+ }
+}
+
file_exists_at_url()
(
if
[[ -n "${1:-}" ]]
then
unset curl
- __rvm_curl --silent --insecure --location --list-only \
- --max-time ${rvm_max_time_flag:-5} --head "$1" 2>&1 |
- __rvm_grep -E 'HTTP/[0-9\.]+ 200 OK' >/dev/null 2>&1 ||
+ file_exists_at_url_command "$1" --insecure ||
{
typeset __ret=$?
case ${__ret} in
- (28)
- rvm_warn "RVM was not able to check existence of remote files with timeout of ${rvm_max_time_flag:-3} seconds
-you can increase the timeout by setting it in ~/.rvmrc => rvm_max_time_flag=10"
+ (60)
+ # detect double --insecure and avoid duplication, see:
+ # https://github.com/wayneeseguin/rvm/issues/2640#issuecomment-35669722
+ file_exists_at_url_command "$1" || return $?
+ return 0
+ ;;
+ (*)
+ # anything else then 60 just return it
+ return ${__ret}
;;
esac
- return ${__ret}
}
else
rvm_warn "Warning: URL was not passed to file_exists_at_url"
View
35 scripts/functions/utility_logging
@@ -58,8 +58,8 @@ __rvm_log_command()
[[ ! "${_command_start}" =~ "=" ]] || _command=( "env" "${_command[@]}" )
if __function_on_stack __rvm_log_command_internal
- then __rvm_log_command_simple "$@"
- else __rvm_log_command_internal "$@"
+ then __rvm_log_command_simple "$@" || return $?
+ else __rvm_log_command_internal "$@" || return $?
fi
}
@@ -146,6 +146,7 @@ __rvm_ask_for()
__rvm_dotted()
{
+ set +x
typeset flush
if (( $# ))
@@ -161,33 +162,47 @@ __rvm_dotted()
# old awk does not allow running function from variable
awk -v go_back="$( tput cub1 2>/dev/null || true)" \
'
- BEGIN{ spin[0]="|"go_back; spin[1]="/"go_back; spin[2]="-"go_back; spin[3]="\\"go_back }
+ BEGIN{
+ spin[0]="|"go_back;
+ spin[1]="/"go_back;
+ spin[2]="-"go_back;
+ spin[3]="\\"go_back }
{
if ((NR-1)%(10)==9)
printf ".";
else
if (go_back!="") printf spin[(NR-1)%4];
- '${flush}'
- }
- END{print "."}
+ '${flush}' }
+ END{
+ print "." }
'
}
__rvm_log_dotted()
{
- typeset __log_file __message __iterator
+ typeset __log_file __message __iterator __result
__log_file="$1"
__message="$2"
shift 2
+ __result=0
if
[[ -n "${ZSH_VERSION:-}" ]]
then
rvm_log "${__message} - please wait"
- "$@" > "${__log_file}" 2>&1 || return $?
+ {
+ set -x
+ "$@" > "${__log_file}" 2>&1 || __result=$?
+ (( __local_rvm_trace_flag > 0 )) || set +x
+ } 2>/dev/null
else
- "$@" 2>&1 | tee -a "${__log_file}" | __rvm_dotted "${__message}"
- __rvm_check_pipestatus ${PIPESTATUS[@]} ${pipestatus[@]} || return $?
+ {
+ set -x
+ "$@" 2>&1 | tee -a "${__log_file}" | __rvm_dotted "${__message}"
+ __rvm_check_pipestatus ${PIPESTATUS[@]} ${pipestatus[@]} || __result=$?
+ (( __local_rvm_trace_flag > 0 )) || set +x
+ } 2>/dev/null
fi
+ return $__result
}
__rvm_check_pipestatus()
View
2  scripts/functions/utility_system
@@ -107,7 +107,7 @@ __rvm_detect_system()
[[ -f /etc/redhat-release ]]
then
_system_name="$(
- GREP_OPTIONS="" \grep -Eo 'CentOS|ClearOS|Mageia' /etc/redhat-release 2>/dev/null
+ GREP_OPTIONS="" \grep -Eo 'CentOS|ClearOS|Mageia|Scientific' /etc/redhat-release 2>/dev/null
)" ||
_system_name="RedHat"
_system_version="$(GREP_OPTIONS="" \grep -Eo '[0-9\.]+' /etc/redhat-release | \awk -F. 'NR==1{print $1}')"
View
88 scripts/rvm
@@ -138,64 +138,68 @@ then
true ${rvm_scripts_path:="$rvm_path/scripts"}
if
- [[ -f "$rvm_scripts_path/base" ]]
+ [[ ! -f "$rvm_scripts_path/base" ]]
then
- source "$rvm_scripts_path/base"
- else
printf "%b" "WARNING:
Could not source '$rvm_scripts_path/base' as file does not exist.
RVM will likely not work as expected.\n"
- fi
-
- __rvm_ensure_is_a_function
- __rvm_setup
+ elif
+ ! source "$rvm_scripts_path/base"
+ then
+ printf "%b" "WARNING:
+ Errors sourcing '$rvm_scripts_path/base'.
+ RVM will likely not work as expected.\n"
+ else
+ __rvm_ensure_is_a_function
+ __rvm_setup
- export rvm_version
- rvm_version="$(\cat "$rvm_path/VERSION") ($(\cat "$rvm_path/RELEASE" 2>/dev/null))"
+ export rvm_version
+ rvm_version="$(\cat "$rvm_path/VERSION") ($(\cat "$rvm_path/RELEASE" 2>/dev/null))"
- alias rvm-restart="rvm_reload_flag=1 source '${rvm_scripts_path:-${rvm_path}/scripts}/rvm'"
+ alias rvm-restart="rvm_reload_flag=1 source '${rvm_scripts_path:-${rvm_path}/scripts}/rvm'"
- # Try to load RVM ruby if none loaded yet
- __path_to_ruby="$( builtin command -v ruby 2>/dev/null )"
- if
- [[ -z "${__path_to_ruby}" ]] ||
- [[ "${__path_to_ruby}" != "${rvm_path}"* ]] ||
- [[ "${__path_to_ruby}" == "${rvm_path}/bin/ruby" ]]
- then
- if [[ -s "$rvm_path/environments/default" ]]
- then source "$rvm_path/environments/default"
- fi
+ # Try to load RVM ruby if none loaded yet
+ __path_to_ruby="$( builtin command -v ruby 2>/dev/null )"
if
- [[ ${rvm_project_rvmrc:-1} -gt 0 ]] &&
- ! __function_on_stack __rvm_project_rvmrc
+ [[ -z "${__path_to_ruby}" ]] ||
+ [[ "${__path_to_ruby}" != "${rvm_path}"* ]] ||
+ [[ "${__path_to_ruby}" == "${rvm_path}/bin/ruby" ]]
then
- # Reload the rvmrc, use promptless ensuring shell processes does not
- # prompt if .rvmrc trust value is not stored, revert to default on fail
+ if [[ -s "$rvm_path/environments/default" ]]
+ then source "$rvm_path/environments/default"
+ fi
if
- rvm_current_rvmrc=""
- rvm_project_rvmrc_default=1 rvm_promptless=1 __rvm_project_rvmrc
+ [[ ${rvm_project_rvmrc:-1} -gt 0 ]] &&
+ ! __function_on_stack __rvm_project_rvmrc
then
- rvm_hook=after_cd
- source "${rvm_scripts_path:-${rvm_path}/scripts}/hook"
+ # Reload the rvmrc, use promptless ensuring shell processes does not
+ # prompt if .rvmrc trust value is not stored, revert to default on fail
+ if
+ rvm_current_rvmrc=""
+ rvm_project_rvmrc_default=1 rvm_promptless=1 __rvm_project_rvmrc
+ then
+ rvm_hook=after_cd
+ source "${rvm_scripts_path:-${rvm_path}/scripts}/hook"
+ fi
fi
fi
- fi
- unset __path_to_ruby
+ unset __path_to_ruby
- # Makes sure rvm_bin_path is in PATH atleast once.
- [[ ":${PATH}:" == *":${rvm_bin_path}:"* ]] || PATH="$PATH:${rvm_bin_path}"
+ # Makes sure rvm_bin_path is in PATH atleast once.
+ [[ ":${PATH}:" == *":${rvm_bin_path}:"* ]] || PATH="$PATH:${rvm_bin_path}"
- if
- (( ${rvm_reload_flag:=0} == 1 ))
- then
- [[ "${rvm_auto_reload_flag:-0}" == 2 ]] || printf "%b" 'RVM reloaded!\n'
- # make sure we clean env on reload
- __rvm_env_loaded=1
- unset __rvm_project_rvmrc_lock
- fi
+ if
+ (( ${rvm_reload_flag:=0} == 1 ))
+ then
+ [[ "${rvm_auto_reload_flag:-0}" == 2 ]] || printf "%b" 'RVM reloaded!\n'
+ # make sure we clean env on reload
+ __rvm_env_loaded=1
+ unset __rvm_project_rvmrc_lock
+ fi
- rvm_loaded_flag=1
- __rvm_teardown
+ rvm_loaded_flag=1
+ __rvm_teardown
+ fi
else
printf "%b" "\n\$rvm_path ($rvm_path) does not exist."
fi
View
18 scripts/set
@@ -201,10 +201,20 @@ fi
previous_rvm_ruby_strings="$rvm_ruby_strings"
rvm_ruby_strings=( $( __rvm_expand_ruby_string "$rvm_ruby_strings" ) ) || {
- rvm_ruby_string="${previous_rvm_ruby_strings## }"
- __rvm_ruby_string
- rvm_error "Ruby ${rvm_ruby_string} is not installed."
- exit 1
+ typeset result=$?
+ if
+ [[ $result -eq 2 && -n "${rvm_expected_gemset_name:-${rvm_gemset_name:-}}" ]]
+ then
+ rvm_ruby_string="${previous_rvm_ruby_strings## }"
+ __rvm_ruby_string
+ rvm_error "Gemset '${rvm_expected_gemset_name:-${rvm_gemset_name:-}}' does not exist, \
+'rvm $rvm_ruby_string do rvm gemset create ${rvm_expected_gemset_name:-${rvm_gemset_name:-}}' first, or append '--create'."
+ else
+ rvm_ruby_string="${previous_rvm_ruby_strings## }"
+ __rvm_ruby_string
+ rvm_error "Ruby ${rvm_ruby_string} is not installed."
+ fi
+ exit $result
}
unset previous_rvm_ruby_strings
View
4 scripts/upgrade
@@ -64,10 +64,10 @@ existing_ruby_patch()
(
rvm_ruby_string="$1"
__rvm_ruby_string
- __rvm_list_strings | __rvm_grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-" ||
+ __rvm_list_strings | __rvm_grep -E "^${rvm_ruby_interpreter}-${rvm_ruby_version}(-.*|$)" ||
__rvm_list_strings | __rvm_grep "^${rvm_ruby_interpreter}-"
)
- } | \sort | __rvm_tail -n 1
+ } | __rvm_version_sort | __rvm_tail -n 1
}
highest_ruby_patch()
Please sign in to comment.
Something went wrong with that request. Please try again.