rvm 0.1.44 → 0.1.45

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -91,6 +91,8 @@ Action
91
91
  notes - Display notes, with operating system specifics.
92
92
 
93
93
  snapshot - Let's your backup / restore an rvm installation in a lightweight manner.
94
+
95
+ migrate - Let's you migrate all gemsets from one ruby to another.
94
96
 
95
97
  Implementation
96
98
 
@@ -17,40 +17,37 @@ fi
17
17
  [[ -z "$rvm_path" ]] && unset rvm_path
18
18
 
19
19
  # Setup default sandbox value. See scripts/rvm for origin.
20
- if [[ -z "$rvm_sandboxed" ]]; then
20
+ if [[ -z "$rvm_selfcontained" ]]; then
21
21
  if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
22
- rvm_sandboxed=0
22
+ rvm_selfcontained=0
23
23
  else
24
- rvm_sandboxed=1
24
+ rvm_selfcontained=1
25
25
  fi
26
26
  fi
27
27
 
28
28
  if [[ -z "$rvm_prefix" ]] ; then
29
- if [[ "$rvm_sandboxed" = "0" ]] ; then
30
- rvm_prefix="/usr/local"
29
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
30
+ rvm_prefix="/usr/local/"
31
31
  else
32
32
  rvm_prefix="$HOME/."
33
33
  fi
34
34
  fi
35
35
 
36
- if [[ -z "$rvm_path" ]] ; then
37
- unset rvm_path
38
- if [[ "$rvm_sandboxed" = "0" ]] ; then
39
- rvm_path="$rvm_prefix/rvm"
40
- else
41
- if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
42
- rvm_path="$HOME/.rvm"
43
- elif [[ -d "$rvm_prefix/rvm" ]] && [[ -s "$rvm_prefix/rvm/scripts/rvm" ]] ; then
44
- rvm_path="$rvm_prefix/rvm"
45
- else
46
- rvm_path="$HOME/.rvm"
47
- fi
48
- fi
36
+ # Fix rvm_prefix changes.
37
+ echo "$rvm_prefix" | grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
38
+ rvm_prefix_needs_trailing_slash="$?"
39
+ if [[ "$rvm_prefix" = "/usr/local" || "$rvm_prefix_needs_trailing_slash" = "0" ]]; then
40
+ rvm_prefix="$rvm_prefix/"
49
41
  fi
42
+ unset rvm_prefix_needs_trailing_slash
50
43
 
44
+ if [[ -z "$rvm_path" ]] ; then
45
+ rvm_path="${rvm_prefix}rvm"
46
+ fi
51
47
  rvm_scripts_path="${rvm_scripts_path:-"$rvm_path/scripts"}"
48
+
52
49
  source "$rvm_scripts_path/rvm"
53
50
 
54
51
  unset rvm_interactive
55
52
 
56
- rvm $*
53
+ rvm "$@"
@@ -6,12 +6,20 @@ if [[ -z "$rvm_ignore_rvmrc" ]]; then
6
6
  fi
7
7
 
8
8
  rvm_path="${rvm_path:-$HOME/.rvm}"
9
- mkdir -p $rvm_path/src/
10
- cd $rvm_path/src
11
9
 
12
- rm -rf ./rvm/ && git clone --depth 1 git://github.com/wayneeseguin/rvm.git
13
- cd rvm
14
- # v v v This is a godo idea however it does not preserve the executible bit.
15
- # Needs more thought, perhaps a simple sed instead.
10
+ [ -d "$rvm_path/src" ] || mkdir -p $rvm_path/src/
11
+
12
+ cd "$rvm_path/src"
13
+
14
+ [ -d ./rvm ] && rm -rf ./rvm/
15
+
16
+ git clone --depth 1 git://github.com/wayneeseguin/rvm.git ||
17
+ git clone http://github.com/wayneeseguin/rvm.git
18
+
19
+ cd rvm &&
20
+
21
+ # v v v This is a good idea however it does not preserve the executible bit.
22
+ # Needs more thought, perhaps a simple sed instead...
16
23
  # dos2unix scripts/* >/dev/null 2>&1
24
+
17
25
  bash scripts/install
@@ -19,14 +19,14 @@ if [[ -z "$rvm_ignore_rvmrc" ]]; then
19
19
  fi
