rvm 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -23,11 +23,8 @@ Options
23
23
  -l|--level - patch level to use with rvm use / install
24
24
  --prefix - path for all rvm files (~/.rvm/), with trailing slash!
25
25
  --bin - path for binaries to be placed (~/.rvm/bin/)
26
- --source - src directory to use (~/.rvm/src/)
27
- --archives - directory for downladed files (~/.rvm/archives/)
28
26
  -S - Specify a script file to attempt to load and run (rubydo)
29
27
  -e - Execute code from the command line.
30
- -G - root gem path to use
31
28
  --gems - Used to set the 'gems_flag', use with 'remove' to remove gems
32
29
  --archive - Used to set the 'archive_flag', use with 'remove' to remove archive
33
30
  --patch - With MRI Rubies you may specify one or more full paths to patches
@@ -74,12 +71,12 @@ Action
74
71
  specified ruby and gemset combination. Used under the hood for
75
72
  passenger support and the like.
76
73
 
77
- cleanup - Lets you remove stale source folders / archives and other miscellaneous
74
+ cleanup - Lets you remove stale source folders / archives and other miscellaneous
78
75
  data associated with rvm.
79
76
  repair - Lets you repair parts of your environment e.g. wrappers, env files and
80
77
  and similar files (e.g. general maintenance).
81
78
  snapshot - Lets your backup / restore an rvm installation in a lightweight manner.
82
-
79
+
83
80
  disk-usage - Tells you how much disk space rvm install is using.
84
81
  tools - Provides general information about the ruby environment,
85
82
  primarily useful when scripting rvm.
@@ -64,7 +64,9 @@ if [[ -n "$ruby" && -n "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; then
64
64
 
65
65
  if [[ ${gemset_flag:-0} -gt 0 ]] ; then
66
66
  case "${GEM_HOME:-""}" in
67
- *${rvm_gemset_separator}*) gemset="${rvm_gemset_separator}${GEM_HOME/*${rvm_gemset_separator}/}" ;;
67
+ *${rvm_gemset_separator:-"@"}*)
68
+ gemset="${rvm_gemset_separator:-"@"}${GEM_HOME/*${rvm_gemset_separator:-"@"}/}"
69
+ ;;
68
70
  esac
69
71
  fi
70
72
 
