rvm 0.1.41 → 0.1.42
Sign up to get free protection for your applications and to get access to all the features.
- data/binscripts/rvm +1 -1
- data/binscripts/rvm-shell +32 -0
- data/binscripts/rvmsudo +1 -6
- data/config/db +2 -2
- data/config/known +2 -2
- data/config/md5 +6 -5
- data/contrib/install-system-wide +81 -0
- data/install +23 -24
- data/lib/VERSION.yml +1 -1
- data/lib/rvm.rb +156 -1
- data/lib/rvm/capistrano.rb +45 -0
- data/lib/rvm/environment.rb +62 -0
- data/lib/rvm/environment/alias.rb +69 -0
- data/lib/rvm/environment/cleanup.rb +54 -0
- data/lib/rvm/environment/configuration.rb +60 -0
- data/lib/rvm/environment/env.rb +52 -0
- data/lib/rvm/environment/gemset.rb +222 -0
- data/lib/rvm/environment/info.rb +13 -0
- data/lib/rvm/environment/list.rb +124 -0
- data/lib/rvm/environment/rubies.rb +50 -0
- data/lib/rvm/environment/sets.rb +123 -0
- data/lib/rvm/environment/tools.rb +41 -0
- data/lib/rvm/environment/utility.rb +167 -0
- data/lib/rvm/environment/wrapper.rb +23 -0
- data/lib/rvm/errors.rb +28 -0
- data/lib/rvm/shell.rb +21 -10
- data/lib/rvm/shell/abstract_wrapper.rb +145 -0
- data/lib/rvm/shell/result.rb +42 -0
- data/lib/rvm/shell/shell_wrapper.sh +10 -0
- data/lib/rvm/shell/single_shot_wrapper.rb +56 -0
- data/lib/rvm/shell/utility.rb +37 -0
- data/lib/rvm/version.rb +12 -8
- data/rvm.gemspec +27 -4
- data/scripts/cd +17 -32
- data/scripts/cli +46 -16
- data/scripts/completion +1 -1
- data/scripts/disk-usage +52 -0
- data/scripts/fetch +8 -2
- data/scripts/gemsets +15 -4
- data/scripts/initialize +3 -3
- data/scripts/install +23 -24
- data/scripts/list +16 -8
- data/scripts/log +4 -1
- data/scripts/man +0 -0
- data/scripts/manage +51 -34
- data/scripts/md5 +4 -5
- data/scripts/package +28 -6
- data/scripts/rubygems +2 -2
- data/scripts/rvm +2 -2
- data/scripts/rvm-install +23 -24
- data/scripts/selector +2 -2
- data/scripts/tools +34 -0
- data/scripts/update +23 -24
- data/scripts/utility +54 -12
- data/scripts/wrapper +21 -18
- metadata +29 -6
- data/lib/rvm/open4.rb +0 -395
- data/lib/rvm/rvm.rb +0 -14
data/scripts/list
CHANGED
@@ -2,12 +2,16 @@
|
|
2
2
|
|
3
3
|
if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
|
4
4
|
|
5
|
+
source "$rvm_scripts_path/utility"
|
6
|
+
|
5
7
|
list_gemsets() {
|
6
|
-
echo
|
7
|
-
|
8
|
-
|
9
|
-
current_ruby="$(echo $ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)"
|
8
|
+
if [[ "$(echo $rvm_ruby_args | awk '{print $2}')" = "strings" ]]; then
|
9
|
+
list_gemset_strings
|
10
|
+
return 0
|
10
11
|
fi
|
12
|
+
echo
|
13
|
+
|
14
|
+
current_ruby="$(__rvm_environment_identifier)"
|
11
15
|
|
12
16
|
printf "rvm gemsets\n"
|
13
17
|
for version in $(\ls $rvm_gems_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
|
@@ -74,6 +78,11 @@ list_strings() {
|
|
74
78
|
echo $(\ls $rvm_rubies_path)
|
75
79
|
}
|
76
80
|
|
81
|
+
# This is meant to be used with scripting.
|
82
|
+
list_gemset_strings() {
|
83
|
+
\ls $rvm_gems_path/ 2>/dev/null | xargs -- basename | grep -v '^\(@\|doc$\|cache$\|system$\)' | sort
|
84
|
+
}
|
85
|
+
|
77
86
|
# This is meant to be used with scripting.
|
78
87
|
list_known_strings() {
|
79
88
|
cat "$rvm_config_path/known" | sed -e 's/#.*$//g' -e 's/(//g' -e 's/)//g' | sort -r | uniq
|
@@ -90,10 +99,8 @@ list_known() {
|
|
90
99
|
|
91
100
|
list_rubies() {
|
92
101
|
echo
|
93
|
-
|
94
|
-
|
95
|
-
current_ruby="$(echo $ruby | xargs dirname | xargs dirname | xargs basename 2> /dev/null)"
|
96
|
-
fi
|
102
|
+
|
103
|
+
current_ruby="$(__rvm_environment_identifier | awk -F"$rvm_gemset_separator" '{print $1}')"
|
97
104
|
|
98
105
|
printf "rvm rubies\n"
|
99
106
|
for version in $(\ls $rvm_rubies_path/ 2> /dev/null | awk '/[a-z]*-.*/ {print $NF}') ; do
|
@@ -148,6 +155,7 @@ elif [[ "ruby_svn_tags" = "$action" ]] ; then
|
|
148
155
|
list_ruby_svn_tags
|
149
156
|
else # help
|
150
157
|
printf "\nUsage: rvm list {known,gemsets,default,rubies,strings,known_strings}"
|
158
|
+
false
|
151
159
|
fi
|
152
160
|
|
153
161
|
exit $?
|
data/scripts/log
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
+
# When rvm_silence_logging is set, don't show anything.
|
4
|
+
[[ -n "$rvm_silence_logging" ]] && exit 0
|
5
|
+
|
3
6
|
if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
|
4
7
|
|
5
8
|
if [[ ! -z "$2" ]] ; then level=$1 ; shift ; else level="info" ; fi
|
6
9
|
|
7
|
-
message
|
10
|
+
message="$(echo "$1" | sed 's/%/%%/g')"
|
8
11
|
|
9
12
|
if [[ -z "$rvm_interactive" ]] || [[ -z "$TERM" ]] || [[ "unknown" = "$TERM" ]] ; then
|
10
13
|
case "$level" in
|
data/scripts/man
ADDED
File without changes
|
data/scripts/manage
CHANGED
@@ -6,6 +6,13 @@ original_ruby_string=$rvm_ruby_string
|
|
6
6
|
source "$rvm_scripts_path/base"
|
7
7
|
source "$rvm_scripts_path/patches"
|
8
8
|
|
9
|
+
__rvm_check_for_clang() {
|
10
|
+
if [[ -n "$rvm_clang_flag" ]] && ! command -v clang >/dev/null ; then
|
11
|
+
$rvm_scripts_path/log "fail" "You passed the --clang option and clang isn't in your path. Please try again / don't use --clang"
|
12
|
+
return 1
|
13
|
+
fi
|
14
|
+
}
|
15
|
+
|
9
16
|
# Checks for bison, returns zero iff it is found
|
10
17
|
__rvm_check_for_bison() {
|
11
18
|
if [[ "$rvm_head_flag" -gt 0 ]]; then
|
@@ -60,7 +67,7 @@ __rvm_install_source() {
|
|
60
67
|
|
61
68
|
$rvm_scripts_path/log "info" "Installing Ruby from source to: $rvm_ruby_home"
|
62
69
|
__rvm_pushpop "$rvm_src_path"
|
63
|
-
if [[
|
70
|
+
if [[ -n "$rvm_force_flag" ]] ; then rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi
|
64
71
|
|
65
72
|
result=0
|
66
73
|
__rvm_fetch_ruby
|
@@ -91,7 +98,7 @@ __rvm_install_source() {
|
|
91
98
|
fi
|
92
99
|
fi
|
93
100
|
|
94
|
-
if [[
|
101
|
+
if [[ -n "$rvm_ruby_configure" ]] ; then
|
95
102
|
__rvm_run "configure" "$rvm_ruby_configure"
|
96
103
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
97
104
|
$rvm_scripts_path/log "error" "There has been an error while configuring. Aborting the installation." ; __rvm_pushpop ; return $result
|
@@ -101,7 +108,9 @@ __rvm_install_source() {
|
|
101
108
|
if [[ "ree" != "$rvm_ruby_interpreter" ]]; then
|
102
109
|
__rvm_db "${rvm_ruby_interpreter}_configure_flags" "db_configure_flags"
|
103
110
|
fi
|
104
|
-
|
111
|
+
|
112
|
+
local configure_command="./configure --prefix=$rvm_ruby_home $db_configure_flags $rvm_ruby_configure_flags $configure_parameters"
|
113
|
+
__rvm_run "configure" "$configure_command" "Configuring $rvm_ruby_string, this may take a while depending on your cpu(s)..."
|
105
114
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
106
115
|
$rvm_scripts_path/log "error" "There has been an error while running configure. Aborting the installation." ; __rvm_pushpop ; return $result
|
107
116
|
fi ; unset configure_parameters db_configure_flags
|
@@ -140,13 +149,18 @@ __rvm_install_ruby() {
|
|
140
149
|
|
141
150
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
142
151
|
|
143
|
-
if [[
|
152
|
+
if [[ -n "$RUBYOPT" ]] ; then ruby_options="$RUBYOPT" ; unset RUBYOPT ; fi
|
153
|
+
|
154
|
+
# Check for clang if the flag is set
|
155
|
+
__rvm_check_for_clang
|
156
|
+
local result="$?"
|
157
|
+
[[ "$result" -gt 0 ]] && return $result
|
144
158
|
|
145
159
|
case "$rvm_ruby_interpreter" in
|
146
160
|
macruby)
|
147
161
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
148
162
|
if [[ "$rvm_head_flag" = 1 ]] ; then
|
149
|
-
if [[
|
163
|
+
if [[ -n "$rvm_llvm_flag" ]] ; then
|
150
164
|
$rvm_scripts_path/package llvm install
|
151
165
|
fi
|
152
166
|
macruby_path="/usr/local/bin"
|
@@ -217,7 +231,7 @@ RubyWrapper
|
|
217
231
|
;;
|
218
232
|
|
219
233
|
ree)
|
220
|
-
if [[
|
234
|
+
if [[ -n "$(echo $rvm_ruby_version | awk '/^1\.8/')" ]] && [[ -z "$rvm_head_flag" ]] ; then
|
221
235
|
rvm_url="$(__rvm_db "ree_${rvm_ruby_version}_url")/$rvm_ruby_package_file.tar.gz"
|
222
236
|
$rvm_scripts_path/log "info" "Installing Ruby Enterprise Edition from source to: $rvm_ruby_home"
|
223
237
|
__rvm_pushpop "$rvm_src_path"
|
@@ -242,7 +256,7 @@ RubyWrapper
|
|
242
256
|
builtin cd "$rvm_ruby_src_path"
|
243
257
|
|
244
258
|
mkdir -p "${rvm_ruby_home}/lib/ruby/gems/1.8/gems"
|
245
|
-
if [[
|
259
|
+
if [[ -n "$rvm_ruby_configure_flags" ]] ; then
|
246
260
|
rvm_ruby_configure_flags="$(echo $rvm_ruby_configure_flags | sed 's#--#-c --#g')"
|
247
261
|
fi
|
248
262
|
|
@@ -306,7 +320,9 @@ RubyWrapper
|
|
306
320
|
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
307
321
|
fi
|
308
322
|
|
309
|
-
|
323
|
+
# Remove the left over folder first.
|
324
|
+
rm -rf "$rvm_ruby_src_path"
|
325
|
+
mv "$rvm_src_path/rubinius-${rvm_ruby_version}" "$rvm_ruby_src_path"
|
310
326
|
else
|
311
327
|
__rvm_db "rubinius_repo_url" "rvm_ruby_repo_url"
|
312
328
|
#rvm_ruby_home="$rvm_rubies_path/$rvm_ruby_interpreter-$rvm_ruby_version"
|
@@ -388,7 +404,7 @@ RubyWrapper
|
|
388
404
|
fi
|
389
405
|
|
390
406
|
builtin cd "$rvm_ruby_src_path"
|
391
|
-
if [[
|
407
|
+
if [[ -n "$rvm_head_flag" ]] ; then __rvm_run "ant.dist" "ant dist" "Running 'ant dist' (this could take a few minutes) ..." ; fi
|
392
408
|
|
393
409
|
mkdir -p "$rvm_ruby_home/bin/"
|
394
410
|
if $rvm_scripts_path/match "$rvm_ruby_version" "1\.3" || $rvm_scripts_path/match "$rvm_ruby_version" "1\.2" ; then
|
@@ -444,7 +460,7 @@ RubyWrapper
|
|
444
460
|
|
445
461
|
__rvm_pushpop $rvm_src_path
|
446
462
|
|
447
|
-
if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[
|
463
|
+
if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[ -n "$rvm_force_flag" ]] ; then
|
448
464
|
rm -rf "$rvm_src_path/$rvm_ruby_string/" "$rvm_src_path/$rvm_ruby_string/"
|
449
465
|
__rvm_fetch_ruby
|
450
466
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
@@ -452,7 +468,7 @@ RubyWrapper
|
|
452
468
|
fi
|
453
469
|
fi
|
454
470
|
|
455
|
-
if [[
|
471
|
+
if [[ -n "$rvm_head_flag" ]] ; then
|
456
472
|
builtin cd $rvm_ruby_src_path
|
457
473
|
rvm_gemstone_package_file="GemStone-$(grep ^GEMSTONE version.txt | cut -f2 -d-).$(uname -sm | tr ' ' '-')"
|
458
474
|
rvm_gemstone_url="${rvm_gemstone_url:-"$maglev_url/${rvm_gemstone_package_file}.${rvm_archive_extension}"}"
|
@@ -497,7 +513,7 @@ RubyWrapper
|
|
497
513
|
done ; unset binary
|
498
514
|
|
499
515
|
builtin cd "$rvm_ruby_home"
|
500
|
-
if [[
|
516
|
+
if [[ -n "$rvm_head_flag" ]] ; then
|
501
517
|
git submodule update --init
|
502
518
|
$rvm_ruby_home/bin/maglev force-reload
|
503
519
|
ln -sf maglev.demo.key-$(uname -sm | tr ' ' '-') etc/maglev.demo.key
|
@@ -632,14 +648,15 @@ RubyWrapper
|
|
632
648
|
|
633
649
|
if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
|
634
650
|
(($rvm_debug_flag)) && $rvm_scripts_path/log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
|
635
|
-
elif [[
|
651
|
+
elif [[ -n "$rvm_ruby_configure" ]] ; then
|
636
652
|
__rvm_run "configure" "$rvm_ruby_configure"
|
637
653
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
638
654
|
$rvm_scripts_path/log "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
639
655
|
fi
|
640
656
|
|
641
657
|
elif [[ -s ./configure ]] ; then
|
642
|
-
|
658
|
+
local configure_command="./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags"
|
659
|
+
__rvm_run "configure" "" "Configuring $rvm_ruby_string using $rvm_ruby_configure_flags, this may take a while depending on your cpu(s)..."
|
643
660
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
644
661
|
$rvm_scripts_path/log "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
645
662
|
fi
|
@@ -690,7 +707,7 @@ RubyWrapper
|
|
690
707
|
|
691
708
|
rvm_hook="after_install" ; source $rvm_scripts_path/hook
|
692
709
|
|
693
|
-
if [[
|
710
|
+
if [[ -n "$ruby_options" ]] ; then RUBYOPT=$ruby_options ; export RUBYOPT ; fi
|
694
711
|
}
|
695
712
|
|
696
713
|
__rvm_fetch_from_github() {
|
@@ -735,7 +752,7 @@ __rvm_fetch_ruby() {
|
|
735
752
|
fi
|
736
753
|
|
737
754
|
# Only re-extract if forced.
|
738
|
-
if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[
|
755
|
+
if [[ ! -d "$rvm_src_path/$rvm_ruby_string" ]] || [[ -n "$rvm_force_flag" ]] ; then
|
739
756
|
if [[ "tar.gz" = "$rvm_archive_extension" ]] || [[ "tgz" = "$rvm_archive_extension" ]] ; then
|
740
757
|
__rvm_run "extract" "cat $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension | gunzip | tar xf - -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..."
|
741
758
|
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
@@ -752,7 +769,7 @@ __rvm_fetch_ruby() {
|
|
752
769
|
fi
|
753
770
|
else
|
754
771
|
mkdir -p "$rvm_repo_path"
|
755
|
-
if [[
|
772
|
+
if [[ -n "$(echo $rvm_url | awk '/^git/')" ]] ; then
|
756
773
|
if [[ -d "$rvm_ruby_repo_path/.git" ]] ; then
|
757
774
|
builtin cd $rvm_ruby_repo_path
|
758
775
|
if [[ -z "$rvm_ruby_revision" ]] ; then
|
@@ -780,10 +797,10 @@ __rvm_fetch_ruby() {
|
|
780
797
|
fi
|
781
798
|
fi
|
782
799
|
else
|
783
|
-
if [[
|
800
|
+
if [[ -n "$rvm_ruby_tag" ]] ; then
|
784
801
|
# TODO: Check if tag v is valid
|
785
802
|
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/tags/$(echo $rvm_ruby_tag | sed 's/^t//')"}"
|
786
|
-
elif [[ -z "$rvm_ruby_version" ]] && [[
|
803
|
+
elif [[ -z "$rvm_ruby_version" ]] && [[ -n "$rvm_head_flag" ]] ; then
|
787
804
|
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/trunk"}"
|
788
805
|
elif [[ "$rvm_major_version" = "9" ]] ; then
|
789
806
|
if [[ -z "$rvm_minor_version" ]] || [[ "$rvm_minor_version" = 3 ]] ; then
|
@@ -798,7 +815,7 @@ __rvm_fetch_ruby() {
|
|
798
815
|
fi
|
799
816
|
|
800
817
|
rvm_rev=""
|
801
|
-
if [
|
818
|
+
if [ -n "$rvm_ruby_revision" ] ; then
|
802
819
|
rvm_rev="-$rvm_ruby_revision"
|
803
820
|
fi
|
804
821
|
|
@@ -807,7 +824,7 @@ __rvm_fetch_ruby() {
|
|
807
824
|
$rvm_scripts_path/log "info" "Updating ruby from $rvm_url"
|
808
825
|
__rvm_run "svn.switch" "svn switch $rvm_url"
|
809
826
|
__rvm_run "svn.update" "svn update"
|
810
|
-
if [[
|
827
|
+
if [[ -n "$rvm_rev" ]] ; then
|
811
828
|
$rvm_scripts_path/log "info" "Checking out revision ${rvm_rev/-r/-r } from $rvm_url"
|
812
829
|
__rvm_run "svn.checkout" "svn update -q ${rvm_rev/-r/-r }"
|
813
830
|
fi
|
@@ -838,7 +855,7 @@ __rvm_check_default() {
|
|
838
855
|
__rvm_uninstall_ruby() {
|
839
856
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
840
857
|
|
841
|
-
if [[
|
858
|
+
if [[ -n "$rvm_ruby_string" ]] ; then
|
842
859
|
for dir in $rvm_rubies_path ; do
|
843
860
|
if [[ -d $dir/$rvm_ruby_string ]] ; then
|
844
861
|
$rvm_scripts_path/log "info" "Removing $dir/$rvm_ruby_string..."
|
@@ -862,7 +879,7 @@ __rvm_uninstall_ruby() {
|
|
862
879
|
__rvm_remove_ruby() {
|
863
880
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
864
881
|
|
865
|
-
if [[
|
882
|
+
if [[ -n "$rvm_ruby_string" ]] ; then
|
866
883
|
for dir in $rvm_src_path $rvm_rubies_path ; do
|
867
884
|
if [[ -d $dir/$rvm_ruby_string ]] ; then
|
868
885
|
$rvm_scripts_path/log "info" "Removing $dir/$rvm_ruby_string..."
|
@@ -890,7 +907,7 @@ __rvm_remove_ruby() {
|
|
890
907
|
}
|
891
908
|
|
892
909
|
__rvm_remove_gemsets() {
|
893
|
-
if [[
|
910
|
+
if [[ -n "$rvm_gems_flag" ]] ; then
|
894
911
|
$rvm_scripts_path/log "info" "Removing $rvm_ruby_string gemsets..."
|
895
912
|
gemsets="$rvm_gems_path/$rvm_ruby_string $(\ls -d "${rvm_gems_path}"/* | awk '/'$rvm_ruby_string'@/')"
|
896
913
|
for gemset in $gemsets ; do
|
@@ -927,7 +944,7 @@ __rvm_remove_aliases() {
|
|
927
944
|
}
|
928
945
|
|
929
946
|
__rvm_remove_archives() {
|
930
|
-
if [[
|
947
|
+
if [[ -n "$rvm_archive_flag" ]] ; then
|
931
948
|
$rvm_scripts_path/log "info" "Removing $rvm_ruby_string archives..."
|
932
949
|
rm -f $rvm_archives_path/${rvm_ruby_package_file}.${rvm_archive_extension}
|
933
950
|
fi
|
@@ -987,7 +1004,7 @@ __rvm_generate_default_docs() {
|
|
987
1004
|
}
|
988
1005
|
|
989
1006
|
__rvm_rubygems_setup() {
|
990
|
-
if [[
|
1007
|
+
if [[ -n "$(echo $rvm_ruby_version | awk '/^1\.9/')" ]] || [[ -n "$(echo $rvm_ruby_interpreter | awk '/^mput/')" ]] ; then
|
991
1008
|
install=0
|
992
1009
|
elif [[ "$rvm_ruby_string" = "ruby-head" ]] ; then
|
993
1010
|
install=0
|
@@ -1028,9 +1045,9 @@ __rvm_rubygems_setup() {
|
|
1028
1045
|
ruby_lib_gem_path="${directory_name}/${version_number}"
|
1029
1046
|
fi
|
1030
1047
|
unset directory_name version_number
|
1031
|
-
elif [[
|
1048
|
+
elif [[ -n "$(echo $rvm_ruby_interpreter | awk '/^rbx|jruby/')" ]] ; then
|
1032
1049
|
# Hands off rubygems for rbx & jruby
|
1033
|
-
if [[
|
1050
|
+
if [[ -n "$rvm_debug_flag" ]] ; then $rvm_scripts_path/log "debug" "Skipping rubygems update for $rvm_ruby_version" ; fi
|
1034
1051
|
ruby_lib_gem_path="$rvm_ruby_home/lib/ruby/gems/jruby"
|
1035
1052
|
else
|
1036
1053
|
$rvm_scripts_path/log "info" "Installing rubygems dedicated to $rvm_ruby_string..."
|
@@ -1067,7 +1084,7 @@ __rvm_rubygems_setup() {
|
|
1067
1084
|
|
1068
1085
|
__rvm_inject_ruby_shebang "$rvm_ruby_home/bin/gem"
|
1069
1086
|
|
1070
|
-
if [[
|
1087
|
+
if [[ -n "$rvm_major_version" ]] ; then
|
1071
1088
|
ruby_lib_gem_path="$rvm_ruby_home/lib/ruby/gems/${rvm_release_version}.$rvm_major_version"
|
1072
1089
|
else
|
1073
1090
|
ruby_lib_gem_path="$rvm_ruby_home/lib/ruby/gems/$interpreter"
|
@@ -1104,12 +1121,12 @@ __rvm_inject_ruby_shebang() {
|
|
1104
1121
|
__rvm_inject_gem_env() {
|
1105
1122
|
__rvm_actual_file $1
|
1106
1123
|
if [[ -f "$actual_file" ]] ; then
|
1107
|
-
if [[
|
1124
|
+
if [[ -n "$(head -n 1 $actual_file | awk '/[j]*ruby/')" ]] ; then
|
1108
1125
|
string="ENV['GEM_HOME']=ENV['GEM_HOME'] || '$rvm_ruby_gem_home'\nENV['GEM_PATH']=ENV['GEM_PATH'] || '$rvm_ruby_gem_path'\nENV['PATH']='$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin:$rvm_ruby_home/bin:' + ENV['PATH']\nENV['BUNDLE_PATH']=ENV['BUNDLE_PATH'] || '$rvm_ruby_gem_home'\n"
|
1109
|
-
elif [[
|
1126
|
+
elif [[ -n "$(head -n 1 $actual_file | awk '/bash/')" ]] ; then
|
1110
1127
|
string="GEM_HOME=\${GEM_HOME:-'$rvm_ruby_gem_home'}\nGEM_PATH=\${GEM_PATH:-'$rvm_ruby_gem_path'}\nPATH=$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin:$rvm_ruby_home/bin:\$PATH\nBUNDLE_PATH=\${BUNDLE_PATH:-'$rvm_ruby_gem_home'}\n"
|
1111
1128
|
fi
|
1112
|
-
if [[
|
1129
|
+
if [[ -n "$string" ]] ; then
|
1113
1130
|
awk "NR==2 {print \"$string\"} {print}" "$actual_file" > "$actual_file.new"
|
1114
1131
|
mv $actual_file.new $actual_file ; chmod +x "$actual_file"
|
1115
1132
|
unset string
|
@@ -1133,8 +1150,8 @@ __rvm_manage_rubies() {
|
|
1133
1150
|
|
1134
1151
|
local manage_result=0
|
1135
1152
|
|
1136
|
-
if [[
|
1137
|
-
for rvm_ruby_string in $(echo $rubies_string | tr ',' ' ') ; do
|
1153
|
+
if [[ -n "$rubies_string" ]] ;then
|
1154
|
+
for rvm_ruby_string in $(echo "$rubies_string" | tr ',' ' ') ; do
|
1138
1155
|
eval "__rvm_${rvm_action}_ruby"
|
1139
1156
|
__rvm_unset_ruby_variables
|
1140
1157
|
done
|
data/scripts/md5
CHANGED
@@ -2,17 +2,16 @@
|
|
2
2
|
|
3
3
|
if [[ "$rvm_trace_flag" -eq 1 ]] ; then set -x ; export rvm_trace_flag ; fi
|
4
4
|
|
5
|
-
file
|
5
|
+
file="$1"
|
6
|
+
md5="$2"
|
6
7
|
|
7
8
|
if [[ "Linux" = "$(uname)" ]] ; then
|
8
9
|
command="md5sum"
|
9
|
-
#md5sum --status -c "$file"
|
10
10
|
elif [[ "Darwin" = "$(uname)" ]] ; then
|
11
|
-
|
12
|
-
command="/sbin/md5"
|
11
|
+
command="/sbin/md5 -q"
|
13
12
|
fi
|
14
13
|
|
15
|
-
file_md5=$($command $file | awk '{print $
|
14
|
+
file_md5=$($command "$file" | awk '{print $1}')
|
16
15
|
|
17
16
|
if [[ "$file_md5" = "$md5" ]] ; then
|
18
17
|
exit 0
|
data/scripts/package
CHANGED
@@ -26,7 +26,7 @@ install_package() {
|
|
26
26
|
__rvm_run "$package/extract" "tar jxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format to $rvm_src_path"
|
27
27
|
elif [[ "$archive_format" = "zip" ]] ; then
|
28
28
|
$rvm_scripts_path/fetch "$package_url/$package-$version.$archive_format" || (result=$? && return $result)
|
29
|
-
|
29
|
+
__rvm_run "$package/extract" "unzip -q -o $rvm_archives_path/$package-$version.$archive_format -d $rvm_src_path/$package-$version" "Extracting $package-$version.$archive_format to $rvm_src_path"
|
30
30
|
else
|
31
31
|
printf "\nUnrecognized archive format '$archive_format'" ; return 1
|
32
32
|
fi
|
@@ -71,14 +71,36 @@ curl() {
|
|
71
71
|
openssl() {
|
72
72
|
package="openssl" ; version="0.9.8n" ; archive_format="tar.gz"
|
73
73
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
74
|
-
if
|
75
|
-
|
74
|
+
if [[ ! -z "$rvm_archflags" ]]; then
|
75
|
+
if $rvm_scripts_path/match "$rvm_archflags" "64"; then
|
76
|
+
hw_cpu64bit=1
|
77
|
+
fi
|
78
|
+
if $rvm_scripts_path/match "$rvm_archflags" "ppc"; then
|
79
|
+
hw_machine="Power Macintosh"
|
80
|
+
fi
|
76
81
|
else
|
77
|
-
|
82
|
+
hw_machine=$(sysctl hw.machine | awk -F: '{print $2}' | sed 's/^ //')
|
83
|
+
hw_cpu64bit=$(sysctl hw.cpu64bit_capable | awk '{print $2}')
|
84
|
+
fi
|
85
|
+
if [[ "Power Macintosh" = "$hw_machine" ]] ; then
|
86
|
+
if [[ $hw_cpu64bit = 1 ]]; then
|
87
|
+
openssl_os="darwin64-ppc-cc"
|
88
|
+
else
|
89
|
+
openssl_os="darwin-ppc-cc"
|
90
|
+
fi
|
91
|
+
else
|
92
|
+
if [[ $hw_cpu64bit = 1 ]]; then
|
93
|
+
openssl_os="darwin64-x86_64-cc"
|
94
|
+
else
|
95
|
+
openssl_os="darwin-i386-cc"
|
96
|
+
fi
|
78
97
|
fi
|
79
98
|
configure_command="./Configure"
|
80
99
|
patches="$rvm_patches_path/$package/Makefile.org.patch,$rvm_patches_path/$package/crypto-Makefile.patch"
|
81
|
-
|
100
|
+
# Don't use -j option for make OpenSSL
|
101
|
+
if [[ ! -z "$rvm_make_flags" ]] ; then
|
102
|
+
rvm_make_flags=$(echo $rvm_make_flags | sed -e "s/-j[[:space:]]*[[0-9]]*//")
|
103
|
+
fi
|
82
104
|
else
|
83
105
|
configure_command="./config"
|
84
106
|
fi
|
@@ -162,7 +184,7 @@ if [[ ! -z "$library" ]] ; then
|
|
162
184
|
$rvm_scripts_path/log "error" "Package '${library}' is unknown."
|
163
185
|
fi
|
164
186
|
else
|
165
|
-
$rvm_scripts_path/log "info" "Usage: 'rvm package {install,uninstall} {openssl,zlib,
|
187
|
+
$rvm_scripts_path/log "info" "Usage: 'rvm package {install,uninstall} {readline,iconv,curl,openssl,zlib,autoconf,ncurses,pkgconfig,gettext,glib,mono,llvm,libxml2}'"
|
166
188
|
exit 1
|
167
189
|
fi
|
168
190
|
|
data/scripts/rubygems
CHANGED
@@ -57,9 +57,9 @@ rubygems_setup() {
|
|
57
57
|
__rvm_run "rubygems.install" "GEM_PATH=$rvm_ruby_gem_path GEM_HOME=$rvm_ruby_gem_home BUNDLE_PATH=$rvm_ruby_gem_home $rvm_ruby_home/bin/ruby $rvm_src_path/$rvm_gem_package_name/setup.rb" "Installing rubygems for $rvm_ruby_home/bin/ruby"
|
58
58
|
result=$?
|
59
59
|
if [[ "$result" == 0 ]] ; then
|
60
|
-
$rvm_scripts_path/log "info" "Installation of rubygems
|
60
|
+
$rvm_scripts_path/log "info" "Installation of rubygems completed successfully."
|
61
61
|
else
|
62
|
-
$rvm_scripts_path/log "warning" "Installation of rubygems
|
62
|
+
$rvm_scripts_path/log "warning" "Installation of rubygems did not complete successfully."
|
63
63
|
fi
|
64
64
|
|
65
65
|
if [[ ! -z "$rvm_major_version" ]] ; then
|
data/scripts/rvm
CHANGED
@@ -22,13 +22,13 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
|
|
22
22
|
if [[ "root" = "$(whoami)" ]] ; then
|
23
23
|
rvm_prefix="/usr/local"
|
24
24
|
else
|
25
|
-
rvm_prefix="$HOME"
|
25
|
+
rvm_prefix="$HOME/."
|
26
26
|
fi
|
27
27
|
fi
|
28
28
|
|
29
29
|
if [[ -z "$rvm_path" ]] ; then
|
30
30
|
unset rvm_path
|
31
|
-
if
|
31
|
+
if [[ "root" = "$(whoami)" ]] ; then
|
32
32
|
rvm_path="$rvm_prefix/rvm"
|
33
33
|
else
|
34
34
|
if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
|