20
20
 
21
21
  rvm_path="${rvm_path:-"/usr/local/rvm"}"
22
- export rvm_sandboxed=0
22
+ export rvm_selfcontained=0
23
23
 
24
24
  mkdir -p "$rvm_path/src/"
25
25
  builtin cd "$rvm_path/src"
26
26
 
27
27
  rm -rf ./rvm/
28
28
 
29
- git clone --depth 1 git://github.com/wayneeseguin/rvm.git
29
+ git clone --depth 1 git://github.com/wayneeseguin/rvm.git || git clone http://github.com/wayneeseguin/rvm.git
30
30
 
31
31
  builtin cd rvm
32
32
 
@@ -56,8 +56,8 @@ touch /etc/rvmrc
56
56
  cat > /etc/rvmrc <<END_OF_RVMRC
57
57
  # Setup default configuration for rvm.
58
58
  umask g+w
59
- export rvm_sandboxed=0
60
- export rvm_prefix="/usr/local"
59
+ export rvm_selfcontained=0
60
+ export rvm_prefix="/usr/local/"
61
61
  END_OF_RVMRC
62
62
 
63
63
  echo "Generating /usr/local/lib/rvm to load rvm"
data/install CHANGED
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [[ -z "$rvm_sandboxed" ]]; then
3
+ if [[ -z "$rvm_selfcontained" ]]; then
4
4
  if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
5
- export rvm_sandboxed=0
5
+ export rvm_selfcontained=0
6
6
  else
7
- export rvm_sandboxed=1
7
+ export rvm_selfcontained=1
8
8
  fi
9
9
  fi
10
10
 
@@ -61,7 +61,7 @@ done
61
61
 
62
62
  if [[ -z "$rvm_prefix" ]] ; then
63
63
  __rvm_load_rvmrc
64
- if [[ "$rvm_sandboxed" = "0" ]] ; then
64
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
65
65
  rvm_prefix="${rvm_prefix:-"/usr/local/"}"
66
66
  else
67
67
  rvm_prefix="${rvm_prefix:-"$HOME/."}"
@@ -95,10 +95,14 @@ rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
95
95
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
96
96
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
97
97
 
98
- if [[ -z "$rvm_prefix" ]] && [[ "root" = "$(whoami)" ]] ; then
99
- rvm_bin_path="${rvm_bin_path:-"/usr/local/bin"}"
98
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
99
+ rvm_bin_path="${rvm_bin_path:-"$rvm_prefix/bin"}"
100
+ rvm_man_path="${rvm_man_path:-"$rvm_prefix/share/man"}"
101
+ rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
100
102
  else
103
+ rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
101
104
  rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
105
+ rvm_rc_files="${rvm_rc_files:-"$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}"
102
106
  fi
103
107
 
104
108
  rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
@@ -321,8 +325,8 @@ else
321
325
  printf "\n [[ -s \$HOME/.rvm/scripts/rvm ]] && source \$HOME/.rvm/scripts/rvm"
322
326
  printf "\n Please note that this must only occur once - so, you only need to add it the first time you install rvm."
323
327
  printf "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
324
- printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
325
- printf "\n if [[ -n "\$PS1" ]] ; then"
328
+ printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
329
+ printf "\n if [[ -n \"\$PS1\" ]] ; then"
326
330
  printf "\n ... original content that was below the && return line ..."
327
331
  printf "\n fi # <= be sure to close the if."
328
332
  printf "\n #EOF .bashrc"
@@ -331,10 +335,10 @@ else
331
335
  printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above"
332
336
  printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
333
337
  fi
334
- if [[ -s $HOME/.bashrc ]] && grep -q '&& return' $HOME/.bashrc ; then
338
+ if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
335
339
  printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
336
- printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
337
- printf "\n if [[ -n "\$PS1" ]] ; then"
340
+ printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
341
+ printf "\n if [[ -n \"\$PS1\" ]] ; then"
338
342
  printf "\n ... original content that was below the && return line ..."
339
343
  printf "\n fi # <= be sure to close the if."
340
344
  printf "\n #EOF .bashrc"
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 44
4
+ :patch: 45
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.1.44"
8
+ s.version = "0.1.45"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Wayne E. Seguin"]
12
- s.date = %q{2010-08-06}
12
+ s.date = %q{2010-08-11}
13
13
  s.default_executable = %q{rvm-install}