@@ -96,7 +98,7 @@ if [[ -n "$ruby" && -n "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; then
96
98
 
97
99
  eval "prompt=\"$format\""
98
100
 
99
- echo "$prompt" | sed -e 's#^[[:space:]]*-*##g' -e 's#--*#-#g' -e 's#-*[[:space:]]*$##' -e 's#-'${rvm_gemset_separator}'#'${rvm_gemset_separator}'#'
101
+ echo "$prompt" | sed -e 's#^[[:space:]]*-*##g' -e 's#--*#-#g' -e 's#-*[[:space:]]*$##' -e 's#-'${rvm_gemset_separator:-"@"}'#'${rvm_gemset_separator:-"@"}'#'
100
102
 
101
103
  else
102
104
  while [[ $# -gt 0 ]] ; do
@@ -3,7 +3,7 @@
3
3
  __rvm_shell_lookup_script() {
4
4
  local relative_scripts_dir
5
5
  relative_scripts_dir="$(dirname -- "$(dirname -- "$0")")/scripts"
6
- for directory in "$rvm_scripts_path" "$HOME/.rvm/scripts" "/usr/local/rvm/scripts" "$relative_scripts_dir"; do
6
+ for directory in "$rvm_path/scripts" "$HOME/.rvm/scripts" "/usr/local/rvm/scripts" "$relative_scripts_dir"; do
7
7
  if [[ -d "$directory" && -s "$directory/rvm" ]]; then
8
8
  echo "$directory/rvm"
9
9
  return
@@ -1,18 +1,18 @@
1
1
  # MRI Rubies
2
- (ruby-)1.8.6(-p399)
3
- (ruby-)1.8.6-head
4
- (ruby-)1.8.7(-p302)
5
- (ruby-)1.8.7-head
6
- (ruby-)1.9.1-p243
7
- (ruby-)1.9.1-p376
8
- (ruby-)1.9.1(-p429)
9
- (ruby-)1.9.1-head
10
- (ruby-)1.9.2-preview1
11
- (ruby-)1.9.2-preview3
12
- (ruby-)1.9.2-rc1
13
- (ruby-)1.9.2-rc2
14
- (ruby-)1.9.2(-p0)
15
- (ruby-)1.9.2-head
2
+ [ruby-]1.8.6[-p399]
3
+ [ruby-]1.8.6-head
4
+ [ruby-]1.8.7[-p302]
5
+ [ruby-]1.8.7-head
6
+ [ruby-]1.9.1-p243
7
+ [ruby-]1.9.1[-p376]
8
+ [ruby-]1.9.1-p429
9
+ [ruby-]1.9.1-head
10
+ [ruby-]1.9.2-preview1
11
+ [ruby-]1.9.2-preview3
12
+ [ruby-]1.9.2-rc1
13
+ [ruby-]1.9.2-rc2
14
+ [ruby-]1.9.2[-p0]
15
+ [ruby-]1.9.2-head
16
16
  ruby-head
17
17
 
18
18
  # JRuby
@@ -20,28 +20,28 @@ jruby-1.2.0
20
20
  jruby-1.3.1
21
21
  jruby-1.4.0
22
22
  jruby-1.5.1
23
- jruby(-1.5.2)
23
+ jruby[-1.5.2]
24
24
  jruby-head
25
25
 
26
26
  # Rubinius
27
- rbx(-1.0.1)
27
+ rbx[-1.0.1]
28
28
  rbx-head
29
29
 
30
30
  # Ruby Enterprise Edition
31
31
  ree-1.8.6
32
- ree(-1.8.7)
32
+ ree[-1.8.7]
33
33
  ree-1.8.6-head
34
34
  ree-1.8.7-head
35
35
 
36
36
  # MagLev
37
- maglev(-24067)
37
+ maglev[-24067]
38
38
  maglev-head
39
39
 
40
40
  # Shyouhei head, the default mput
41
- mput(-head)
41
+ mput[-head]
42
42
 
43
43
  # Mac OS X Snow Leopard Only
44
- macruby(-nightly) # the default macruby
44
+ macruby[-nightly] # the default macruby
45
45
  macruby-head # Build from the macruby git repository
46
46
 
47
47
  # IronRuby -- Not implemented yet.
@@ -12,10 +12,6 @@
12
12
  # This is where rvm installs and manages everything in by default.
13
13
  #export rvm_path="$HOME/.rvm"
14
14
 
15
- # Archives Path
16
- # This is where all tarballs/zipfiles/packagefiles are downladed to
17
- #export rvm_archives_path="${rvm_path}/archives"
18
-
19
15
  # Source Path
20
16
  # This is where rvm extracts to for compiling & installing.
21
17
  #export rvm_source_path="${rvm_path}/src"
data/install CHANGED
@@ -126,7 +126,7 @@ Be sure to get head often as rvm development happens fast,
126
126
  you can do this by running 'rvm update --head' followed by 'rvm reload'
127
127
  or opening a new shell
128
128
 
129
- w⦿‿⦿$
129
+ w⦿‿⦿t
130
130
 
131
131
  ~ Wayne
132
132
 
@@ -145,7 +145,7 @@ Upgrade Notes
145
145
  rvm remove X ; rvm install X
146
146
 
147
147
  * If you wish to have the 'pretty colors' again, set in ~/.rvmrc:
148
- export rvm_pretty_print=1
148
+ export rvm_pretty_print_flag=1
149
149
  "
150
150
  }
151
151
 
@@ -192,6 +192,7 @@ __rvm_initialize
192
192
  item="* "
193
193
  question="\n<?>"
194
194
  cwd="$PWD"
195
+
195
196
  source_path="${source_path:-$cwd}"
196
197
  rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
197
198
  rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
@@ -209,13 +210,10 @@ fi
209
210
 
210
211
  rvm_gems_path="${rvm_gems_path:-"$rvm_path/gems"}"
211
212
  rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
212
- rvm_scripts_path="${rvm_scripts_path:-"$rvm_path/scripts"}"
213
213
  rvm_config_path="${rvm_config_path:-"$rvm_path/config"}"
214
214
  rvm_hooks_path="${rvm_hooks_path:-"$rvm_path/hooks"}"
215
215
  rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
216
216
 
217
- export rvm_gemset_separator="@" # TODO: Remove this after a while.
218
-
219
217
  printf "
220
218
  RVM: Shell scripts enabling management of multiple ruby environments.
221
219
  RTFM: http://rvm.beginrescueend.com/
@@ -223,35 +221,60 @@ printf "
223
221
  "
224
222
 
225
223
  if [[ ${upgrade_flag:-0} -eq 1 ]] ;then
224
+
226
225
  printf "\nUpgrading the RVM installation in $rvm_path/"
226
+
227
227
  else
228
- printf "\nInstalling rvm to $rvm_path/"
228
+
229
+ printf "\nInstalling RVM to $rvm_path/"
230
+
229
231
  fi
230
232
 
231
- mkdir -p "$rvm_archives_path" "$rvm_src_path" "$rvm_log_path" "$rvm_bin_path" "$rvm_gems_path" "$rvm_rubies_path" "$rvm_config_path" "$rvm_hooks_path" "$rvm_tmp_path"
233
+ for directory in "$rvm_archives_path" "$rvm_src_path" "$rvm_log_path" "$rvm_bin_path" "$rvm_gems_path" "$rvm_rubies_path" "$rvm_config_path" "$rvm_hooks_path" "$rvm_tmp_path" ; do
234
+
235
+ if [[ ! -d "$directory" ]] ; then
236
+
237
+ mkdir -p "$directory"
238
+
239
+ fi
240
+
241
+ done
232
242
 
233
243
  for file in README LICENCE ; do
244
+
234
245
  cp -f "$source_path/$file" "$rvm_path/"
246
+
235
247
  done
236
248
 
237
249
  #
238
250
  # Scripts
239
251
  #
240
252
  for dir_name in config scripts examples lib hooks help patches; do
241
- mkdir -p "$rvm_path/$dir_name"
253
+
242
254
  if [[ -d "$source_path/$dir_name" ]] ; then
255
+
256
+ if [[ ! -d "$rvm_path/$dir_name" ]] ; then
257
+
258
+ mkdir -p "$rvm_path/$dir_name"
259
+
260
+ fi
261
+
243
262
  cp -Rf "$source_path/$dir_name" "$rvm_path"
263
+
244
264
  fi
245
- done ; unset dir_name
265
+
266
+ done
246
267
 
247
268
  if [[ ! -s "$rvm_config_path/user" ]] ; then
248
- mkdir -p "$rvm_config_path/"
249
269
  echo '# Users settings file, overrides db file settings and persists across installs.' >> "$rvm_config_path/user"
250
270
  fi
251
271
 
252
- scripts=("monitor" "match" "log" "install" "color" "db" "fetch" "log" "set" "package")
272
+ scripts=(monitor match log install color db fetch log set package)
273
+
253
274
  for script_name in "${scripts[@]}" ; do
254
- chmod +x "$rvm_scripts_path/$script_name" 2>/dev/null # Hide errors.
275
+
276
+ chmod +x "$rvm_path/scripts/$script_name" 2>/dev/null # Hide errors.
277
+
255
278
  done
256
279
 
257
280
  #
@@ -259,29 +282,48 @@ done
259
282
  #
260
283
  # Cleanse and purge...
261
284
  for file in rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby ; do
285
+
262
286
  rm -f "$rvm_bin_path/$file"
287
+
263
288
  cp -f "$source_path/binscripts/$file" $rvm_bin_path/
289
+
264
290
  done
265
- chmod +x "$rvm_bin_path"/*
291
+
292
+ chmod +x "$rvm_bin_path"/* # TODO: this is quite suboptimal.
266
293
 
267
294
  #
268
295
  # RC Files
269
296
  #
270
297
  if [[ -n "$rvm_auto_flag" ]] ; then
298
+
271
299
  printf "Checking rc files... ($rvm_rc_files)"
300
+
272
301
  if [[ "$rvm_loaded_flag" != "1" ]] ; then
302
+
273
303
  for rcfile in $(printf $rvm_rc_files) ; do
304
+
274
305
  if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
306
+
275
307
  if [[ -s "$HOME/.profile" ]] ; then
308
+
276
309
  if ! grep -q '.profile' "$rcfile" ; then
310
+
277
311
  echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
312
+
278
313
  printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> "$rcfile"
314
+
279
315
  fi
316
+
280
317
  fi
318
+
281
319
  if ! grep -q "scripts\/rvm" "$rcfile" ; then
282
- echo " Adding 'if [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi' to $rcfile."
283
- printf "\n# rvm-install added:\nif [[ -s $rvm_scripts_path/rvm ]] ; then source $rvm_scripts_path/rvm ; fi\n" >> "$rcfile"
320
+
321
+ echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
322
+
323
+ printf "\n# rvm-install added:\nif [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> "$rcfile"
324
+
284
325
  fi
326
+
285
327
  done
286
328
  fi
287
329
  fi
@@ -290,47 +332,91 @@ fi
290
332
  # Initial Interpreter Gemsets.
291
333
  #
292
334
  if [[ -d gemsets/ ]] ; then
293
- mkdir -p "$rvm_gemsets_path"
335
+
336
+ if [[ ! -d "$rvm_path/gemsets" ]] ; then
337
+
338
+ mkdir -p "$rvm_path/gemsets"
339
+
340
+ fi
294
341
 
295
342
  for gemset_file in $(builtin cd gemsets ; find \. -iname '*.gems' | sed 's/^\.\///') ; do
296
- destination="$rvm_gemsets_path/$gemset_file"
343
+
344
+ destination="$rvm_path/gemsets/$gemset_file"
345
+
297
346
  destination_path="$(dirname "$destination")"
347
+
298
348
  if [[ ! -s "$destination" ]] ; then
349
+
299
350
  mkdir -p "$destination_path"
351
+
300
352
  cp "gemsets/$gemset_file" "$destination"
353
+
301
354
  fi
302
- done ; unset destination destination_path gemset_file
355
+
356
+ done
357
+
358
+ unset destination destination_path gemset_file
359
+
303
360
  fi
304
361
 
305
362
  if [[ -d patchsets/ ]] ; then
306
- mkdir -p "$rvm_patchsets_path"
307
- for patchset_file in $(builtin cd patchsets ; find \. -iname '*' | sed 's/^\.\///') ; do
308
- destination="$rvm_patchsets_path/$patchset_file"
309
- destination_path="$(dirname "$destination")"
363
+
364
+ if [[ ! -d "$rvm_path/patchsets" ]] ; then
365
+
366
+ mkdir -p "$rvm_path/patchsets"
367
+
368
+ fi
369
+
370
+ patchsets=($(builtin cd patchsets ; find \. -iname '*' | sed 's/^\.\///'))
371
+
372
+ for patchset_file in "${patchsets[@]}" ; do
373
+
374
+ destination="$rvm_path/patchsets/$patchset_file"
375
+
310
376
  if [[ ! -s "$destination" ]] ; then
377
+
378
+ destination_path="$(dirname "$destination")"
379
+
311
380
  mkdir -p "$destination_path"
381
+
312
382
  cp "patchsets/$patchset_file" "$destination"
383
+
313
384
  fi
314
- done ; unset destination destination_path patchset_file
385
+ done
386
+
315
387
  fi
316
388
 
317
389
  #
318
390
  # Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0.
319
391
  #
320
392
  rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
393
+
321
394
  mkdir -p "$rvm_rubies_path/"
395
+
322
396
  for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
397
+
323
398
  if [[ -d "$ruby" ]] ; then
399
+
324
400
  mv "$ruby" "$rvm_rubies_path/"
401
+
325
402
  new_path="$rvm_rubies_path/$(basename $ruby)"
403
+
326
404
  for file in gem rake ; do
405
+
327
406
  if [[ -s "$new_path/bin/$file" ]] ; then
407
+
328
408
  sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}" > "${new_path}/bin/${file}.new"
409
+
329
410
  mv -f "$new_path/bin/$file.new" "$new_path/bin/$file"
411
+
330
412
  chmod +x "$new_path/bin/$file"
413
+
331
414
  fi
415
+
332
416
  done
417
+
333
418
  fi
419
+
334
420
  done
335
421
  #
336
422
  # End of rubies migration.
@@ -340,36 +426,60 @@ done
340
426
  # Migrate old gemset directories to new gemset pattern.
341
427
  #
342
428
  for gemset in "$rvm_path"/gems/*\%* ; do
343
- new_path=${gemset/\%/${rvm_gemset_separator}}
429
+
430
+ new_path=${gemset/\%/${rvm_gemset_separator:-"@"}}
431
+
344
432
  if [[ -d "$gemset" ]] && [[ ! -d "$new_path" ]] ; then
433
+
345
434
  printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
435
+
346
436
  mv "$gemset" "$new_path"
437
+
347
438
  fi
439
+
348
440
  done
349
441
 
350
442
  for gemset in "$rvm_path"/gems/*\+* ; do
351
- new_path=${gemset/\+/${rvm_gemset_separator}}
443
+
444
+ new_path=${gemset/\+/${rvm_gemset_separator:-"@"}}
445
+
352
446
  if [[ -d "$gemset" && ! -d "$new_path" ]] ; then
447
+
353
448
  printf "\n Renaming $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
449
+
354
450
  mv $gemset $new_path
451
+
355
452
  fi
453
+
356
454
  done
357
455
 
358
456
  for gemset in "$rvm_path"/gems/*\@ ; do
457
+
359
458
  new_path=$(echo $gemset | sed -e 's#\@$##')
459
+
360
460
  if [[ -d "$gemset" && ! -d "$new_path" ]] ; then
461
+
361
462
  printf "\n Fixing: $(basename "$gemset") to $(basename "$new_path") for new gemset separator."
463
+
362
464
  mv "$gemset" "$new_path"
465
+
363
466
  fi
467
+
364
468
  done
365
469
 
366
470
  # Move from legacy defaults to the new, alias based system.
367
471
  if [[ -s "$rvm_config_path/default" ]]; then
368
- original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
472
+
473
+ original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
474
+
369
475
  if [[ -n "$original_version" ]]; then
370
- "$rvm_scripts_path/alias" create default "$original_version" &> /dev/null
476
+
477
+ "$rvm_path/scripts/alias" create default "$original_version" &> /dev/null
478
+
371
479
  fi ; unset original_version
480
+
372
481
  rm -rf "$rvm_config_path/default"
482
+
373
483
  fi
374
484
 
375
485
  #
@@ -380,13 +490,21 @@ printf "\n Correct permissions for base binaries in $rvm_bin_path..."
380
490
  mkdir -p "$rvm_bin_path"
381
491
 
382
492
  for file in rvm rvmsudo rvm-shell rvm-auto-ruby ; do
493
+
383
494
  [[ -s "$rvm_bin_path/$file" ]] && chmod +x "$rvm_bin_path/$file"
384
- done; unset file
495
+
496
+ done
497
+
385
498
  printf "\n Copying manpages into place."
386
499
 
387
- for man_file in $(builtin cd "$install_source_path/man" ; find * -type f -maxdepth 0 -print); do
500
+ files=($(builtin cd "$install_source_path/man" ; find . -maxdepth 1 -mindepth 1 -type f -print))
501
+
502
+ for file in "${files[@]//.\/}" ; do
503
+
388
504
  rm -rf "$rvm_man_path/$man_file"
505
+
389
506
  cp -R "$install_source_path/man/$man_file" "$rvm_man_path/"
507
+
390
508
  done
391
509
 
392
510
  [[ "$upgrade_flag" = 0 ]] && ./scripts/notes
@@ -400,13 +518,19 @@ if [[ ${upgrade_flag:-0} -eq 1 ]] ; then
400
518
  check_rubyopt_conditions
401
519
 
402
520
  printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
521
+
403
522
  else
523
+
404
524
  if [[ ${rvm_selfcontained:-0} -eq 1 ]] ; then
525
+
405
526
  installation_complete
527
+
406
528
  fi
407
529
 
408
530
  if [[ -s "$HOME/.bashrc" ]] && grep -q '&& return' "$HOME/.bashrc" ; then
531
+
409
532
  andand_return_warning
533
+
410
534
  fi
411
535
 
412
536
  check_rubyopt_conditions