rvm 1.0.11 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/scripts/hash CHANGED
@@ -13,7 +13,8 @@ if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
13
13
 
14
14
  if [[ -n "${ZSH_VERSION:-""}" ]] ; then __array_start=1 ; else __array_start=0 ; fi
15
15
 
16
- hash() {
16
+ hash()
17
+ {
17
18
  hash_name=$1 ; hash_key=$2 ; hash_value=$3
18
19
 
19
20
  eval "_hash_${hash_name}_keys=\${_hash_${hash_name}_keys:-()} ; _hash_${hash_name}_values=\${_hash_${hash_name}_values:-()}"
data/scripts/info CHANGED
@@ -6,7 +6,8 @@ source "$rvm_path/scripts/base"
6
6
 
7
7
  source "$rvm_path/scripts/version"
8
8
 
9
- version_for() {
9
+ version_for()
10
+ {
10
11
  local binary=${1:-""}
11
12
 
12
13
  if command -v "$binary" >/dev/null ; then
@@ -18,7 +19,8 @@ version_for() {
18
19
  return 0
19
20
  }
20
21
 
21
- info_system() {
22
+ info_system()
23
+ {
22
24
  rvm_info="
23
25
  system:
24
26
  uname: \"$(uname -a)\"
@@ -27,7 +29,8 @@ info_system() {
27
29
  "
28
30
  }
29
31
 
30
- info_rvm() {
32
+ info_rvm()
33
+ {
31
34
  rvm_info="
32
35
  rvm:
33
36
  version: \"$(__rvm_version | \tr "\n" ' ' | __rvm_strip)\"
@@ -35,7 +38,8 @@ info_rvm() {
35
38
 
36
39
  }
37
40
 
38
- info_ruby() {
41
+ info_ruby()
42
+ {
39
43
  [[ "$(__rvm_environment_identifier)" == "system" ]] && return
40
44
  ruby=$(command -v ruby)
41
45
  if [[ $? -eq 0 ]] && [[ -x "$ruby" ]] ; then full_version="$($ruby -v)" ; fi
@@ -51,7 +55,8 @@ info_ruby() {
51
55
 
52
56
  }
53
57
 
54
- info_homes() {
58
+ info_homes()
59
+ {
55
60
  rvm_info="
56
61
  homes:
57
62
  gem: \"${GEM_HOME:-"not set"}\"
@@ -59,7 +64,8 @@ info_homes() {
59
64
  "
60
65
  }
61
66
 
62
- info_binaries() {
67
+ info_binaries()
68
+ {
63
69
  rvm_info="
64
70
  binaries:
65
71
  ruby: \"$(command -v ruby)\"
@@ -69,7 +75,8 @@ info_binaries() {
69
75
  "
70
76
  }
71
77
 
72
- info_environment() {
78
+ info_environment()
79
+ {
73
80
  rvm_info="
74
81
  environment:
75
82
  PATH: \"${PATH:-""}\"
@@ -89,7 +96,8 @@ info_environment() {
89
96
  rvm_info="$rvm_info\n"
90
97
  }
91
98
 
92
- info_debug() {
99
+ info_debug()
100
+ {
93
101
  rvm_info="
94
102
 
95
103
  $(__rvm_version)
@@ -144,7 +152,8 @@ $(__rvm_version)
144
152
  rvm_info="$rvm_info\ngem sources:\n$(gem sources | awk '/gems/')\n\n"
145
153
  }
146
154
 
147
- info_sections() {
155
+ info_sections()
156
+ {
148
157
 
149
158
  for section in $(printf "${sections//,/ }") ; do
150
159
 
data/scripts/install CHANGED
@@ -1,10 +1,13 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  set -o errtrace
4
+ set -o errexit
5
+
4
6
  export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
5
7
 
6
8
  if [[ -z "$rvm_selfcontained" ]]; then
7
- if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
9
+ if [[ "root" = "$(whoami)" \
10
+ || -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
8
11
  export rvm_selfcontained=0
9
12
  else
10
13
  export rvm_selfcontained=1
@@ -15,34 +18,49 @@ unset rvm_auto_flag
15
18
 
16
19
  install_source_path="$(dirname "$0" | sed 's#\/scripts$##')"
17
20
 
18
- if [[ -d "$install_source_path/scripts" ]] && [[ -s "$install_source_path/scripts/utility" ]] ; then
21
+ if [[ -d "$install_source_path/scripts" \
22
+ && -s "$install_source_path/scripts/utility" ]] ; then
19
23
  builtin cd "$install_source_path"
20
24
  fi
21
25
 
22
26
  source scripts/version
23
27
  source scripts/utility
24
28
 
25
- usage() {
29
+ usage()
30
+ {
26
31
  printf "
27
32
  Usage:
33
+
28
34
  ${0} [options]
29
35
 
30
36
  options:
37
+
31
38
  --auto : Automatically update shell profile files.
39
+
32
40
  --prefix : Installation prefix directory.
41
+
33
42
  --help : Display help/usage (this) message
43
+
34
44
  --version : display rvm package version
45
+
35
46
  "
36
47
  }
37
48
 
38
- check_rubyopt_conditions() {
49
+ check_rubyopt_conditions()
50
+ {
39
51
  if [[ -n "${RUBYOPT:-""}" ]]; then
40
- printf "\n\nWARNING: You have RUBYOPT set in your current environment. This may interfere with normal rvm"
41
- printf "\n operation. If errors show up, please try unsetting RUBYOPT first.\n"
52
+ printf "
53
+
54
+ WARNING: You have RUBYOPT set in your current environment.
55
+ This may cause rubies to not work as you expect them to as it is not supported
56
+ by all of them If errors show up, please try unsetting RUBYOPT first.
57
+
58
+ "
42
59
  fi
43
60
  }
44
61
 
45
- andand_return_instructions() {
62
+ andand_return_instructions()
63
+ {
46
64
  printf "
47
65
  This means that if you see something like:
48
66
 
@@ -63,7 +81,8 @@ EOF - This marks the end of the .bashrc file
63
81
  "
64
82
  }
65
83
 
66
- installation_complete() {
84
+ installation_complete()
85
+ {
67
86
  printf "
68
87
  You must now complete the install by loading RVM in new shells.
69
88
 
@@ -91,7 +110,8 @@ installation_complete() {
91
110
  \n"
92
111
  }
93
112
 
94
- andand_return_warning() {
113
+ andand_return_warning()
114
+ {
95
115
  printf "
96
116
  WARNING: you have a 'return' statement in your ~/.bashrc
97
117
  This could cause some features of RVM to not work.
@@ -104,7 +124,8 @@ andand_return_warning() {
104
124
  \n"
105
125
  }
106
126
 
107
- thank_you() {
127
+ thank_you()
128
+ {
108
129
  printf "
109
130
  ${name:-"$(whoami)"},
110
131
 
@@ -135,7 +156,8 @@ or opening a new shell
135
156
  "
136
157
  }
137
158
 
138
- upgrade_notes() {
159
+ upgrade_notes()
160
+ {
139
161
  printf "
140
162
 
141
163
  Upgrade Notes
@@ -187,14 +209,23 @@ fi
187
209
 
188
210
  source scripts/initialize
189
211
 
190
- if grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null || grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null; then
212
+ if grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null \
213
+ || grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null ; then
214
+
191
215
  if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
216
+
192
217
  export upgrade_flag=1
218
+
193
219
  else
220
+
194
221
  export upgrade_flag=0
222
+
195
223
  fi
224
+
196
225
  else
226
+
197
227
  export upgrade_flag=0
228
+
198
229
  fi
199
230
 
200
231
  __rvm_initialize
@@ -237,7 +268,17 @@ else
237
268
 
238
269
  fi
239
270
 
240
- directories=( "${rvm_archives_path:-"$rvm_path/archives"}" "${rvm_src_path:-"$rvm_path/src"}" "${rvm_log_path:-"$rvm_path/log"}" "$rvm_bin_path" "${rvm_gems_path:-"$rvm_path/gems"}" "${rvm_rubies_path:-"$rvm_path/rubies"}" "$rvm_path/config" "${rvm_tmp_path:-"$rvm_path/tmp"}" "$rvm_path/bin" )
271
+ directories=(
272
+ "${rvm_archives_path:-"$rvm_path/archives"}"
273
+ "${rvm_src_path:-"$rvm_path/src"}"
274
+ "${rvm_log_path:-"$rvm_path/log"}"
275
+ "$rvm_bin_path"
276
+ "${rvm_gems_path:-"$rvm_path/gems"}"
277
+ "${rvm_rubies_path:-"$rvm_path/rubies"}"
278
+ "$rvm_path/config"
279
+ "${rvm_tmp_path:-"$rvm_path/tmp"}"
280
+ "$rvm_path/bin"
281
+ )
241
282
 
242
283
  for directory in "${directories[@]}" ; do
243
284
 
@@ -277,7 +318,8 @@ for dir_name in config scripts examples lib hooks help patches; do
277
318
  done
278
319
 
279
320
  if [[ ! -s "$rvm_path/config/user" ]] ; then
280
- echo '# Users settings file, overrides db file settings and persists across installs.' >> "$rvm_path/config/user"
321
+ echo '# User settings, overrides db settings and persists across installs.' \
322
+ >> "$rvm_path/config/user"
281
323
  fi
282
324
 
283
325
  scripts=(monitor match log install color db fetch log set package)
@@ -321,9 +363,12 @@ if [[ ${rvm_auto_flag:-0} -eq 1 ]] ; then
321
363
 
322
364
  if ! grep -q '.profile' "$rcfile" ; then
323
365
 
324
- echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
366
+ echo " Adding profile sourcing line to $rcfile."
325
367
 
326
- printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> "$rcfile"
368
+ printf "
369
+ # rvm-install added line:
370
+ [[ -s \$HOME/.profile ]] && source \$HOME/.profile
371
+ " >> "$rcfile"
327
372
 
328
373
  fi
329
374
 
@@ -331,9 +376,12 @@ if [[ ${rvm_auto_flag:-0} -eq 1 ]] ; then
331
376
 
332
377
  if ! grep -q "scripts\/rvm" "$rcfile" ; then
333
378
 
334
- echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
379
+ echo " Adding rvm loading line to $rcfile."
335
380
 
336
- printf "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> "$rcfile"
381
+ printf "
382
+ # rvm-install added:
383
+ [[ -s \"$rvm_path/.rvm/scripts/rvm\" ]] && . \"$rvm_path/.rvm/scripts/rvm\"
384
+ " >> "$rcfile"
337
385
 
338
386
  fi
339
387
 
@@ -352,9 +400,10 @@ if [[ -d gemsets/ ]] ; then
352
400
 
353
401
  fi
354
402
 
355
- for gemset_file in $(builtin cd gemsets ; find \. -iname '*.gems' | sed 's/^\.\///') ; do
403
+ for gemset_file in $(find "$PWD/gemsets" -iname '*.gems' | sed 's/^\.\///') ; do
356
404
 
357
- destination="$rvm_path/gemsets/$gemset_file"
405
+ cwd="${PWD//\//\\/}\/gemsets\/"
406
+ destination="$rvm_path/gemsets/${gemset_file/$cwd}"
358
407
 
359
408
  destination_path="$(dirname "$destination")"
360
409
 
@@ -362,7 +411,7 @@ if [[ -d gemsets/ ]] ; then
362
411
 
363
412
  mkdir -p "$destination_path"
364
413
 
365
- cp "gemsets/$gemset_file" "$destination"
414
+ cp "$gemset_file" "$destination"
366
415
 
367
416
  fi
368
417
 
@@ -404,7 +453,8 @@ fi
404
453
  #
405
454
  mkdir -p "${rvm_rubies_path:-"$rvm_path/rubies"}/"
406
455
 
407
- for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
456
+ for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* \
457
+ $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
408
458
 
409
459
  if [[ -d "$ruby" ]] ; then
410
460
 
@@ -416,7 +466,8 @@ for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-*
416
466
 
417
467
  if [[ -s "$new_path/bin/$file" ]] ; then
418
468
 
419
- sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}" > "${new_path}/bin/${file}.new"
469
+ sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}" \
470
+ > "${new_path}/bin/${file}.new"
420
471
 
421
472
  mv -f "$new_path/bin/$file.new" "$new_path/bin/$file"
422
473
 
@@ -481,7 +532,8 @@ done
481
532
  # Move from legacy defaults to the new, alias based system.
482
533
  if [[ -s "$rvm_path/config/default" ]]; then
483
534
 
484
- original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
535
+ original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" \
536
+ | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
485
537
 
486
538
  if [[ -n "$original_version" ]]; then
487
539
 
@@ -505,19 +557,24 @@ mkdir -p "${rvm_bin_path:-"$rvm_path/bin"}"
505
557
  files=(rvm rvmsudo rvm-shell rvm-auto-ruby)
506
558
  for file in "${files[@]}" ; do
507
559
 
508
- [[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] && chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
560
+ if [[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] ; then
561
+
562
+ chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
563
+
564
+ fi
509
565
 
510
566
  done
511
567
 
512
568
  printf "\n Copying manpages into place."
513
569
 
514
- files=($(builtin cd "$install_source_path/man" ; find . -maxdepth 1 -mindepth 1 -type f -print))
570
+ files=($(builtin cd "$install_source_path/man" ; \
571
+ find . -maxdepth 1 -mindepth 1 -type f -print))
515
572
 
516
573
  for file in "${files[@]//.\/}" ; do
517
574
 
518
- rm -rf "$rvm_man_path/$man_file"
575
+ rm -rf "$rvm_man_path/$file"
519
576
 
520
- cp -R "$install_source_path/man/$man_file" "$rvm_man_path/"
577
+ cp -R "$install_source_path/man/$file" "$rvm_man_path/"
521
578
 
522
579
  done
523
580
 
@@ -537,7 +594,7 @@ if [[ ${#files[@]} -gt 0 ]] ; then
537
594
  fi
538
595
 
539
596
  if [[ $upgrade_flag -eq 0 ]] ; then
540
- chmod +x ./script/notes # Sometimes things don't clone properly :/
597
+ chmod +x ./scripts/notes # Sometimes things don't clone properly :/
541
598
  ./scripts/notes
542
599
  fi
543
600
 
@@ -549,8 +606,6 @@ if [[ ${upgrade_flag:-0} -eq 1 ]] ; then
549
606
 
550
607
  check_rubyopt_conditions
551
608
 
552
- regenerate_wrappers
553
-
554
609
  printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
555
610
 
556
611
  else
data/scripts/list CHANGED
@@ -4,7 +4,8 @@ rvm_base_except="selector"
4
4
 
5
5
  source "$rvm_path/scripts/base"
6
6
 
7
- usage() {
7
+ usage()
8
+ {
8
9
  printf "
9
10
  Usage:
10
11
 
@@ -12,13 +13,15 @@ usage() {
12
13
 
13
14
  Actions:
14
15
 
15
- {help,known,gemsets,default [string],rubies,strings,known_strings}
16
+ {help,known,gemsets,default [string],rubies,strings,known_strings,ruby_svn_tags}
16
17
 
17
18
  "
19
+
18
20
  return 0
19
21
  }
20
22
 
21
- list_gemsets() {
23
+ list_gemsets()
24
+ {
22
25
  local all_rubies version versions ruby_version_name current_ruby selected system_ruby system_version string binary
23
26
 
24
27
  if [[ "${1:-""}" = "strings" ]]; then
@@ -93,7 +96,8 @@ list_gemsets() {
93
96
  return 0
94
97
  }
95
98
 
96
- list_default() {
99
+ list_default()
100
+ {
97
101
 
98
102
  local version string
99
103
 
@@ -128,8 +132,8 @@ list_default() {
128
132
  return 0
129
133
  }
130
134
 
131
- list_ruby_svn_tags() {
132
-
135
+ list_ruby_svn_tags()
136
+ {
133
137
  local prefix tag
134
138
 
135
139
  while read -r tag
@@ -145,8 +149,8 @@ list_ruby_svn_tags() {
145
149
 
146
150
  # Query for valid rvm ruby strings
147
151
  # This is meant to be used with scripting.
148
- list_strings() {
149
-
152
+ list_strings()
153
+ {
150
154
  (
151
155
  cd "$rvm_path/rubies"
152
156
 
@@ -157,8 +161,8 @@ list_strings() {
157
161
  }
158
162
 
159
163
  # This is meant to be used with scripting.
160
- list_gemset_strings() {
161
-
164
+ list_gemset_strings()
165
+ {
162
166
  local all_rubies ruby_name gemset gemsets
163
167
 
164
168
  all_rubies="$(list_strings)"
@@ -178,15 +182,15 @@ list_gemset_strings() {
178
182
  }
179
183
 
180
184
  # This is meant to be used with scripting.
181
- list_known_strings() {
182
-
185
+ list_known_strings()
186
+ {
183
187
  sed -e 's/#.*$//g' -e 's#\[##g' -e 's#\]##g' < "$rvm_path/config/known" | sort -r | uniq
184
188
 
185
189
  return $?
186
190
  }
187
191
 
188
- list_known() {
189
-
192
+ list_known()
193
+ {
190
194
  if [[ "${1:-""}" = "strings" ]]; then
191
195
 
192
196
  list_known_strings
@@ -207,15 +211,15 @@ list_known() {
207
211
  return $?
208
212
  }
209
213
 
210
- list_rubies_strings() {
211
-
214
+ list_rubies_strings()
215
+ {
212
216
  ( builtin cd "$rvm_path/rubies" ; find -maxdepth 0 -type d | tail -n+2 | xargs -n1 basename -- | __rvm_strip )
213
217
 
214
218
  return $?
215
219
  }
216
220
 
217
- list_rubies() {
218
-
221
+ list_rubies()
222
+ {
219
223
  local current_ruby rubies version selected system_ruby system_version string binary
220
224
 
221
225
  if [[ "${1:-""}" = "strings" ]]; then list_rubies_strings ; return 0 ; fi