14
14
  s.description = %q{Manages Ruby interpreter environments and switching between them.}
15
15
  s.email = %q{wayneeseguin@gmail.com}
@@ -120,6 +120,7 @@ Gem::Specification.new do |s|
120
120
  "scripts/manpages",
121
121
  "scripts/match",
122
122
  "scripts/md5",
123
+ "scripts/migrate",
123
124
  "scripts/monitor",
124
125
  "scripts/notes",
125
126
  "scripts/package",
@@ -134,6 +135,7 @@ Gem::Specification.new do |s|
134
135
  "scripts/snapshot",
135
136
  "scripts/tools",
136
137
  "scripts/update",
138
+ "scripts/upgrade",
137
139
  "scripts/utility",
138
140
  "scripts/version",
139
141
  "scripts/wrapper"
@@ -59,9 +59,13 @@ create_alias() {
59
59
  else
60
60
  if [[ -z "$rvm_alias" ]] ; then
61
61
  rvm_ruby_string="$rvm_environment_identifier"
62
- rvm_expanding_aliases=1
63
- __rvm_become
64
- unset rvm_expanding_aliases
62
+ if [[ -z "$rvm_alias_expanded" ]]; then
63
+ rvm_expanding_aliases=1
64
+ __rvm_become
65
+ unset rvm_expanding_aliases
66
+ else
67
+ rvm_ruby_string="$rvm_environment_identifier"
68
+ fi
65
69
  if [[ -z "$rvm_ruby_string" ]]; then
66
70
  $rvm_scripts_path/log "error" "unknown ruby string specified"
67
71
  result=1
@@ -42,7 +42,7 @@ __rvm_parse_args() {
42
42
  ;;
43
43
 
44
44
  use)
45
- rvm_action=$rvm_token
45
+ rvm_action="$rvm_token"
46
46
  rvm_verbose_flag=1
47
47
  if [[ "ruby" = "$1" ]] ; then shift ; fi
48
48
  ;;
@@ -120,12 +120,6 @@ __rvm_parse_args() {
120
120
  rvm_parse_break=1
121
121
  ;;
122
122
 
123
- docs|alias|rubygems)
124
- rvm_action="$rvm_token"
125
- rvm_ruby_args="$(__rvm_quote_args "$@")"
126
- rvm_parse_break=1
127
- ;;
128
-
129
123
  -S)
130
124
  rvm_action="ruby"
131
125
  rvm_ruby_args="$rvm_token $(__rvm_quote_args "$@")"
@@ -138,7 +132,7 @@ __rvm_parse_args() {
138
132
  rvm_parse_break=1
139
133
  ;;
140
134
 
141
- exec|cleanup|tools|disk-usage|snapshot|repair)
135
+ docs|alias|rubygems|exec|cleanup|tools|disk-usage|snapshot|repair|migrate|upgrade)
142
136
  rvm_action="$rvm_token"
143
137
  rvm_ruby_args="$(__rvm_quote_args "$@")"
144
138
  rvm_parse_break=1
@@ -285,7 +279,7 @@ __rvm_parse_args() {
285
279
 
286
280
  --alias)
287
281
  if [[ -n "$1" ]]; then
288
- export rvm_ruby_aliases="$(echo "$1" | \tr ',' ' ')"
282
+ export rvm_ruby_aliases="$(echo "$rvm_ruby_aliases $1" | \tr ',' ' ' | __rvm_strip)"
289
283
  shift
290
284
  fi
291
285
  ;;
@@ -348,6 +342,11 @@ __rvm_parse_args() {
348
342
  fi
349
343
  ;;
350
344
 
345
+ --with-rubies)
346
+ rvm_ruby_strings="$1"
347
+ shift
348
+ ;;
349
+
351
350
  -C|--configure)
352
351
  if [[ ! -z "$1" ]] ; then
353
352
  rvm_ruby_configure_flags="$(echo $1 | sed -e 's#,--# --#g')"
@@ -385,7 +384,7 @@ __rvm_parse_args() {
385
384
  --) rvm_ruby_args="$*" ; rvm_parse_break=1 ;;
386
385
 
387
386
  *)
