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/binscripts/rvm-prompt +99 -7
- data/binscripts/rvmsudo +1 -3
- data/config/db +4 -2
- data/config/known +4 -2
- data/config/md5 +2 -0
- data/contrib/install-system-wide +2 -2
- data/contrib/r +16 -0
- data/install +86 -31
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +2 -2
- data/scripts/array +6 -3
- data/scripts/cd +39 -10
- data/scripts/cleanup +9 -6
- data/scripts/cli +6 -5
- data/scripts/completion +2 -0
- data/scripts/db +2 -1
- data/scripts/default +6 -3
- data/scripts/disk-usage +12 -8
- data/scripts/docs +8 -4
- data/scripts/env +2 -1
- data/scripts/environment-convertor +12 -6
- data/scripts/fetch +4 -5
- data/scripts/gemsets +56 -33
- data/scripts/hash +2 -1
- data/scripts/info +18 -9
- data/scripts/install +86 -31
- data/scripts/list +22 -18
- data/scripts/manage +217 -114
- data/scripts/migrate +11 -5
- data/scripts/monitor +15 -5
- data/scripts/notes +2 -2
- data/scripts/override_gem +2 -1
- data/scripts/package +28 -15
- data/scripts/patches +6 -3
- data/scripts/patchsets +6 -3
- data/scripts/repair +48 -12
- data/scripts/rubygems +3 -2
- data/scripts/rvm-install +86 -31
- data/scripts/selector +43 -21
- data/scripts/set +10 -8
- data/scripts/snapshot +16 -6
- data/scripts/tools +8 -4
- data/scripts/update +86 -31
- data/scripts/upgrade +62 -24
- data/scripts/utility +362 -180
- data/scripts/version +5 -2
- data/scripts/wrapper +40 -20
- metadata +4 -4
data/scripts/manage
CHANGED
@@ -6,7 +6,8 @@ original_ruby_string=${rvm_ruby_string:-""}
|
|
6
6
|
source "$rvm_path/scripts/base"
|
7
7
|
source "$rvm_path/scripts/patches"
|
8
8
|
|
9
|
-
__rvm_check_for_clang()
|
9
|
+
__rvm_check_for_clang()
|
10
|
+
{
|
10
11
|
if [[ -n "${rvm_clang_flag:-""}" ]] && ! command -v clang >/dev/null ; then
|
11
12
|
"$rvm_path/scripts/log" "fail" "\nYou passed the --clang option and clang is not in your path. \nPlease try again or do not use --clang.\n"
|
12
13
|
return 1
|
@@ -14,7 +15,8 @@ __rvm_check_for_clang() {
|
|
14
15
|
}
|
15
16
|
|
16
17
|
# Checks for bison, returns zero iff it is found
|
17
|
-
__rvm_check_for_bison()
|
18
|
+
__rvm_check_for_bison()
|
19
|
+
{
|
18
20
|
if [[ ${rvm_head_flag:-0} -gt 0 ]]; then
|
19
21
|
command -v bison > /dev/null
|
20
22
|
result=$?
|
@@ -29,7 +31,8 @@ __rvm_check_for_bison() {
|
|
29
31
|
|
30
32
|
# Emits a number of patches to STDOUT, each on a new name
|
31
33
|
# Expands patchsets etc.
|
32
|
-
__rvm_current_patch_names()
|
34
|
+
__rvm_current_patch_names()
|
35
|
+
{
|
33
36
|
# TODO: Lookup default patches on rvm_ruby_string heirarchy.
|
34
37
|
local separator patches level name
|
35
38
|
|
@@ -55,8 +58,8 @@ __rvm_current_patch_names() {
|
|
55
58
|
return 0
|
56
59
|
}
|
57
60
|
|
58
|
-
__rvm_apply_patches()
|
59
|
-
|
61
|
+
__rvm_apply_patches()
|
62
|
+
{
|
60
63
|
local patches patch_name patch_level_separator patch_fuzziness patch_level source_directory full_patch_path
|
61
64
|
|
62
65
|
result=0
|
@@ -92,7 +95,9 @@ __rvm_apply_patches() {
|
|
92
95
|
|
93
96
|
if [[ -f "$full_patch_path" ]] ; then
|
94
97
|
|
95
|
-
__rvm_run "patch.apply.${patch_name/*\/}"
|
98
|
+
__rvm_run "patch.apply.${patch_name/*\/}" \
|
99
|
+
"patch -F$patch_fuzziness -p$patch_level -f <\"$full_patch_path\"" \
|
100
|
+
"Applying patch '$patch_name' (located at $full_patch_path)"
|
96
101
|
|
97
102
|
[[ $? -gt 0 ]] && result=1 # Detect failed patches
|
98
103
|
fi
|
@@ -108,14 +113,14 @@ __rvm_apply_patches() {
|
|
108
113
|
return ${result:-0}
|
109
114
|
}
|
110
115
|
|
111
|
-
__rvm_install_source()
|
112
|
-
|
116
|
+
__rvm_install_source()
|
117
|
+
{
|
113
118
|
local directory configure_parameters db_configure_flags
|
114
119
|
|
115
120
|
[[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] && __rvm_select
|
116
121
|
|
117
122
|
case ${rvm_ruby_string:-""} in
|
118
|
-
|
123
|
+
ruby-head|1.9.*-head) __rvm_ensure_has_18_compat_ruby || return 1 ;;
|
119
124
|
esac
|
120
125
|
|
121
126
|
"$rvm_path/scripts/log" "info" \
|
@@ -168,7 +173,8 @@ __rvm_install_source() {
|
|
168
173
|
return $result
|
169
174
|
fi
|
170
175
|
|
171
|
-
if [[ -z "${rvm_ruby_configure:-""}"
|
176
|
+
if [[ -z "${rvm_ruby_configure:-""}" \
|
177
|
+
&& ! -s "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/configure" ]] ; then
|
172
178
|
|
173
179
|
if command -v autoconf > /dev/null ; then
|
174
180
|
|
@@ -272,11 +278,12 @@ __rvm_install_source() {
|
|
272
278
|
return ${result:-0}
|
273
279
|
}
|
274
280
|
|
275
|
-
__rvm_install_ruby()
|
276
|
-
|
281
|
+
__rvm_install_ruby()
|
282
|
+
{
|
277
283
|
if [[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] ; then __rvm_select ; fi
|
278
284
|
|
279
285
|
if [[ -n "${RUBYOPT:-""}" ]] ; then ruby_options="$RUBYOPT" ; fi
|
286
|
+
|
280
287
|
unset RUBYOPT
|
281
288
|
|
282
289
|
# Check for clang if the flag is set
|
@@ -310,7 +317,8 @@ __rvm_install_ruby() {
|
|
310
317
|
|
311
318
|
if [[ "$result" -gt 0 ]] ; then
|
312
319
|
"$rvm_path/scripts/log" "error" \
|
313
|
-
"There has been an error while trying to install from source.
|
320
|
+
"There has been an error while trying to install from source. \
|
321
|
+
\nHalting the installation."
|
314
322
|
return $result
|
315
323
|
fi
|
316
324
|
|
@@ -325,13 +333,16 @@ __rvm_install_ruby() {
|
|
325
333
|
|
326
334
|
if [[ "$result" -gt 0 ]] ; then
|
327
335
|
"$rvm_path/scripts/log" "error" \
|
328
|
-
"There has been an error while trying to fetch the source.
|
336
|
+
"There has been an error while trying to fetch the source. \
|
337
|
+
\nHalting the installation."
|
329
338
|
return $result
|
330
339
|
fi
|
331
340
|
|
332
|
-
mv "${rvm_archives_path:-"$rvm_path/archives"}/macruby_nightly-latest.pkg"
|
341
|
+
mv "${rvm_archives_path:-"$rvm_path/archives"}/macruby_nightly-latest.pkg" \
|
342
|
+
"$rvm_archives_path/macruby_nightly.pkg"
|
333
343
|
|
334
|
-
__rvm_run "macruby/extract"
|
344
|
+
__rvm_run "macruby/extract" \
|
345
|
+
"sudo /usr/sbin/installer -pkg '${rvm_archives_path:-"$rvm_path/archives"}/macruby_nightly.pkg' -target '/'"
|
335
346
|
|
336
347
|
mkdir -p "$rvm_ruby_home/bin"
|
337
348
|
|
@@ -357,7 +368,8 @@ __rvm_install_ruby() {
|
|
357
368
|
|
358
369
|
mv "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/MacRuby ${rvm_ruby_version}.pkg" "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/$rvm_ruby_string.pkg"
|
359
370
|
|
360
|
-
__rvm_run "macruby/extract"
|
371
|
+
__rvm_run "macruby/extract" \
|
372
|
+
"sudo /usr/sbin/installer -pkg '${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/$rvm_ruby_string.pkg' -target '/'"
|
361
373
|
|
362
374
|
mkdir -p "$rvm_ruby_home/bin"
|
363
375
|
fi
|
@@ -390,7 +402,8 @@ RubyWrapper
|
|
390
402
|
fi
|
391
403
|
|
392
404
|
if [[ "$binary_name" = "ruby" ]] ; then
|
393
|
-
echo "$ruby_wrapper"
|
405
|
+
echo "$ruby_wrapper" \
|
406
|
+
> "${rvm_bin_path:-"$rvm_bin_path/bin"}/$rvm_ruby_string"
|
394
407
|
fi
|
395
408
|
done ; unset binaries
|
396
409
|
|
@@ -403,15 +416,19 @@ RubyWrapper
|
|
403
416
|
;;
|
404
417
|
|
405
418
|
ree)
|
406
|
-
if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.8/')"
|
419
|
+
if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.8/')" \
|
420
|
+
&& $rvm_head_flag -eq 0 ]] ; then
|
407
421
|
|
408
422
|
rvm_ruby_url="$(__rvm_db "ree_${rvm_ruby_version}_url")/$rvm_ruby_package_file.tar.gz"
|
409
423
|
|
410
|
-
"$rvm_path/scripts/log" "info"
|
424
|
+
"$rvm_path/scripts/log" "info" \
|
425
|
+
"Installing Ruby Enterprise Edition from source to: $rvm_ruby_home"
|
411
426
|
|
412
427
|
builtin cd "${rvm_src_path:-"$rvm_path/src"}"
|
413
428
|
|
414
|
-
if [[ ${rvm_force_flag:-0} -eq 0
|
429
|
+
if [[ ${rvm_force_flag:-0} -eq 0 \
|
430
|
+
&& -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" \
|
431
|
+
&& ! -x "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/installer" ]] ; then
|
415
432
|
|
416
433
|
"$rvm_path/scripts/log" \
|
417
434
|
"It appears that the archive has already been extracted. Skipping extract (use --force to force re-download and extract)."
|
@@ -426,13 +443,16 @@ RubyWrapper
|
|
426
443
|
|
427
444
|
if [[ "$result" -gt 0 ]] ; then
|
428
445
|
"$rvm_path/scripts/log" "error" \
|
429
|
-
"There has been an error while trying to fetch the source.
|
446
|
+
"There has been an error while trying to fetch the source. \
|
447
|
+
\nHalting the installation."
|
430
448
|
return $result
|
431
449
|
fi
|
432
450
|
|
433
451
|
rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
434
452
|
|
435
|
-
__rvm_run "extract"
|
453
|
+
__rvm_run "extract" \
|
454
|
+
"gunzip < \"${rvm_archives_path:-"$rvm_path/archives"}/$rvm_ruby_package_file.$rvm_archive_extension\" | tar xf - -C ${rvm_src_path:-"$rvm_path/src"}" \
|
455
|
+
"$rvm_ruby_string - #extracting $rvm_ruby_package_file to ${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
436
456
|
result=$?
|
437
457
|
|
438
458
|
if [[ "$result" -gt 0 ]] ; then
|
@@ -441,7 +461,8 @@ RubyWrapper
|
|
441
461
|
return $result
|
442
462
|
fi
|
443
463
|
|
444
|
-
mv "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_package_file"
|
464
|
+
mv "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_package_file" \
|
465
|
+
"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
445
466
|
fi
|
446
467
|
|
447
468
|
builtin cd "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
@@ -453,7 +474,8 @@ RubyWrapper
|
|
453
474
|
rvm_configure_flags="${rvm_configure_flags//--/-c --}"
|
454
475
|
fi
|
455
476
|
|
456
|
-
if [[ "Darwin" = "$(uname)" && "1.8.6" = "$rvm_ruby_version"
|
477
|
+
if [[ "Darwin" = "$(uname)" && "1.8.6" = "$rvm_ruby_version" \
|
478
|
+
&& -z "$rvm_ree_options" ]] ; then
|
457
479
|
rvm_ree_options="${rvm_ree_options} --no-tcmalloc"
|
458
480
|
fi
|
459
481
|
|
@@ -464,11 +486,14 @@ RubyWrapper
|
|
464
486
|
|
465
487
|
if [[ "$result" -gt 0 ]] ; then
|
466
488
|
"$rvm_path/scripts/log" "error" \
|
467
|
-
"There has been an error while trying to apply patches to ree.
|
489
|
+
"There has been an error while trying to apply patches to ree. \
|
490
|
+
\nHalting the installation."
|
468
491
|
return $result
|
469
492
|
fi
|
470
493
|
|
471
|
-
__rvm_run "install"
|
494
|
+
__rvm_run "install" \
|
495
|
+
"./installer -a $rvm_path/rubies/$rvm_ruby_string $rvm_ree_options $db_configure_flags $rvm_configure_flags" "$rvm_ruby_string - #installing "
|
496
|
+
|
472
497
|
result=$?
|
473
498
|
|
474
499
|
if [[ "$result" -gt 0 ]] ; then
|
@@ -488,7 +513,8 @@ RubyWrapper
|
|
488
513
|
__rvm_db "${rvm_ruby_interpreter}_${rvm_ruby_version}_repo_url" "rvm_ruby_url"
|
489
514
|
|
490
515
|
if [[ -z "$rvm_ruby_url" ]] ; then
|
491
|
-
"$rvm_path/scripts/log" "fail"
|
516
|
+
"$rvm_path/scripts/log" "fail" \
|
517
|
+
"rvm does not know the rvm repo url for '${rvm_ruby_interpreter}_${rvm_ruby_version}'"
|
492
518
|
result=1
|
493
519
|
|
494
520
|
else
|
@@ -517,9 +543,11 @@ RubyWrapper
|
|
517
543
|
|
518
544
|
builtin hash -r
|
519
545
|
|
520
|
-
if [[ -n "$(
|
546
|
+
if [[ -n "$(printf $rvm_ruby_version | awk '/^1\./')" \
|
547
|
+
&& ${rvm_head_flag:-0} -eq 0 ]] ; then
|
521
548
|
|
522
|
-
"$rvm_path/scripts/log" "info"
|
549
|
+
"$rvm_path/scripts/log" "info" \
|
550
|
+
"$rvm_ruby_string #downloading ($rvm_ruby_package_file), this may take a while depending on your connection..."
|
523
551
|
|
524
552
|
"$rvm_path/scripts/fetch" "$rvm_ruby_url"
|
525
553
|
result=$?
|
@@ -530,19 +558,22 @@ RubyWrapper
|
|
530
558
|
return $result
|
531
559
|
fi
|
532
560
|
__rvm_run "extract" \
|
533
|
-
"gunzip < \"${rvm_archives_path:-"$rvm_path/archives"}/$(basename $rvm_ruby_package_file)\" | tar xf - -C ${rvm_src_path:-"$rvm_path/src"}"
|
561
|
+
"gunzip < \"${rvm_archives_path:-"$rvm_path/archives"}/$(basename $rvm_ruby_package_file)\" | tar xf - -C ${rvm_src_path:-"$rvm_path/src"}" \
|
562
|
+
"$rvm_ruby_string - #extracting"
|
534
563
|
result=$?
|
535
564
|
|
536
565
|
if [[ "$result" -gt 0 ]] ; then
|
537
566
|
"$rvm_path/scripts/log" "error" \
|
538
|
-
"There has been an error while trying to extract the source.
|
567
|
+
"There has been an error while trying to extract the source. \
|
568
|
+
\nHalting the installation."
|
539
569
|
return $result
|
540
570
|
fi
|
541
571
|
|
542
572
|
# Remove the left over folder first.
|
543
573
|
rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
544
574
|
|
545
|
-
mv "${rvm_src_path:-"$rvm_path/src"}/rubinius-${rvm_ruby_version}"
|
575
|
+
mv "${rvm_src_path:-"$rvm_path/src"}/rubinius-${rvm_ruby_version}" \
|
576
|
+
"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
546
577
|
else
|
547
578
|
__rvm_db "rubinius_repo_url" "rvm_ruby_repo_url"
|
548
579
|
#rvm_ruby_home="$rvm_path/rubies/$rvm_ruby_interpreter-$rvm_ruby_version"
|
@@ -551,7 +582,8 @@ RubyWrapper
|
|
551
582
|
|
552
583
|
if [[ "$result" -gt 0 ]] ; then
|
553
584
|
"$rvm_path/scripts/log" "error" \
|
554
|
-
"There has been an error while fetching the rbx git repo.
|
585
|
+
"There has been an error while fetching the rbx git repo. \
|
586
|
+
\nHalting the installation."
|
555
587
|
return $result
|
556
588
|
fi
|
557
589
|
fi
|
@@ -565,7 +597,8 @@ RubyWrapper
|
|
565
597
|
|
566
598
|
if [[ "$result" -gt 0 ]] ; then
|
567
599
|
"$rvm_path/scripts/log" "error" \
|
568
|
-
"There has been an error while trying to apply patches to rubinius.
|
600
|
+
"There has been an error while trying to apply patches to rubinius. \
|
601
|
+
\nHalting the installation."
|
569
602
|
return $result
|
570
603
|
fi
|
571
604
|
|
@@ -575,7 +608,8 @@ RubyWrapper
|
|
575
608
|
|
576
609
|
rvm_configure_flags="${rvm_configure_flags:-"--skip-system"}"
|
577
610
|
|
578
|
-
rvm_ruby_configure="$rvm_path/wrappers/$ruby/ruby ./configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_configure_flags"
|
611
|
+
rvm_ruby_configure="$rvm_path/wrappers/$ruby/ruby ./configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_configure_flags"
|
612
|
+
message="$rvm_ruby_string - #configuring"
|
579
613
|
|
580
614
|
if [[ "$rvm_llvm_flag" = "0" ]] ; then
|
581
615
|
rvm_ruby_configure="$rvm_ruby_configure --disable-llvm"
|
@@ -591,14 +625,17 @@ RubyWrapper
|
|
591
625
|
|
592
626
|
if [[ "$result" -gt 0 ]] ; then
|
593
627
|
"$rvm_path/scripts/log" "error" \
|
594
|
-
"There has been an error while running '$rvm_ruby_configure'.
|
628
|
+
"There has been an error while running '$rvm_ruby_configure'. \
|
629
|
+
\nHalting the installation."
|
595
630
|
return $result
|
596
631
|
fi
|
597
632
|
|
598
633
|
if [[ "$rvm_trace_flag" -eq 1 ]] ; then
|
599
|
-
rvm_ruby_make="$rvm_path/wrappers/$ruby/rake install --trace"
|
634
|
+
rvm_ruby_make="$rvm_path/wrappers/$ruby/rake install --trace"
|
635
|
+
message="$rvm_ruby_string - #compiling (with --trace)"
|
600
636
|
else
|
601
|
-
rvm_ruby_make="$rvm_path/wrappers/$ruby/rake install"
|
637
|
+
rvm_ruby_make="$rvm_path/wrappers/$ruby/rake install"
|
638
|
+
message="$rvm_ruby_string - #compiling"
|
602
639
|
fi
|
603
640
|
|
604
641
|
__rvm_run "rake" "$rvm_ruby_make" "$message"
|
@@ -606,7 +643,8 @@ RubyWrapper
|
|
606
643
|
|
607
644
|
if [[ "$result" -gt 0 ]] ; then
|
608
645
|
"$rvm_path/scripts/log" "error" \
|
609
|
-
"There has been an error while running '$rvm_ruby_configure'.
|
646
|
+
"There has been an error while running '$rvm_ruby_configure'. \
|
647
|
+
\nHalting the installation."
|
610
648
|
return $result
|
611
649
|
fi ; unset ruby
|
612
650
|
|
@@ -649,7 +687,8 @@ RubyWrapper
|
|
649
687
|
jruby)
|
650
688
|
|
651
689
|
if ! command -v java > /dev/null; then
|
652
|
-
printf "java must be installed and in
|
690
|
+
printf "java must be installed and in PATH in order to install JRuby."
|
691
|
+
return 1
|
653
692
|
fi
|
654
693
|
|
655
694
|
builtin cd "${rvm_src_path:-"$rvm_path/src"}"
|
@@ -659,7 +698,8 @@ RubyWrapper
|
|
659
698
|
|
660
699
|
if [[ "$result" -gt 0 ]] ; then
|
661
700
|
"$rvm_path/scripts/log" "error" \
|
662
|
-
"There has been an error while trying to fetch the source.
|
701
|
+
"There has been an error while trying to fetch the source. \
|
702
|
+
\nHalting the installation."
|
663
703
|
return $result
|
664
704
|
fi
|
665
705
|
|
@@ -678,11 +718,13 @@ RubyWrapper
|
|
678
718
|
case "$rvm_ruby_version" in
|
679
719
|
1.3|1.2)
|
680
720
|
__rvm_run "nailgun" \
|
681
|
-
"builtin cd \"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/tool/nailgun\" && make $rvm_make_flags"
|
721
|
+
"builtin cd \"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/tool/nailgun\" && make $rvm_make_flags" \
|
722
|
+
"Building Nailgun"
|
682
723
|
;;
|
683
724
|
*)
|
684
725
|
__rvm_run "nailgun" \
|
685
|
-
"builtin cd \"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/tool/nailgun\" && ./configure --prefix=$rvm_ruby_home && make $rvm_make_flags"
|
726
|
+
"builtin cd \"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/tool/nailgun\" && ./configure --prefix=$rvm_ruby_home && make $rvm_make_flags" \
|
727
|
+
"Building Nailgun"
|
686
728
|
;;
|
687
729
|
esac
|
688
730
|
|
@@ -692,7 +734,8 @@ RubyWrapper
|
|
692
734
|
|
693
735
|
rm -rf "$rvm_ruby_home"
|
694
736
|
|
695
|
-
__rvm_run "install"
|
737
|
+
__rvm_run "install" \
|
738
|
+
"/bin/cp -Rf ${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string $rvm_ruby_home" "$rvm_ruby_string - #installing to $rvm_ruby_home"
|
696
739
|
|
697
740
|
(
|
698
741
|
builtin cd "$rvm_ruby_home/bin/"
|
@@ -707,6 +750,7 @@ RubyWrapper
|
|
707
750
|
chmod +x "$rvm_ruby_home/bin/jruby"
|
708
751
|
|
709
752
|
binaries=(jrubyc jirb_swing jirb jgem rdoc ri spec autospec testrb ast generate_yaml_index.rb)
|
753
|
+
|
710
754
|
for binary in "${binaries[@]}" ; do
|
711
755
|
__rvm_inject_gem_env "$rvm_ruby_home/bin/$binary"
|
712
756
|
done
|
@@ -749,16 +793,19 @@ RubyWrapper
|
|
749
793
|
|
750
794
|
builtin cd "${rvm_src_path:-"$rvm_path/src"}"
|
751
795
|
|
752
|
-
if [[ ! -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
796
|
+
if [[ ! -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" \
|
797
|
+
|| ${rvm_force_flag:-0} -eq 1 ]] ; then
|
753
798
|
|
754
|
-
rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/"
|
799
|
+
rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/" \
|
800
|
+
"${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/"
|
755
801
|
|
756
802
|
__rvm_fetch_ruby
|
757
803
|
result=$?
|
758
804
|
|
759
805
|
if [[ "$result" -gt 0 ]] ; then
|
760
806
|
"$rvm_path/scripts/log" "error" \
|
761
|
-
"There has been an error while trying to fetch the source.
|
807
|
+
"There has been an error while trying to fetch the source. \
|
808
|
+
\nHalting the installation."
|
762
809
|
return $result
|
763
810
|
fi
|
764
811
|
fi
|
@@ -772,14 +819,16 @@ RubyWrapper
|
|
772
819
|
rvm_gemstone_url="${rvm_gemstone_url:-"$maglev_url/${rvm_gemstone_package_file}.${rvm_archive_extension}"}"
|
773
820
|
fi
|
774
821
|
|
775
|
-
"$rvm_path/scripts/log" "info"
|
822
|
+
"$rvm_path/scripts/log" "info" \
|
823
|
+
"Downloading the GemStone package, this may take a while depending on your connection..."
|
776
824
|
|
777
825
|
"$rvm_path/scripts/fetch" "$rvm_gemstone_url"
|
778
826
|
result=$?
|
779
827
|
|
780
828
|
if [[ "$result" -gt 0 ]] ; then
|
781
829
|
"$rvm_path/scripts/log" "error" \
|
782
|
-
"There has been an error while trying to fetch the GemStone package.
|
830
|
+
"There has been an error while trying to fetch the GemStone package. \
|
831
|
+
\nHalting the installation."
|
783
832
|
return $result
|
784
833
|
fi
|
785
834
|
|
@@ -791,12 +840,14 @@ RubyWrapper
|
|
791
840
|
|
792
841
|
builtin cd "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
793
842
|
|
794
|
-
__rvm_run "gemstone.extract"
|
843
|
+
__rvm_run "gemstone.extract" \
|
844
|
+
"gunzip < \"${rvm_archives_path:-"$rvm_path/archives"}/${rvm_gemstone_package_file}.${rvm_archive_extension}\" | tar xf - -C ${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
795
845
|
result=$?
|
796
846
|
|
797
847
|
if [[ "$result" -gt 0 ]] ; then
|
798
848
|
"$rvm_path/scripts/log" "error" \
|
799
|
-
"There has been an error while trying to extract the GemStone package.
|
849
|
+
"There has been an error while trying to extract the GemStone package. \
|
850
|
+
\nHalting the installation."
|
800
851
|
return $result
|
801
852
|
fi
|
802
853
|
|
@@ -810,7 +861,9 @@ RubyWrapper
|
|
810
861
|
rm -rf $rvm_ruby_home
|
811
862
|
fi
|
812
863
|
|
813
|
-
__rvm_run "install"
|
864
|
+
__rvm_run "install" \
|
865
|
+
"/bin/cp -Rf ${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string $rvm_ruby_home" \
|
866
|
+
"Installing maglev to $rvm_ruby_home"
|
814
867
|
|
815
868
|
(
|
816
869
|
builtin cd "$rvm_ruby_home/bin/"
|
@@ -882,7 +935,8 @@ RubyWrapper
|
|
882
935
|
|
883
936
|
mono_minor_ver="$(echo "$mono_version" | cut -d '.' -f2)"
|
884
937
|
|
885
|
-
if [[ $mono_major_ver -lt 2 ]]
|
938
|
+
if [[ $mono_major_ver -lt 2 ]] \
|
939
|
+
|| ( [[ $mono_major_ver -eq 2 && $mono_minor_ver -lt 6 ]] ) ; then
|
886
940
|
printf "Mono 2.6 (or greater) must be installed and in your path in order to build IronRuby from the repository."
|
887
941
|
printf "Version detected: ${mono_version}"
|
888
942
|
return 1
|
@@ -911,7 +965,8 @@ RubyWrapper
|
|
911
965
|
if [[ $? -gt 0 ]] ; then result=$? ; return $result ; fi
|
912
966
|
|
913
967
|
rm -rf "$rvm_ruby_home"/*
|
914
|
-
mkdir -p "$rvm_ruby_home/bin" "$rvm_ruby_home/lib"
|
968
|
+
mkdir -p "$rvm_ruby_home/bin" "$rvm_ruby_home/lib" \
|
969
|
+
"$rvm_ruby_home/lib/ruby" "$rvm_ruby_home/lib/IronRuby"
|
915
970
|
|
916
971
|
cp -r "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/Merlin/Main/Bin/mono_release"/* "$rvm_ruby_home/bin/"
|
917
972
|
cp -r "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string/Merlin/Main/Languages/Ruby/Scripts/bin"/* "$rvm_ruby_home/bin/"
|
@@ -942,7 +997,8 @@ RubyWrapper
|
|
942
997
|
if [[ "$result" -gt 1 ]] ; then
|
943
998
|
|
944
999
|
"$rvm_path/scripts/log" "error" \
|
945
|
-
"There has been an error while trying to extract $rvm_ruby_package_file.
|
1000
|
+
"There has been an error while trying to extract $rvm_ruby_package_file. \
|
1001
|
+
\nHalting the installation."
|
946
1002
|
return $result
|
947
1003
|
|
948
1004
|
fi
|
@@ -968,7 +1024,8 @@ RubyWrapper
|
|
968
1024
|
fi
|
969
1025
|
done ; unset binaries
|
970
1026
|
|
971
|
-
sed -e '1,1s=.*=#!'"/usr/bin/env bash=" "$rvm_ruby_home/bin/ir"
|
1027
|
+
sed -e '1,1s=.*=#!'"/usr/bin/env bash=" "$rvm_ruby_home/bin/ir" \
|
1028
|
+
| \tr -d '\r' > "$rvm_ruby_home/bin/ir.new"
|
972
1029
|
|
973
1030
|
mv -f "$rvm_ruby_home/bin/ir.new" "$rvm_ruby_home/bin/ir"
|
974
1031
|
|
@@ -1003,7 +1060,8 @@ RubyWrapper
|
|
1003
1060
|
|
1004
1061
|
if [[ "$result" -gt 0 ]] ; then
|
1005
1062
|
"$rvm_path/scripts/log" "error" \
|
1006
|
-
"There has been an error while trying to apply patches to mput.
|
1063
|
+
"There has been an error while trying to apply patches to mput. \
|
1064
|
+
\nHalting the installation."
|
1007
1065
|
return $result
|
1008
1066
|
fi
|
1009
1067
|
|
@@ -1015,7 +1073,8 @@ RubyWrapper
|
|
1015
1073
|
|
1016
1074
|
else
|
1017
1075
|
"$rvm_path/scripts/log" "fail" \
|
1018
|
-
"rvm expects autoconf to install this ruby interpreter, autoconf was not found in PATH.
|
1076
|
+
"rvm expects autoconf to install this ruby interpreter, autoconf was not found in PATH. \
|
1077
|
+
\nHalting installation."
|
1019
1078
|
return $result
|
1020
1079
|
fi
|
1021
1080
|
fi
|
@@ -1034,7 +1093,8 @@ RubyWrapper
|
|
1034
1093
|
|
1035
1094
|
if [[ "$result" -gt 0 ]] ; then
|
1036
1095
|
"$rvm_path/scripts/log" "error" \
|
1037
|
-
"There has been an error while trying to configure the source.
|
1096
|
+
"There has been an error while trying to configure the source. \
|
1097
|
+
\nHalting the installation."
|
1038
1098
|
return $result
|
1039
1099
|
fi
|
1040
1100
|
|
@@ -1047,7 +1107,8 @@ RubyWrapper
|
|
1047
1107
|
|
1048
1108
|
if [[ "$result" -gt 0 ]] ; then
|
1049
1109
|
"$rvm_path/scripts/log" "error" \
|
1050
|
-
"There has been an error while trying to configure the source
|
1110
|
+
"There has been an error while trying to configure the source.\
|
1111
|
+
\nHalting the installation."
|
1051
1112
|
return $result
|
1052
1113
|
fi
|
1053
1114
|
|
@@ -1064,7 +1125,8 @@ RubyWrapper
|
|
1064
1125
|
|
1065
1126
|
if [[ "$result" -gt 0 ]] ; then
|
1066
1127
|
"$rvm_path/scripts/log" "error" \
|
1067
|
-
"There has been an error while trying to run make
|
1128
|
+
"There has been an error while trying to run make.\
|
1129
|
+
\nHalting the installation."
|
1068
1130
|
return $result
|
1069
1131
|
fi
|
1070
1132
|
|
@@ -1075,7 +1137,8 @@ RubyWrapper
|
|
1075
1137
|
|
1076
1138
|
if [[ "$result" -gt 0 ]] ; then
|
1077
1139
|
"$rvm_path/scripts/log" "error" \
|
1078
|
-
"There has been an error while trying to run make install.
|
1140
|
+
"There has been an error while trying to run make install. \
|
1141
|
+
\nHalting the installation."
|
1079
1142
|
return $result
|
1080
1143
|
fi
|
1081
1144
|
|
@@ -1126,7 +1189,8 @@ RubyWrapper
|
|
1126
1189
|
return ${result:-0}
|
1127
1190
|
}
|
1128
1191
|
|
1129
|
-
__rvm_fetch_from_github()
|
1192
|
+
__rvm_fetch_from_github()
|
1193
|
+
{
|
1130
1194
|
rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
1131
1195
|
|
1132
1196
|
if [[ ! -d "${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string/.git" ]] ; then
|
@@ -1135,7 +1199,9 @@ __rvm_fetch_from_github() {
|
|
1135
1199
|
|
1136
1200
|
builtin cd "$rvm_home"
|
1137
1201
|
|
1138
|
-
__rvm_run "$1.repo"
|
1202
|
+
__rvm_run "$1.repo" \
|
1203
|
+
"git clone --depth 1 $rvm_ruby_repo_url ${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string" \
|
1204
|
+
"Cloning $rvm_ruby_repo_url"
|
1139
1205
|
result=$?
|
1140
1206
|
|
1141
1207
|
if [[ "$result" -gt 0 ]] ; then
|
@@ -1160,8 +1226,8 @@ __rvm_fetch_from_github() {
|
|
1160
1226
|
return ${result:-0}
|
1161
1227
|
}
|
1162
1228
|
|
1163
|
-
__rvm_fetch_ruby()
|
1164
|
-
|
1229
|
+
__rvm_fetch_ruby()
|
1230
|
+
{
|
1165
1231
|
[[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] && __rvm_select
|
1166
1232
|
|
1167
1233
|
"$rvm_path/scripts/log" "info" "$rvm_ruby_string - #fetching "
|
@@ -1206,15 +1272,18 @@ __rvm_fetch_ruby() {
|
|
1206
1272
|
|
1207
1273
|
if [[ "$result" -gt 0 ]] ; then
|
1208
1274
|
"$rvm_path/scripts/log" "error" \
|
1209
|
-
"There has been an error while trying to fetch the source.
|
1275
|
+
"There has been an error while trying to fetch the source. \
|
1276
|
+
\nHalting the installation."
|
1210
1277
|
return $result
|
1211
1278
|
fi
|
1212
1279
|
fi
|
1213
1280
|
|
1214
|
-
if [[ ! -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
1281
|
+
if [[ ! -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" \
|
1282
|
+
|| ${rvm_force_flag:-0} -eq 1 ]] ; then
|
1215
1283
|
|
1216
1284
|
if [[ -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" ]] ; then
|
1217
|
-
|
1285
|
+
# Especially when forced, we want to ensure the destination is missing.
|
1286
|
+
rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
|
1218
1287
|
fi
|
1219
1288
|
|
1220
1289
|
mkdir -p "/tmp/rvm_src_$$"
|
@@ -1226,7 +1295,8 @@ __rvm_fetch_ruby() {
|
|
1226
1295
|
|
1227
1296
|
if [[ "$result" -gt 0 ]] ; then
|
1228
1297
|
"$rvm_path/scripts/log" "error" \
|
1229
|
-
"There has been an error while trying to extract the source.
|
1298
|
+
"There has been an error while trying to extract the source. \
|
1299
|
+
\nHalting the installation."
|
1230
1300
|
return $result
|
1231
1301
|
fi
|
1232
1302
|
;;
|
@@ -1236,7 +1306,8 @@ __rvm_fetch_ruby() {
|
|
1236
1306
|
|
1237
1307
|
if [[ "$result" -gt 0 ]] ; then
|
1238
1308
|
"$rvm_path/scripts/log" "error" \
|
1239
|
-
"There has been an error while trying to extract $rvm_ruby_package_file.
|
1309
|
+
"There has been an error while trying to extract $rvm_ruby_package_file. \
|
1310
|
+
\nHalting the installation."
|
1240
1311
|
return $result
|
1241
1312
|
fi
|
1242
1313
|
;;
|
@@ -1246,13 +1317,15 @@ __rvm_fetch_ruby() {
|
|
1246
1317
|
|
1247
1318
|
if [[ "$result" -gt 0 ]] ; then
|
1248
1319
|
"$rvm_path/scripts/log" "error" \
|
1249
|
-
"There has been an error while trying to extract the source.
|
1320
|
+
"There has been an error while trying to extract the source. \
|
1321
|
+
\nHalting the installation."
|
1250
1322
|
return $result
|
1251
1323
|
fi
|
1252
1324
|
;;
|
1253
1325
|
*)
|
1254
1326
|
"$rvm_path/scripts/log" "error" \
|
1255
|
-
"Unknown archive format extension '$rvm_archive_extension'.
|
1327
|
+
"Unknown archive format extension '$rvm_archive_extension'. \
|
1328
|
+
\nHalting the installation."
|
1256
1329
|
return 1
|
1257
1330
|
;;
|
1258
1331
|
esac
|
@@ -1293,7 +1366,8 @@ __rvm_fetch_ruby() {
|
|
1293
1366
|
|
1294
1367
|
if [[ "$result" -gt 0 ]] ; then
|
1295
1368
|
"$rvm_path/scripts/log" "error" \
|
1296
|
-
"There has been an error while trying to update the source from the remote repository.
|
1369
|
+
"There has been an error while trying to update the source from the remote repository. \
|
1370
|
+
\nHalting the installation."
|
1297
1371
|
return $result
|
1298
1372
|
fi
|
1299
1373
|
|
@@ -1307,7 +1381,8 @@ __rvm_fetch_ruby() {
|
|
1307
1381
|
|
1308
1382
|
if [[ "$result" -gt 0 ]] ; then
|
1309
1383
|
"$rvm_path/scripts/log" "error" \
|
1310
|
-
"There has been an error while trying to checkout the source branch.
|
1384
|
+
"There has been an error while trying to checkout the source branch. \
|
1385
|
+
\nHalting the installation."
|
1311
1386
|
return $result
|
1312
1387
|
fi
|
1313
1388
|
fi
|
@@ -1320,19 +1395,22 @@ __rvm_fetch_ruby() {
|
|
1320
1395
|
"$rvm_path/scripts/log" "info" \
|
1321
1396
|
"Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
|
1322
1397
|
|
1323
|
-
git clone --depth 1 "$rvm_ruby_repo_url"
|
1398
|
+
git clone --depth 1 "$rvm_ruby_repo_url" \
|
1399
|
+
"${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string"
|
1324
1400
|
result=$?
|
1325
1401
|
|
1326
1402
|
if [[ "$result" -gt 0 ]] ; then
|
1327
1403
|
"$rvm_path/scripts/log" "info" \
|
1328
1404
|
"cloning from $rvm_ruby_repo_url failed, now attempting to clone from $rvm_ruby_repo_http_url, this may take a while depending on your connection..."
|
1329
1405
|
|
1330
|
-
git clone "$rvm_ruby_repo_http_url"
|
1406
|
+
git clone "$rvm_ruby_repo_http_url" \
|
1407
|
+
"${rvm_repos_path:-"$rvm_path/repos"}/$rvm_ruby_string"
|
1331
1408
|
result=$?
|
1332
1409
|
|
1333
1410
|
if [[ "$result" -gt 0 ]] ; then
|
1334
1411
|
"$rvm_path/scripts/log" "error" \
|
1335
|
-
"There has been an error while trying to fetch the repository.
|
1412
|
+
"There has been an error while trying to fetch the repository. \
|
1413
|
+
\nHalting the installation."
|
1336
1414
|
return $result
|
1337
1415
|
fi
|
1338
1416
|
fi
|
@@ -1394,7 +1472,8 @@ __rvm_fetch_ruby() {
|
|
1394
1472
|
|
1395
1473
|
if [[ "$result" -gt 0 ]] ; then
|
1396
1474
|
"$rvm_path/scripts/log" "error" \
|
1397
|
-
"There has been an error while trying to fetch / update the source.
|
1475
|
+
"There has been an error while trying to fetch / update the source. \
|
1476
|
+
\nHalting the installation."
|
1398
1477
|
return $result
|
1399
1478
|
fi
|
1400
1479
|
fi
|
@@ -1409,8 +1488,8 @@ __rvm_fetch_ruby() {
|
|
1409
1488
|
return ${result:-0}
|
1410
1489
|
}
|
1411
1490
|
|
1412
|
-
__rvm_check_default()
|
1413
|
-
|
1491
|
+
__rvm_check_default()
|
1492
|
+
{
|
1414
1493
|
local default_ruby_interpreter current_ruby_interpreter
|
1415
1494
|
|
1416
1495
|
default_ruby_interpreter="$(rvm alias show default 2>/dev/null | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}')"
|
@@ -1426,8 +1505,8 @@ __rvm_check_default() {
|
|
1426
1505
|
return $?
|
1427
1506
|
}
|
1428
1507
|
|
1429
|
-
__rvm_uninstall_ruby()
|
1430
|
-
|
1508
|
+
__rvm_uninstall_ruby()
|
1509
|
+
{
|
1431
1510
|
local dir
|
1432
1511
|
|
1433
1512
|
if [[ ${rvm_ruby_selected_flag} -eq 0 ]] ; then __rvm_select ; fi
|
@@ -1475,8 +1554,8 @@ __rvm_uninstall_ruby() {
|
|
1475
1554
|
return 0
|
1476
1555
|
}
|
1477
1556
|
|
1478
|
-
__rvm_remove_ruby()
|
1479
|
-
|
1557
|
+
__rvm_remove_ruby()
|
1558
|
+
{
|
1480
1559
|
local dir
|
1481
1560
|
|
1482
1561
|
if [[ ${rvm_ruby_selected_flag:-0} -eq 0 ]] ; then __rvm_select ; fi
|
@@ -1529,21 +1608,31 @@ __rvm_remove_ruby() {
|
|
1529
1608
|
return 0
|
1530
1609
|
}
|
1531
1610
|
|
1532
|
-
__rvm_remove_gemsets()
|
1611
|
+
__rvm_remove_gemsets()
|
1612
|
+
{
|
1613
|
+
local gemset gemsets
|
1614
|
+
|
1533
1615
|
if [[ ${rvm_gems_flag:-0} -eq 1 ]] ; then
|
1616
|
+
|
1534
1617
|
"$rvm_path/scripts/log" "info" "Removing $rvm_ruby_string gemsets..."
|
1535
1618
|
|
1536
1619
|
gemsets=($(builtin cd "${rvm_gems_path:-"$rvm_path/gems"}"/ ; find . -maxdepth 1 -mindepth 1 -type d))
|
1537
1620
|
|
1538
1621
|
for gemset in "${gemsets[@]//.\/}" ; do
|
1622
|
+
|
1539
1623
|
if [[ -d "$gemset" ]] ; then
|
1624
|
+
|
1540
1625
|
rm -rf "$gemset"
|
1626
|
+
|
1541
1627
|
fi
|
1542
|
-
|
1628
|
+
|
1629
|
+
done
|
1630
|
+
|
1543
1631
|
fi
|
1544
1632
|
}
|
1545
1633
|
|
1546
|
-
__rvm_remove_wrappers()
|
1634
|
+
__rvm_remove_wrappers()
|
1635
|
+
{
|
1547
1636
|
"$rvm_path/scripts/log" "info" "Removing $rvm_ruby_string wrappers..."
|
1548
1637
|
|
1549
1638
|
local wrapper wrappers
|
@@ -1551,13 +1640,16 @@ __rvm_remove_wrappers() {
|
|
1551
1640
|
wrappers=($(find "$rvm_path/wrappers" -maxdepth 1 -mindepth 1 -type d -iname "*$rvm_ruby_string*" 2>/dev/null))
|
1552
1641
|
|
1553
1642
|
for wrapper in "${wrappers[@]}" ; do
|
1643
|
+
|
1554
1644
|
rm -rf "$wrapper"
|
1645
|
+
|
1555
1646
|
done
|
1556
1647
|
|
1557
1648
|
return 0
|
1558
1649
|
}
|
1559
1650
|
|
1560
|
-
__rvm_remove_environments()
|
1651
|
+
__rvm_remove_environments()
|
1652
|
+
{
|
1561
1653
|
"$rvm_path/scripts/log" "info" "Removing $rvm_ruby_string environments..."
|
1562
1654
|
|
1563
1655
|
local environments environment
|
@@ -1573,7 +1665,8 @@ __rvm_remove_environments() {
|
|
1573
1665
|
return 0
|
1574
1666
|
}
|
1575
1667
|
|
1576
|
-
__rvm_remove_aliases()
|
1668
|
+
__rvm_remove_aliases()
|
1669
|
+
{
|
1577
1670
|
"$rvm_path/scripts/log" "info" "Removing $rvm_ruby_string aliases..."
|
1578
1671
|
|
1579
1672
|
local alias_name aliases
|
@@ -1586,7 +1679,8 @@ __rvm_remove_aliases() {
|
|
1586
1679
|
done
|
1587
1680
|
}
|
1588
1681
|
|
1589
|
-
__rvm_remove_archives()
|
1682
|
+
__rvm_remove_archives()
|
1683
|
+
{
|
1590
1684
|
if [[ ${rvm_archive_flag:-0} -eq 1 ]] ; then
|
1591
1685
|
|
1592
1686
|
"$rvm_path/scripts/log" "info" "Removing $rvm_ruby_string archives..."
|
@@ -1595,7 +1689,8 @@ __rvm_remove_archives() {
|
|
1595
1689
|
fi
|
1596
1690
|
}
|
1597
1691
|
|
1598
|
-
__rvm_remove_binaries()
|
1692
|
+
__rvm_remove_binaries()
|
1693
|
+
{
|
1599
1694
|
"$rvm_path/scripts/log" "info" "Removing $rvm_ruby_string binaries..."
|
1600
1695
|
|
1601
1696
|
# Iterate over all binaries and check for symlinked wrappers etc.
|
@@ -1607,7 +1702,8 @@ __rvm_remove_binaries() {
|
|
1607
1702
|
|
1608
1703
|
full_binary_path="${rvm_bin_path:-"$rvm_path/bin"}/$binary_name"
|
1609
1704
|
|
1610
|
-
if [[ -L "$full_binary_path" ]]
|
1705
|
+
if [[ -L "$full_binary_path" ]] \
|
1706
|
+
&& "$rvm_path/scripts/match" "$(readlink "$full_binary_path")" "$rvm_ruby_string"; then
|
1611
1707
|
rm -f "$full_binary_path"
|
1612
1708
|
fi
|
1613
1709
|
done ; unset binaries
|
@@ -1615,8 +1711,8 @@ __rvm_remove_binaries() {
|
|
1615
1711
|
return 0
|
1616
1712
|
}
|
1617
1713
|
|
1618
|
-
__rvm_post_install()
|
1619
|
-
|
1714
|
+
__rvm_post_install()
|
1715
|
+
{
|
1620
1716
|
local rvm_ruby_aliases ruby_alias binary
|
1621
1717
|
|
1622
1718
|
if [[ "$rvm_ruby_interpreter" != "jruby" ]] ; then
|
@@ -1676,8 +1772,8 @@ __rvm_post_install() {
|
|
1676
1772
|
fi
|
1677
1773
|
}
|
1678
1774
|
|
1679
|
-
__rvm_generate_default_docs()
|
1680
|
-
|
1775
|
+
__rvm_generate_default_docs()
|
1776
|
+
{
|
1681
1777
|
if [[ "$rvm_docs_flag" = "1" && "$rvm_ruby_interpreter" != "macruby" ]]; then
|
1682
1778
|
|
1683
1779
|
__rvm_run_with_env "docs.generate" "$rvm_ruby_string" \
|
@@ -1685,11 +1781,12 @@ __rvm_generate_default_docs() {
|
|
1685
1781
|
fi
|
1686
1782
|
}
|
1687
1783
|
|
1688
|
-
__rvm_rubygems_setup()
|
1689
|
-
|
1784
|
+
__rvm_rubygems_setup()
|
1785
|
+
{
|
1690
1786
|
local home path dir directory_name version_number ruby_lib_gem_path
|
1691
1787
|
|
1692
|
-
if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.9/')"
|
1788
|
+
if [[ -n "$(echo "$rvm_ruby_version" | awk '/^1\.9/')" \
|
1789
|
+
|| -n "$(echo "$rvm_ruby_interpreter" | awk '/^mput/')" ]] ; then
|
1693
1790
|
install=0
|
1694
1791
|
|
1695
1792
|
elif [[ "$rvm_ruby_string" = "ruby-head" ]] ; then
|
@@ -1734,7 +1831,9 @@ __rvm_rubygems_setup() {
|
|
1734
1831
|
if [[ "$version_number" == "." ]]; then
|
1735
1832
|
|
1736
1833
|
# TODO: Investigate this if statement, something feels not quite right.
|
1737
|
-
version_number="$(builtin cd "$directory_name" ;
|
1834
|
+
version_number="$(builtin cd "$directory_name" ; \
|
1835
|
+
find . -maxdepth 1 -mindepth 1 -type f \
|
1836
|
+
| \grep '^[[:digit:]].[[:digit:]]\(.[[:digit:]]\)\?' | head -n1)"
|
1738
1837
|
version_number="${version_number//.\/}"
|
1739
1838
|
|
1740
1839
|
if [[ -n "$version_number" ]]; then
|
@@ -1791,7 +1890,8 @@ __rvm_rubygems_setup() {
|
|
1791
1890
|
fi
|
1792
1891
|
|
1793
1892
|
__rvm_run "rubygems.extract" \
|
1794
|
-
"gunzip < \"${rvm_archives_path:-"$rvm_path/archives"}/$rvm_gem_package_name.tgz\" | tar xf - -C ${rvm_src_path:-"$rvm_path/src"}"
|
1893
|
+
"gunzip < \"${rvm_archives_path:-"$rvm_path/archives"}/$rvm_gem_package_name.tgz\" | tar xf - -C ${rvm_src_path:-"$rvm_path/src"}" \
|
1894
|
+
"Extracting $rvm_gem_package_name ..."
|
1795
1895
|
fi
|
1796
1896
|
|
1797
1897
|
builtin cd "${rvm_src_path:-"$rvm_path/src"}/$rvm_gem_package_name"
|
@@ -1838,8 +1938,8 @@ __rvm_rubygems_setup() {
|
|
1838
1938
|
return ${result:-0}
|
1839
1939
|
}
|
1840
1940
|
|
1841
|
-
__rvm_inject_ruby_shebang()
|
1842
|
-
|
1941
|
+
__rvm_inject_ruby_shebang()
|
1942
|
+
{
|
1843
1943
|
local actual_file
|
1844
1944
|
|
1845
1945
|
__rvm_actual_file $1
|
@@ -1851,8 +1951,8 @@ __rvm_inject_ruby_shebang() {
|
|
1851
1951
|
fi
|
1852
1952
|
}
|
1853
1953
|
|
1854
|
-
__rvm_inject_gem_env()
|
1855
|
-
|
1954
|
+
__rvm_inject_gem_env()
|
1955
|
+
{
|
1856
1956
|
local actual_file string
|
1857
1957
|
|
1858
1958
|
__rvm_actual_file $1
|
@@ -1871,7 +1971,8 @@ __rvm_inject_gem_env() {
|
|
1871
1971
|
|
1872
1972
|
if [[ -n "$string" ]] ; then
|
1873
1973
|
|
1874
|
-
awk "NR==2 {print \"$string\"} {print}" "$actual_file"
|
1974
|
+
awk "NR==2 {print \"$string\"} {print}" "$actual_file" \
|
1975
|
+
> "$actual_file.new"
|
1875
1976
|
|
1876
1977
|
mv $actual_file.new $actual_file ; chmod +x "$actual_file"
|
1877
1978
|
|
@@ -1881,8 +1982,8 @@ __rvm_inject_gem_env() {
|
|
1881
1982
|
return 0
|
1882
1983
|
}
|
1883
1984
|
|
1884
|
-
__rvm_actual_file()
|
1885
|
-
|
1985
|
+
__rvm_actual_file()
|
1986
|
+
{
|
1886
1987
|
if [[ -L "$1" ]] ; then # If the file is a symlink,
|
1887
1988
|
|
1888
1989
|
actual_file="$(readlink $1)" # read the link target so we can preserve it.
|
@@ -1896,8 +1997,8 @@ __rvm_actual_file() {
|
|
1896
1997
|
return 0
|
1897
1998
|
}
|
1898
1999
|
|
1899
|
-
__rvm_manage_rubies()
|
1900
|
-
|
2000
|
+
__rvm_manage_rubies()
|
2001
|
+
{
|
1901
2002
|
local manage_result bin_line
|
1902
2003
|
|
1903
2004
|
manage_result=0
|
@@ -1932,7 +2033,8 @@ __rvm_manage_rubies() {
|
|
1932
2033
|
|
1933
2034
|
else # all
|
1934
2035
|
|
1935
|
-
if [[ "$action" != "install" && "$action" != "remove"
|
2036
|
+
if [[ "$action" != "install" && "$action" != "remove" \
|
2037
|
+
&& "$action" != "uninstall" ]] ; then
|
1936
2038
|
|
1937
2039
|
local ruby_string
|
1938
2040
|
|
@@ -1956,7 +2058,8 @@ __rvm_manage_rubies() {
|
|
1956
2058
|
|
1957
2059
|
__rvm_unset_ruby_variables
|
1958
2060
|
fi
|
1959
|
-
done < <(builtin cd "$rvm_path/rubies" ;
|
2061
|
+
done < <(builtin cd "$rvm_path/rubies" ; \
|
2062
|
+
find . -maxdepth 1 -mindepth 1 -type d 2> /dev/null | sed -e 's#./##g')
|
1960
2063
|
|
1961
2064
|
else
|
1962
2065
|
"$rvm_path/scripts/log" "warn" \
|