388
- if [[ ! -z "$rvm_token" ]] ; then
387
+ if [[ -n "$rvm_token" ]] ; then
389
388
  if [[ "gemset" = "$rvm_action" ]] ; then
390
389
  if $rvm_scripts_path/match "$rvm_token" "^.+${rvm_gemset_separator}.+$" ; then
391
390
  rvm_gemset_name="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $2}')"
@@ -411,6 +410,10 @@ __rvm_parse_args() {
411
410
  rvm_gemset_name="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $2}')"
412
411
  rvm_ruby_string="$(echo "$rvm_token" | awk -F${rvm_gemset_separator} '{print $1}')"
413
412
  rvm_ruby_strings="$rvm_token"
413
+ elif $rvm_scripts_path/match "$rvm_token" "^.+\\+.+$" ; then
414
+ rvm_ruby_alias="$(echo "$rvm_token" | awk -F+ '{print $2}')"
415
+ rvm_ruby_string="$(echo "$rvm_token" | awk -F+ '{print $1}')"
416
+ rvm_ruby_strings="$rvm_ruby_string"
414
417
  elif $rvm_scripts_path/match "$rvm_token" "-" ; then
415
418
  rvm_ruby_string="$rvm_token"
416
419
  rvm_ruby_strings="$rvm_token"
@@ -476,11 +479,11 @@ rvm() {
476
479
  __rvm_load_rvmrc
477
480
  __rvm_initialize
478
481
  __rvm_parse_args "$@"
479
-
480
482
  export BUNDLE_PATH GEM_HOME GEM_PATH rvm_ruby_string rvm_action rvm_bin_flag rvm_debug_flag rvm_delete_flag rvm_docs_type rvm_file_name rvm_gemset_name rvm_head_flag rvm_install_on_use_flag rvm_interactive rvm_llvm_flag rvm_make_flags rvm_proxy rvm_remove_flag rvm_ruby_args rvm_ruby_configure_flags rvm_ruby_file rvm_ruby_gem_home rvm_ruby_interpreter rvm_ruby_name rvm_ruby_version rvm_system_flag rvm_trace_flag rvm_use_flag rvm_user_flag rvm_verbose_flag rvm_patch_names rvm_patch_original_pwd rvm_clang_flag rvm_install_arguments
481
483
  export rvm_path rvm_rubies_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_patches_path rvm_patches_path rvm_patchsets_path rvm_log_path rvm_bin_path rvm_gems_path rvm_config_path rvm_tmp_path rvm_hooks_path rvm_gems_cache_path rvm_gemset_separator
482
484
 
483
485
  result=0
486
+
484
487
  case "$rvm_action" in
485
488
  use) __rvm_use ; result=$? ;;
486
489
  srcdir) __rvm_source_dir ; result=$? ;;
@@ -538,7 +541,7 @@ rvm() {
538
541
  unset old_rvm_ruby_string
539
542
  ;;
540
543
 
541
- cleanup|tools|snapshot|disk-usage|repair|alias|docs|rubygems)
544
+ cleanup|tools|snapshot|disk-usage|repair|alias|docs|rubygems|migrate|upgrade)
542
545
  __rvm_run_script "$rvm_action"
543
546
  result=$?
544
547
  ;;
@@ -2,6 +2,7 @@
2
2
 
3
3
  rvm_base_except="selector"
4
4
  source "$rvm_scripts_path/base"
5
+ result=0
5
6
 
6
7
  # Set it to cleanup the download on interruption.
7
8
  trap 'cleanup_download' 1 2 3 15
@@ -61,14 +62,19 @@ else
61
62
  download=1
62
63
  fi
63
64
 
65
+ # try to convert the ftp url to a http url
66
+ http_url="$(echo $url | sed -e 's/ftp:/http:/' -e 's/git:/http:/')"
67
+
64
68
  if [[ $download -gt 0 ]] ; then
65
69
  rm -f $archive
66
70
  eval $fetch_command "$url"
67
71
  result=$?
68
72
  if [[ $result -gt 0 ]] ; then
69
73
  retry=0
74
+ try_http=0
70
75
  if [[ $result -eq 78 ]] ; then
71
76
  $rvm_scripts_path/log "error" "The requested url does not exist: '$url'"
77
+ try_http=1
72
78
  elif [[ $result -eq 18 ]] ; then
73
79
  $rvm_scripts_path/log "error" "Partial file. Only a part of the file was transferred. Removing partial and re-trying."
74
80
  rm -f "$archive"
@@ -78,7 +84,8 @@ if [[ $download -gt 0 ]] ; then
78
84
  rm -f "$archive"
79
85
  retry=1
80
86
  else
81
- $rvm_scripts_path/log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log"
87
+ $rvm_scripts_path/log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log. Next we'll try to fetch via http."
88
+ try_http=1
82
89
  fi
83
90
 
84
91
  if [[ $retry -eq 1 ]] ; then
@@ -90,8 +97,20 @@ if [[ $download -gt 0 ]] ; then
90
97
  record_md5
91
98
  fi
92
99
  fi
100
+
101
+ if [[ $try_http -eq 1 ]] ; then
102
+ eval $fetch_command "$http_url"
103
+ result=$?
104
+ if [[ $result -gt 0 ]] ; then
105
+ $rvm_scripts_path/log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log"
106
+ else
107
+ record_md5
108
+ fi
109
+ fi
110
+
93
111
  else
94
112
  record_md5
95
113
  fi
96
114
  fi
115
+
97
116
  exit $result
@@ -176,14 +176,14 @@ gemset_copy() {
176
176
  fi
177
177
 
178
178
  if [[ -d "$source_path" ]] ; then
179
- if [[ ! -d "$destination_path" ]] ; then mkdir -p $destination_path ; fi
179
+ [[ ! -d "$destination_path" ]] && mkdir -p "$destination_path"
180
180
  $rvm_scripts_path/log "info" "Copying gemset from $source_ruby to $destination_ruby"
181
- for dir in bin doc gems specifications ; do
181
+ for dir in bin doc gems specifications cache ; do
182
182
  mkdir -p "$destination_path/$dir"
183
183
  cp -Rf "$source_path/$dir" "$destination_path/"
184
184
  done
185
185
  $rvm_scripts_path/log "info" "Making gemset for $destination_ruby pristine."
186
- (rvm "$destination_ruby" ; gemset_pristine)
186
+ __rvm_run_with_env "gemset.pristine" "$destination_ruby" "rvm gemset pristine"
187
187
  else
188
188
  $rvm_scripts_path/log "error" "Gems directory does not exist for $source_path ($source_path)"
189
189
  return 1
@@ -472,9 +472,9 @@ elif [[ "list" = "$action" ]] ; then
472
472
  elif [[ "gemdir" = "$action" ]] || [[ "gempath" = "$action" ]] || [[ "gemhome" = "$action" ]] || [[ "home" = "$action" ]] || [[ "path" = "$action" ]] || [[ "version" = "$action" ]] ; then
473
473
  gemset_info
474
474
  elif [[ "install" = "$action" ]] ; then
475
- gem_install $*
475
+ gem_install "$@"
476
476
  elif [[ "pristine" = "$action" ]] ; then
477
- gemset_pristine $*
477
+ gemset_pristine "$@"
478
478
  elif [[ "initial" = "$action" ]] ; then
479
479
  gemset_initial
480
480
  elif [[ "prune" = "$action" ]] ; then
@@ -95,7 +95,7 @@ info_debug() {
95
95
  fi
96
96
  done
97
97
 
98
- if [[ "$rvm_sandboxed" = "0" ]] ; then
98
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
99
99
  debug_files="$rvm_config_path/alias $rvm_config_path/system $rvm_config_path/db /etc/rvmrc /etc/gemrc"
100
100
  else
101
101
  debug_files="$rvm_config_path/alias $rvm_config_path/system $rvm_config_path/db $HOME/.rvmrc $HOME/.gemrc"
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- rvm_sandboxed="${rvm_sandboxed:-1}"
3
+ rvm_selfcontained="${rvm_selfcontained:-1}"
4
4
 
5
- if [[ "$rvm_sandboxed" = "0" ]] ; then
5
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
6
6
  rvm_bin_path="${rvm_bin_path:-"$rvm_prefix/bin"}"
7
7
  rvm_man_path="${rvm_man_path:-"$rvm_prefix/share/man"}"
8
8
  rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
@@ -36,5 +36,5 @@ rvm_gemset_separator="${rvm_gemset_separator:-"@"}"
36
36
  rvm_project_rvmrc="${rvm_project_rvmrc:-1}"
37
37
  rvm_project_rvmrc_default="${rvm_project_rvmrc_default:-0}"
38
38
 
39
- export rvm_path rvm_patches_path rvm_rubies_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_log_path rvm_bin_path rvm_gems_path rvm_config_path rvm_tmp_path rvm_hooks_path rvm_gems_cache_path rvm_gemset_separator rvm_gemsets_path rvm_repo_path rvm_patchsets_path rvm_sandboxed
39
+ export rvm_path rvm_patches_path rvm_rubies_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_log_path rvm_bin_path rvm_gems_path rvm_config_path rvm_tmp_path rvm_hooks_path rvm_gems_cache_path rvm_gemset_separator rvm_gemsets_path rvm_repo_path rvm_patchsets_path rvm_selfcontained
40
40
 
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [[ -z "$rvm_sandboxed" ]]; then
3
+ if [[ -z "$rvm_selfcontained" ]]; then
4
4
  if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
5
- export rvm_sandboxed=0
5
+ export rvm_selfcontained=0
6
6
  else
7
- export rvm_sandboxed=1
7
+ export rvm_selfcontained=1
8
8
  fi
9
9
  fi
10
10
 
@@ -61,7 +61,7 @@ done
61
61
 
62
62
  if [[ -z "$rvm_prefix" ]] ; then
63
63
  __rvm_load_rvmrc
64
- if [[ "$rvm_sandboxed" = "0" ]] ; then
64
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
65
65
  rvm_prefix="${rvm_prefix:-"/usr/local/"}"
66
66
  else
67
67
  rvm_prefix="${rvm_prefix:-"$HOME/."}"
@@ -95,10 +95,14 @@ rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
95
95
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
96
96
  rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
97
97
 
98
- if [[ -z "$rvm_prefix" ]] && [[ "root" = "$(whoami)" ]] ; then
99
- rvm_bin_path="${rvm_bin_path:-"/usr/local/bin"}"
98
+ if [[ "$rvm_selfcontained" = "0" ]] ; then
99
+ rvm_bin_path="${rvm_bin_path:-"$rvm_prefix/bin"}"
100
+ rvm_man_path="${rvm_man_path:-"$rvm_prefix/share/man"}"
101
+ rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
100
102
  else
103
+ rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
101
104
  rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
105
+ rvm_rc_files="${rvm_rc_files:-"$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}"
102
106
  fi
103
107
 
104
108
  rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
@@ -321,8 +325,8 @@ else
321
325
  printf "\n [[ -s \$HOME/.rvm/scripts/rvm ]] && source \$HOME/.rvm/scripts/rvm"
322
326
  printf "\n Please note that this must only occur once - so, you only need to add it the first time you install rvm."
323
327
  printf "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
324
- printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
325
- printf "\n if [[ -n "\$PS1" ]] ; then"
328
+ printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
329
+ printf "\n if [[ -n \"\$PS1\" ]] ; then"
326
330
  printf "\n ... original content that was below the && return line ..."
327
331
  printf "\n fi # <= be sure to close the if."
328
332
  printf "\n #EOF .bashrc"
@@ -331,10 +335,10 @@ else
331
335
  printf "\n placing all non-interactive items in the .bashrc, including the 'source' line above"
332
336
  printf "\n3) Then $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
333
337
  fi
334
- if [[ -s $HOME/.bashrc ]] && grep -q '&& return' $HOME/.bashrc ; then
338
+ if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
335
339
  printf "\n\nWARNING: you have a 'return' statement in your .bashrc, likely this will cause untold havoc."
336
- printf "\n This means that if you see '[ -z "\$PS1" ] && return' then you must change this line to:"
337
- printf "\n if [[ -n "\$PS1" ]] ; then"
340
+ printf "\n This means that if you see '[ -z \"\$PS1\" ] && return' then you must change this line to:"
341
+ printf "\n if [[ -n \"\$PS1\" ]] ; then"
338
342
  printf "\n ... original content that was below the && return line ..."
339
343
  printf "\n fi # <= be sure to close the if."
340
344
  printf "\n #EOF .bashrc"