rvm 0.0.99 → 0.0.999
Sign up to get free protection for your applications and to get access to all the features.
- data/config/db +2 -2
- data/install +49 -13
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +4 -3
- data/scripts/cli +21 -16
- data/scripts/gems +23 -7
- data/scripts/initialize +1 -1
- data/scripts/install +49 -13
- data/scripts/manage +139 -41
- data/scripts/rvm +1 -0
- data/scripts/rvm-install +49 -13
- data/scripts/selector +16 -14
- data/scripts/update +49 -13
- data/scripts/utility +12 -15
- data/scripts/version +14 -0
- metadata +3 -2
data/config/db
CHANGED
@@ -23,8 +23,8 @@ ree_1.8.7_url=http://rubyforge.org/frs/download.php/66162
|
|
23
23
|
ree_1.8.7_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition187.git
|
24
24
|
ree_1.8.7_patch_level=2009.10
|
25
25
|
rbx_version=1.0.0
|
26
|
-
rbx_patch_level=
|
27
|
-
rbx_url=http://asset.rubini.us/rubinius-1.0.0-
|
26
|
+
rbx_patch_level=rc2
|
27
|
+
rbx_url=http://asset.rubini.us/rubinius-1.0.0-rc2-20100104.tar.gz
|
28
28
|
ruby_1.9.1_patch_level=376
|
29
29
|
ruby_1.9.2_patch_level=preview1
|
30
30
|
ruby_1.8.5_patch_level=231
|
data/install
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
|
3
|
+
unset rvm_auto_flag
|
4
|
+
|
5
|
+
source scripts/version
|
6
|
+
source scripts/utility
|
7
|
+
|
8
|
+
usage() {
|
9
|
+
echo -e "
|
10
|
+
Usage:
|
11
|
+
${0} <options>
|
12
|
+
|
13
|
+
Options:
|
14
|
+
--auto : Automatically update shell profile files.
|
15
|
+
--prefix : Installation prefix directory.
|
16
|
+
--help : Display help/usage (this) message
|
17
|
+
--version : display rvm package version
|
18
|
+
"
|
19
|
+
}
|
20
|
+
|
21
|
+
while [[ $# -gt 0 ]] ; do
|
22
|
+
token="$1" ; shift
|
23
|
+
case "$token" in
|
24
|
+
--auto) rvm_auto_flag=1 ;;
|
25
|
+
--prefix) prefix_path="$1" ; shift ;;
|
26
|
+
--version) rvm_path="$(pwd)" ; __rvm_version ; unset rvm_path ; exit ;;
|
27
|
+
--help|*) usage ;;
|
28
|
+
esac
|
29
|
+
done
|
4
30
|
|
5
31
|
if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
|
6
32
|
if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
|
@@ -14,7 +40,6 @@ if ! [[ "$rvm_path" =~ /rvm/?$ ]] ; then
|
|
14
40
|
fi
|
15
41
|
fi
|
16
42
|
|
17
|
-
source scripts/utility
|
18
43
|
source scripts/initialize
|
19
44
|
|
20
45
|
__rvm_initialize
|
@@ -25,16 +50,16 @@ __rvm_initialize
|
|
25
50
|
item="$(tput setaf 2)* $(tput sgr0)"
|
26
51
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
27
52
|
cwd=$(pwd)
|
28
|
-
|
29
|
-
if [[ ! -d "$
|
30
|
-
|
53
|
+
source_path="${source_path:-"$(dirname $0 | xargs dirname)"}"
|
54
|
+
if [[ ! -d "$source_path" ]] ; then unset source_path ; fi
|
55
|
+
source_path="${source_path:-$cwd}"
|
31
56
|
|
32
57
|
# State what is required to use rvm
|
33
58
|
echo -e "\nInstalling rvm to $rvm_path/ ..."
|
34
59
|
for dir_name in src scripts bin log archives config gems examples ; do
|
35
60
|
mkdir -p "$rvm_path/$dir_name"
|
36
61
|
done
|
37
|
-
cp -f "$
|
62
|
+
cp -f "$source_path/README" "$rvm_path/"
|
38
63
|
|
39
64
|
#
|
40
65
|
# Scripts
|
@@ -42,8 +67,8 @@ cp -f "$source_dir/README" "$rvm_path/"
|
|
42
67
|
rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
|
43
68
|
for dir_name in config scripts examples lib hooks ; do
|
44
69
|
mkdir -p "$rvm_path/$dir_name"
|
45
|
-
if [[ -d "$
|
46
|
-
cp -Rf "$
|
70
|
+
if [[ -d "$source_path/$dir_name" ]] ; then
|
71
|
+
cp -Rf "$source_path/$dir_name" "$rvm_path"
|
47
72
|
fi
|
48
73
|
done ; unset dir_name
|
49
74
|
|
@@ -57,7 +82,7 @@ fi
|
|
57
82
|
# Cleanse and purge...
|
58
83
|
rm -f $rvm_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
|
59
84
|
for file in rvm-prompt rvm rvmsudo ; do
|
60
|
-
cp -f "$
|
85
|
+
cp -f "$source_path/binscripts/$file" $rvm_path/bin/
|
61
86
|
done
|
62
87
|
chmod +x $rvm_path/bin/*
|
63
88
|
|
@@ -83,6 +108,15 @@ if [[ ! -z "$rvm_auto_flag" ]] ; then
|
|
83
108
|
fi
|
84
109
|
fi
|
85
110
|
|
111
|
+
#
|
112
|
+
# TODO: Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/
|
113
|
+
#
|
114
|
+
#rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
|
115
|
+
#mkdir -p $rvm_rubies_path
|
116
|
+
#for ruby in "$rvm_path"/ruby-* "$rvm_path"/jruby-* "$rvm_path"/mput-* "$rvm_path"/rbx-* ; do
|
117
|
+
# if [[ -d "$ruby" ]] ; then mv "$ruby" "$rvm_rubies_path" ; fi
|
118
|
+
#done
|
119
|
+
|
86
120
|
if [[ "root" = "$(whoami)" ]] ; then
|
87
121
|
echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
|
88
122
|
mkdir -p $rvm_symlink_path
|
@@ -107,13 +141,15 @@ echo -e "If I do not respond right away, please hang around after asking your qu
|
|
107
141
|
echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
|
108
142
|
echo -e "\n ~ Wayne\n"
|
109
143
|
echo "================================================================================"
|
110
|
-
|
144
|
+
echo -e "Upgrades"
|
145
|
+
echo -e "Gems are now per interpreter installation instead of per interpreter/version"
|
146
|
+
echo -e "so for example to upgrade an older install of 1.8.6 and preserve gems:"
|
147
|
+
echo -e "rm -rf ~/.rvm/gems/ruby-1.8.6-p383 ; mv ~/.rvm/gems/ruby/1.8.6 ~/.rvm/gems/ruby-1.8.6-p383"
|
148
|
+
echo "================================================================================"
|
111
149
|
echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
|
112
|
-
echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bash_profile and
|
150
|
+
echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
|
113
151
|
echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
|
114
152
|
echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
|
115
153
|
echo -e "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
116
154
|
|
117
|
-
if [[ -x "$rvm_path/bin/rvm" ]] ; then "$rvm_path/bin/rvm" -v ; fi
|
118
|
-
|
119
155
|
exit 0
|
data/lib/VERSION.yml
CHANGED
data/rvm.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rvm}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.999"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Wayne E. Seguin"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2010-01-07}
|
13
13
|
s.default_executable = %q{rvm-install}
|
14
14
|
s.description = %q{Manages Ruby interpreter installations and switching between them.}
|
15
15
|
s.email = %q{wayneeseguin@gmail.com}
|
@@ -62,7 +62,8 @@ Gem::Specification.new do |s|
|
|
62
62
|
"scripts/selector",
|
63
63
|
"scripts/symlink",
|
64
64
|
"scripts/update",
|
65
|
-
"scripts/utility"
|
65
|
+
"scripts/utility",
|
66
|
+
"scripts/version"
|
66
67
|
]
|
67
68
|
s.homepage = %q{http://github.com/wayneeseguin/rvm}
|
68
69
|
s.post_install_message = %q{********************************************************************************
|
data/scripts/cli
CHANGED
@@ -1,18 +1,9 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
__rvm_meta() {
|
4
|
-
rvm_meta_author="Wayne E. Seguin"
|
5
|
-
rvm_meta_author_email="wayneeseguin@gmail.com"
|
6
|
-
rvm_meta_website="http://rvm.beginrescueend.com/"
|
7
|
-
rvm_meta_version="${rvm_version}"
|
8
|
-
}
|
9
|
-
|
10
|
-
__rvm_version() { __rvm_meta ; echo -e "\nrvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]\n" ; }
|
11
|
-
|
12
3
|
__rvm_usage() { cat "${rvm_path:-$HOME/.rvm}/README" | ${PAGER:-less} ; }
|
13
4
|
|
14
5
|
__rvm_parse_args() {
|
15
|
-
if echo "$*" | grep -q 'trace' ; then echo "$*" ; fi
|
6
|
+
if echo "$*" | grep -q 'trace' ; then echo "$*" ; __rvm_version ; fi
|
16
7
|
|
17
8
|
while [[ $# -gt 0 ]] ; do
|
18
9
|
rvm_token="$1" ; shift
|
@@ -58,8 +49,23 @@ __rvm_parse_args() {
|
|
58
49
|
|
59
50
|
gems|gemset)
|
60
51
|
rvm_action="gems"
|
61
|
-
if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "
|
52
|
+
if [[ "name" = "$1" ]] || [[ "dir" = "$1" ]] || [[ "list" = "$1" ]] || [[ "empty" = "$1" ]] || [[ "dump" = "$1" ]] || [[ "load" = "$1" ]] ; then
|
62
53
|
rvm_ruby_args="$*" ; export rvm_${1}_flag=1 ; shift
|
54
|
+
elif [[ "clear" = "$1" ]] ; then
|
55
|
+
unset rvm_gem_set_name ; shift
|
56
|
+
export rvm_ruby_gem_home="$(echo $GEM_HOME | sed 's/%.*$//')"
|
57
|
+
export GEM_HOME="$rvm_ruby_gem_home"
|
58
|
+
export GEM_PATH="$GEM_HOME"
|
59
|
+
rvm_ruby_args="clear"
|
60
|
+
rvm_parse_break=1
|
61
|
+
elif [[ "delete" = "$1" ]] ; then
|
62
|
+
export rvm_delete_flag=1 ; shift
|
63
|
+
rvm_ruby_args="$*"
|
64
|
+
rvm_gem_set_name="$1"; shift
|
65
|
+
rvm_ruby_string=$(echo $rvm_gem_set_name | sed 's/\(.*\)%.*/\1/')
|
66
|
+
rvm_gem_set_name=$(echo $rvm_gem_set_name | sed 's/.*%\(.*\)/\1/')
|
67
|
+
if [[ "$rvm_ruby_string" != "$rvm_gem_set_name" ]] ; then export rvm_ruby_string ; fi
|
68
|
+
if [[ ! -z "$rvm_gem_set_name" ]] ; then export rvm_gem_set_name ; fi
|
63
69
|
else
|
64
70
|
rvm_gem_set_name="$1" ; shift
|
65
71
|
export rvm_use_flag=1 # Default is to use the (named) gem set.
|
@@ -245,7 +251,7 @@ __rvm_parse_args() {
|
|
245
251
|
|
246
252
|
default|system)
|
247
253
|
rvm_action="use"
|
248
|
-
rvm_ruby_interpreter="
|
254
|
+
rvm_ruby_interpreter="$rvm_token"
|
249
255
|
rvm_ruby_string="$rvm_token"
|
250
256
|
;;
|
251
257
|
|
@@ -262,12 +268,11 @@ __rvm_parse_args() {
|
|
262
268
|
-m|--gem-set) rvm_gem_set_name="$1" ; shift ;;
|
263
269
|
--sdk) rvm_sdk="$1" ; shift ;;
|
264
270
|
--archflags) rvm_archflags="$1" ; shift ;;
|
265
|
-
|
266
|
-
tests|specs) rvm_action="tests" ;;
|
267
271
|
--trace) export rvm_trace_flag=1 ; set -x ;;
|
268
272
|
--symlink) rvm_symlink_name="$1" ; shift ;;
|
269
|
-
|
270
|
-
--
|
273
|
+
tests|specs) rvm_action="tests" ;;
|
274
|
+
--disable-llvm|--disable-jit) export rvm_llvm_flag=0 ;;
|
275
|
+
--enable-llvm|--enable-jit) export rvm_llvm_flag=1 ;;
|
271
276
|
|
272
277
|
--self|--gem|--rubygems|--reconfigure|--default|--debug|--force|--all|--dump|--summary|--latest|--yaml|--json|--archive|--shebang|--env|--path|--tail|--delete|--verbose|--load|--passenger|--editor)
|
273
278
|
export rvm_$(echo $rvm_token | sed 's#-##g')_flag=1
|
data/scripts/gems
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
3
|
source $rvm_path/scripts/utility
|
4
|
+
source $rvm_path/scripts/selector
|
4
5
|
|
5
6
|
color_green=$($rvm_scripts_path/color "green")
|
6
7
|
color_red=$($rvm_scripts_path/color "red")
|
@@ -14,7 +15,7 @@ if [[ -d "$rvm_ruby_gem_home" ]] && which gem &> /dev/null ; then rvm_ruby_gem_h
|
|
14
15
|
trap "if [[ -d $rvm_path/tmp/ ]] && [[ -f $rvm_path/tmp/$$ ]] ; then rm -f $rvm_path/tmp/$$ > /dev/null 2>&1 ; fi ; exit" 0 1 2 3 15
|
15
16
|
|
16
17
|
__rvm_gems_name() {
|
17
|
-
echo "$
|
18
|
+
echo "$(gem env gemdir)" | awk -F'%' '{print $2}'
|
18
19
|
}
|
19
20
|
|
20
21
|
__rvm_gems_dir() {
|
@@ -22,20 +23,31 @@ __rvm_gems_dir() {
|
|
22
23
|
}
|
23
24
|
|
24
25
|
__rvm_gems_list() {
|
25
|
-
if [[ $
|
26
|
-
|
27
|
-
|
28
|
-
|
26
|
+
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
27
|
+
|
28
|
+
$rvm_scripts_path/log "info" "Listing gems(ets) for $rvm_ruby_string found in $rvm_gem_path/"
|
29
|
+
|
30
|
+
if [[ ! -z "$rvm_gem_path" ]] ; then
|
31
|
+
if [[ ! -z $rvm_ruby_string ]] ; then
|
32
|
+
for gemdir in $rvm_gem_path/${rvm_ruby_string}%* ; do
|
33
|
+
echo "$gemdir" | awk -F'%' '{print $2}'
|
34
|
+
done
|
35
|
+
else
|
36
|
+
$rvm_scripts_path/log "error" "\$rvm_ruby_string is not set!"
|
37
|
+
fi
|
38
|
+
else
|
39
|
+
$rvm_scripts_path/log "error" "\$rvm_gem_path is not set!"
|
29
40
|
fi
|
30
41
|
}
|
31
42
|
|
32
43
|
__rvm_gems_delete() {
|
44
|
+
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select ; fi
|
33
45
|
if [[ ! -z "$rvm_gem_set_name" ]] ; then
|
34
46
|
gemdir="$rvm_gem_path/$rvm_ruby_string%$rvm_gem_set_name"
|
35
|
-
if [[ -d "$gemdir" ]] && [[ ! -z "$rvm_force_flag" ]] ; then
|
47
|
+
if [[ -d "$gemdir" ]] && [[ "$gemdir" != '/' ]] && [[ ! -z "$rvm_force_flag" ]] ; then
|
36
48
|
rm -rf "$gemdir"
|
37
49
|
elif [[ -d "$gemdir" ]] ; then
|
38
|
-
$rvm_scripts_path/log "warn" "Are you SURE you wish to remove the installed gems '$rvm_gem_set_name
|
50
|
+
$rvm_scripts_path/log "warn" "Are you SURE you wish to remove the installed gems '$rvm_gem_set_name' ($gemdir)?"
|
39
51
|
echo -n "(anything other than 'yes' will cancel) > "
|
40
52
|
read response
|
41
53
|
if [[ "yes" = "$response" ]] ; then
|
@@ -263,7 +275,11 @@ elif [[ "gemdir" = "$action" ]] ; then
|
|
263
275
|
__rvm_gems_gemdir
|
264
276
|
elif [[ "install" = "$action" ]] ; then
|
265
277
|
__rvm_gem_install $*
|
278
|
+
elif [[ "clear" = "$action" ]] ; then
|
279
|
+
$rvm_scripts_path/log "info" "gems(et) cleared."
|
280
|
+
exit 0
|
266
281
|
else
|
267
282
|
$rvm_scripts_path/log "error" "gems must be passed an action as the first parameter {load,dump,delete,name,list,gemdir,install}"
|
268
283
|
fi
|
269
284
|
|
285
|
+
exit $?
|
data/scripts/initialize
CHANGED
@@ -32,5 +32,5 @@ rvm_tmp_path="${rvm_tmp_path:-"$rvm_path/tmp"}"
|
|
32
32
|
rvm_symlink_path="${rvm_symlink_path:-/usr/local/bin}"
|
33
33
|
rvm_gem_options="${rvm_gem_options:-"--no-rdoc --no-ri"}"
|
34
34
|
|
35
|
-
export rvm_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_log_path rvm_bin_path rvm_gem_path rvm_config_path rvm_tmp_path
|
35
|
+
export rvm_path rvm_scripts_path rvm_archives_path rvm_src_path rvm_log_path rvm_bin_path rvm_gem_path rvm_config_path rvm_tmp_path rvm_hooks_path
|
36
36
|
|
data/scripts/install
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
|
3
|
+
unset rvm_auto_flag
|
4
|
+
|
5
|
+
source scripts/version
|
6
|
+
source scripts/utility
|
7
|
+
|
8
|
+
usage() {
|
9
|
+
echo -e "
|
10
|
+
Usage:
|
11
|
+
${0} <options>
|
12
|
+
|
13
|
+
Options:
|
14
|
+
--auto : Automatically update shell profile files.
|
15
|
+
--prefix : Installation prefix directory.
|
16
|
+
--help : Display help/usage (this) message
|
17
|
+
--version : display rvm package version
|
18
|
+
"
|
19
|
+
}
|
20
|
+
|
21
|
+
while [[ $# -gt 0 ]] ; do
|
22
|
+
token="$1" ; shift
|
23
|
+
case "$token" in
|
24
|
+
--auto) rvm_auto_flag=1 ;;
|
25
|
+
--prefix) prefix_path="$1" ; shift ;;
|
26
|
+
--version) rvm_path="$(pwd)" ; __rvm_version ; unset rvm_path ; exit ;;
|
27
|
+
--help|*) usage ;;
|
28
|
+
esac
|
29
|
+
done
|
4
30
|
|
5
31
|
if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
|
6
32
|
if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
|
@@ -14,7 +40,6 @@ if ! [[ "$rvm_path" =~ /rvm/?$ ]] ; then
|
|
14
40
|
fi
|
15
41
|
fi
|
16
42
|
|
17
|
-
source scripts/utility
|
18
43
|
source scripts/initialize
|
19
44
|
|
20
45
|
__rvm_initialize
|
@@ -25,16 +50,16 @@ __rvm_initialize
|
|
25
50
|
item="$(tput setaf 2)* $(tput sgr0)"
|
26
51
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
27
52
|
cwd=$(pwd)
|
28
|
-
|
29
|
-
if [[ ! -d "$
|
30
|
-
|
53
|
+
source_path="${source_path:-"$(dirname $0 | xargs dirname)"}"
|
54
|
+
if [[ ! -d "$source_path" ]] ; then unset source_path ; fi
|
55
|
+
source_path="${source_path:-$cwd}"
|
31
56
|
|
32
57
|
# State what is required to use rvm
|
33
58
|
echo -e "\nInstalling rvm to $rvm_path/ ..."
|
34
59
|
for dir_name in src scripts bin log archives config gems examples ; do
|
35
60
|
mkdir -p "$rvm_path/$dir_name"
|
36
61
|
done
|
37
|
-
cp -f "$
|
62
|
+
cp -f "$source_path/README" "$rvm_path/"
|
38
63
|
|
39
64
|
#
|
40
65
|
# Scripts
|
@@ -42,8 +67,8 @@ cp -f "$source_dir/README" "$rvm_path/"
|
|
42
67
|
rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
|
43
68
|
for dir_name in config scripts examples lib hooks ; do
|
44
69
|
mkdir -p "$rvm_path/$dir_name"
|
45
|
-
if [[ -d "$
|
46
|
-
cp -Rf "$
|
70
|
+
if [[ -d "$source_path/$dir_name" ]] ; then
|
71
|
+
cp -Rf "$source_path/$dir_name" "$rvm_path"
|
47
72
|
fi
|
48
73
|
done ; unset dir_name
|
49
74
|
|
@@ -57,7 +82,7 @@ fi
|
|
57
82
|
# Cleanse and purge...
|
58
83
|
rm -f $rvm_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
|
59
84
|
for file in rvm-prompt rvm rvmsudo ; do
|
60
|
-
cp -f "$
|
85
|
+
cp -f "$source_path/binscripts/$file" $rvm_path/bin/
|
61
86
|
done
|
62
87
|
chmod +x $rvm_path/bin/*
|
63
88
|
|
@@ -83,6 +108,15 @@ if [[ ! -z "$rvm_auto_flag" ]] ; then
|
|
83
108
|
fi
|
84
109
|
fi
|
85
110
|
|
111
|
+
#
|
112
|
+
# TODO: Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/
|
113
|
+
#
|
114
|
+
#rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
|
115
|
+
#mkdir -p $rvm_rubies_path
|
116
|
+
#for ruby in "$rvm_path"/ruby-* "$rvm_path"/jruby-* "$rvm_path"/mput-* "$rvm_path"/rbx-* ; do
|
117
|
+
# if [[ -d "$ruby" ]] ; then mv "$ruby" "$rvm_rubies_path" ; fi
|
118
|
+
#done
|
119
|
+
|
86
120
|
if [[ "root" = "$(whoami)" ]] ; then
|
87
121
|
echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
|
88
122
|
mkdir -p $rvm_symlink_path
|
@@ -107,13 +141,15 @@ echo -e "If I do not respond right away, please hang around after asking your qu
|
|
107
141
|
echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
|
108
142
|
echo -e "\n ~ Wayne\n"
|
109
143
|
echo "================================================================================"
|
110
|
-
|
144
|
+
echo -e "Upgrades"
|
145
|
+
echo -e "Gems are now per interpreter installation instead of per interpreter/version"
|
146
|
+
echo -e "so for example to upgrade an older install of 1.8.6 and preserve gems:"
|
147
|
+
echo -e "rm -rf ~/.rvm/gems/ruby-1.8.6-p383 ; mv ~/.rvm/gems/ruby/1.8.6 ~/.rvm/gems/ruby-1.8.6-p383"
|
148
|
+
echo "================================================================================"
|
111
149
|
echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
|
112
|
-
echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bash_profile and
|
150
|
+
echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
|
113
151
|
echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
|
114
152
|
echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
|
115
153
|
echo -e "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
116
154
|
|
117
|
-
if [[ -x "$rvm_path/bin/rvm" ]] ; then "$rvm_path/bin/rvm" -v ; fi
|
118
|
-
|
119
155
|
exit 0
|
data/scripts/manage
CHANGED
@@ -6,6 +6,7 @@ original_ruby_string=$rvm_ruby_string
|
|
6
6
|
source $rvm_scripts_path/initialize
|
7
7
|
source $rvm_scripts_path/utility
|
8
8
|
source $rvm_scripts_path/selector
|
9
|
+
source $rvm_scripts_path/libraries
|
9
10
|
|
10
11
|
trap "rm -f $rvm_path/tmp/$$* > /dev/null 2>&1 ; exit" 0 1 2 3 15
|
11
12
|
|
@@ -20,9 +21,15 @@ __rvm_install_source() {
|
|
20
21
|
if [[ ! -z "$rvm_force_flag" ]] ; then rm -rf "$rvm_ruby_home" "$rvm_ruby_src_path" ; fi
|
21
22
|
|
22
23
|
result=0
|
23
|
-
__rvm_fetch_ruby
|
24
|
+
__rvm_fetch_ruby
|
25
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
26
|
+
$rvm_scripts_path/log "error" "There has been an error fetching the ruby interpreter. Aborting the installation." ; __rvm_pushpop ; return $result
|
27
|
+
fi
|
24
28
|
|
25
|
-
builtin cd $rvm_ruby_src_path
|
29
|
+
builtin cd $rvm_ruby_src_path
|
30
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
31
|
+
$rvm_scripts_path/log "error" "There has been an error, source directory is missing. Did the download or extraction fail? Aborting the installation." ; __rvm_pushpop ; return $result
|
32
|
+
fi
|
26
33
|
|
27
34
|
if [[ -d "${rvm_path}/usr/bin" ]] ; then export PATH="${rvm_path}/usr/bin:${PATH}" ; fi
|
28
35
|
|
@@ -30,14 +37,14 @@ __rvm_install_source() {
|
|
30
37
|
if which autoconf &> /dev/null ; then
|
31
38
|
__rvm_run "autoconf" "autoconf" "Running autoconf"
|
32
39
|
else
|
33
|
-
$rvm_scripts_path/log "fail" "rvm
|
40
|
+
result=$? ; $rvm_scripts_path/log "fail" "rvm requires autoconf to install the selected ruby interpreter however autoconf was not found in the PATH." ; return $result
|
34
41
|
fi
|
35
42
|
fi
|
36
43
|
|
37
44
|
if [[ "1.8.5" = "$rvm_ruby_version" ]] ; then
|
38
45
|
# How to install ruby 1.8.5... "sneaky sneaky, sir"
|
39
|
-
if [[ ! -d "$HOME/.rvm/src/ruby-1.8.7-p248/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p248
|
40
|
-
if [[ ! -d "$HOME/.rvm/src/ruby-1.8.6-p383/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p383
|
46
|
+
if [[ ! -d "$HOME/.rvm/src/ruby-1.8.7-p248/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p248 > /dev/null ; fi
|
47
|
+
if [[ ! -d "$HOME/.rvm/src/ruby-1.8.6-p383/ext/openssl/" ]] ; then $rvm_path/bin/rvm fetch 1.8.6-p383 > /dev/null ; fi
|
41
48
|
cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/extconf.rb ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
|
42
49
|
cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/openssl_missing.* ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
|
43
50
|
cp ~/.rvm/src/ruby-1.8.7-p248/ext/openssl/ossl_hmac.c ~/.rvm/src/ruby-1.8.5-p231/ext/openssl/
|
@@ -47,9 +54,15 @@ __rvm_install_source() {
|
|
47
54
|
if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
|
48
55
|
(($rvm_debug_flag)) && $rvm_scripts_path/log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
|
49
56
|
elif [[ ! -z "$rvm_ruby_configure" ]] ; then
|
50
|
-
__rvm_run "configure" "$rvm_ruby_configure"
|
57
|
+
__rvm_run "configure" "$rvm_ruby_configure"
|
58
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
59
|
+
$rvm_scripts_path/log "error" "There has been an error while configuring. Aborting the installation." ; __rvm_pushpop ; return $result
|
60
|
+
fi
|
51
61
|
elif [[ -s ./configure ]] ; then
|
52
|
-
__rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags $configure_parameters" "Configuring $rvm_ruby_string, this may take a while depending on your cpu(s)..."
|
62
|
+
__rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags $configure_parameters" "Configuring $rvm_ruby_string, this may take a while depending on your cpu(s)..."
|
63
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
64
|
+
$rvm_scripts_path/log "error" "There has been an error while running configure. Aborting the installation." ; __rvm_pushpop ; return $result
|
65
|
+
fi
|
53
66
|
unset configure_parameters
|
54
67
|
else
|
55
68
|
$rvm_scripts_path/log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
|
@@ -62,10 +75,16 @@ __rvm_install_source() {
|
|
62
75
|
fi
|
63
76
|
|
64
77
|
rvm_ruby_make=${rvm_ruby_make:-"make"}
|
65
|
-
__rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while, depending on your cpu(s)..."
|
78
|
+
__rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while, depending on your cpu(s)..."
|
79
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
80
|
+
$rvm_scripts_path/log "error" "There has been an error while running make. Aborting the installation." ; __rvm_pushpop ; return $result
|
81
|
+
fi
|
66
82
|
|
67
83
|
rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
|
68
|
-
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string"
|
84
|
+
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string"
|
85
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
86
|
+
$rvm_scripts_path/log "error" "There has been an error while running make install. Aborting the installation." ; __rvm_pushpop ; return $result
|
87
|
+
fi
|
69
88
|
|
70
89
|
$rvm_scripts_path/log "info" "Installation of $rvm_ruby_string is complete."
|
71
90
|
|
@@ -88,7 +107,7 @@ __rvm_install_ruby() {
|
|
88
107
|
macruby)
|
89
108
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
90
109
|
if [[ "$rvm_head_flag" = 1 ]] ; then
|
91
|
-
__rvm_install_llvm
|
110
|
+
if [[ ! -z "$rvm_llvm_flag" ]] ; then __rvm_install_llvm ; fi
|
92
111
|
macruby_path="/usr/local/bin"
|
93
112
|
# TODO: configure & make variables should be set here.
|
94
113
|
rvm_ruby_configure=" true "
|
@@ -97,12 +116,19 @@ __rvm_install_ruby() {
|
|
97
116
|
__rvm_db "${rvm_ruby_interpreter}_repo_url" "rvm_url"
|
98
117
|
rvm_ruby_repo_url=$rvm_url
|
99
118
|
__rvm_install_source $*
|
119
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
120
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to install from source. Aborting the installation." ; return $result
|
121
|
+
fi
|
100
122
|
else # if [[ "nightly" = "$rvm_ruby_version" ]] ; then
|
101
123
|
macruby_path="/usr/local/bin"
|
102
124
|
# TODO: Separated nightly from head.
|
103
125
|
__rvm_db "macruby_nightly_url" "rvm_url"
|
104
126
|
$rvm_scripts_path/log "info" "Retrieving the latest nightly macruby build..."
|
105
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
127
|
+
$rvm_scripts_path/fetch "$rvm_url"
|
128
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
129
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
130
|
+
fi
|
131
|
+
|
106
132
|
mv "$rvm_archives_path/macruby_nightly-latest.pkg" "$rvm_archives_path/macruby_nightly.pkg"
|
107
133
|
__rvm_run "macruby/extract" "sudo installer -pkg '$rvm_path/archives/macruby_nightly.pkg' -target '/'"
|
108
134
|
mkdir -p "$rvm_ruby_home/bin"
|
@@ -122,8 +148,7 @@ PATH="$rvm_ruby_home/bin:$rvm_ruby_gem_home/bin:\$PATH" ; export PATH
|
|
122
148
|
exec $macruby_path/mac$binary_name $prefix "\$@"
|
123
149
|
RubyWrapper
|
124
150
|
)
|
125
|
-
|
126
|
-
for file_name in $(echo $files) ; do
|
151
|
+
for file_name in "$rvm_ruby_home/bin/$binary_name" "$rvm_path/bin/$binary_name-$rvm_ruby_string" ; do
|
127
152
|
rm -f $file_name
|
128
153
|
echo "$ruby_wrapper" > $file_name
|
129
154
|
if [[ -f $file_name ]] ; then chmod +x $file_name ; fi
|
@@ -145,9 +170,17 @@ RubyWrapper
|
|
145
170
|
$rvm_scripts_path/log "It appears that the archive has already been extracted. Skipping extract (use --force to force re-download and extract)."
|
146
171
|
else
|
147
172
|
$rvm_scripts_path/log "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..."
|
148
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
173
|
+
$rvm_scripts_path/fetch "$rvm_url"
|
174
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
175
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
176
|
+
fi
|
177
|
+
|
149
178
|
rm -rf "$rvm_ruby_src_path"
|
150
|
-
__rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_file..."
|
179
|
+
__rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.tar.gz -C $rvm_src_path" "Extracting $rvm_ruby_package_file..."
|
180
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
181
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
182
|
+
fi
|
183
|
+
|
151
184
|
mv "$rvm_src_path/$rvm_ruby_package_file" "$rvm_ruby_src_path"
|
152
185
|
fi
|
153
186
|
builtin cd "$rvm_ruby_src_path"
|
@@ -162,7 +195,11 @@ RubyWrapper
|
|
162
195
|
rvm_ree_options="${rvm_ree_options} --no-tcmalloc"
|
163
196
|
fi
|
164
197
|
|
165
|
-
__rvm_run "install" "./installer -a $rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level $rvm_ree_options --dont-install-useful-gems $rvm_ruby_configure_flags" "Installing $rvm_ruby_string, this may take a while, depending on your cpu(s)..."
|
198
|
+
__rvm_run "install" "./installer -a $rvm_path/$rvm_ruby_interpreter-$rvm_ruby_version-$rvm_ruby_patch_level $rvm_ree_options --dont-install-useful-gems $rvm_ruby_configure_flags" "Installing $rvm_ruby_string, this may take a while, depending on your cpu(s)..."
|
199
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
200
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to run the ree installer. Aborting the installation." ; __rvm_pushpop ; return $result
|
201
|
+
fi
|
202
|
+
|
166
203
|
chmod +x $rvm_ruby_home/bin/*
|
167
204
|
|
168
205
|
__rvm_rubygems_setup
|
@@ -207,9 +244,15 @@ RubyWrapper
|
|
207
244
|
if [[ ! -z "$(echo $rvm_ruby_version | awk '/^1\.0/')" ]] && [[ -z "$rvm_head_flag" ]] ; then
|
208
245
|
if [[ ! -f "$rvm_archives_path/$rvm_ruby_package_file.tar.gz" ]] ; then
|
209
246
|
$rvm_scripts_path/log "info" "Downloading $rvm_ruby_file, this may take a while depending on your connection..."
|
210
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
247
|
+
$rvm_scripts_path/fetch "$rvm_url"
|
248
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
249
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
250
|
+
fi
|
211
251
|
fi
|
212
|
-
__rvm_run "extract" "tar xzf $rvm_archives_path/$(basename $rvm_url) -C $rvm_src_path" "Extracting $(basename $rvm_url) ..."
|
252
|
+
__rvm_run "extract" "tar xzf $rvm_archives_path/$(basename $rvm_url) -C $rvm_src_path" "Extracting $(basename $rvm_url) ..."
|
253
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
254
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
255
|
+
fi
|
213
256
|
mv "$rvm_src_path/rubinius-$rvm_ruby_version-${rvm_ruby_patch_level/^p//}" $rvm_ruby_src_path
|
214
257
|
else
|
215
258
|
__rvm_db "rubinius_repo_url" "rvm_ruby_repo_url"
|
@@ -222,6 +265,9 @@ RubyWrapper
|
|
222
265
|
builtin cd "$rvm_ruby_src_path"
|
223
266
|
__rvm_run "rbx.repo" "git pull origin master" "Pulling from origin master"
|
224
267
|
fi
|
268
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
269
|
+
$rvm_scripts_path/log "error" "There has been an error while fetching the rbx git repo. Aborting the installation." ; __rvm_pushpop ; return $result
|
270
|
+
fi
|
225
271
|
fi
|
226
272
|
|
227
273
|
#if [[ ! -x "$rvm_ruby_distclean" ]] ; then
|
@@ -231,14 +277,17 @@ RubyWrapper
|
|
231
277
|
builtin cd "$rvm_ruby_src_path"
|
232
278
|
chmod +x ./configure
|
233
279
|
rvm_ruby_configure="./configure --prefix=$rvm_ruby_home" ; message="Configuring rbx"
|
234
|
-
|
235
|
-
|
236
|
-
rvm_ruby_configure="$rvm_ruby_configure --disable-llvm" ; message="$message with LLVM disabled"
|
280
|
+
if [[ "$rvm_llvm_flag" = "0" ]] ; then
|
281
|
+
rvm_ruby_configure="$rvm_ruby_configure --disable-llvm"
|
237
282
|
else
|
238
|
-
|
283
|
+
if [[ "$rvm_ruby_patch_level" = "rc1" ]] ; then
|
284
|
+
rvm_ruby_configure="$rvm_ruby_configure --enable-llvm"
|
285
|
+
fi
|
239
286
|
fi
|
240
|
-
|
241
287
|
__rvm_run "configure" "$rvm_ruby_configure" "$message"
|
288
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
289
|
+
$rvm_scripts_path/log "error" "There has been an error while running '$rvm_ruby_configure'. Aborting the installation." ; __rvm_pushpop ; return $result
|
290
|
+
fi
|
242
291
|
|
243
292
|
if [[ "$rvm_trace_flag" -eq 1 ]] ; then
|
244
293
|
rvm_ruby_make="$rvm_bin_path/rvm 1.8.7 rake install --trace" ; message="Compiling rbx"
|
@@ -246,6 +295,9 @@ RubyWrapper
|
|
246
295
|
rvm_ruby_make="$rvm_bin_path/rvm 1.8.7 rake install" ; message="Compiling rbx"
|
247
296
|
fi
|
248
297
|
__rvm_run "rake" "$rvm_ruby_make" "$message"
|
298
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
299
|
+
$rvm_scripts_path/log "error" "There has been an error while running '$rvm_ruby_configure'. Aborting the installation." ; __rvm_pushpop ; return $result
|
300
|
+
fi
|
249
301
|
|
250
302
|
binaries="ruby irb" # Trick to work in more shells :)
|
251
303
|
for binary_name in $(echo $binaries) ; do
|
@@ -288,9 +340,10 @@ RubyWrapper
|
|
288
340
|
|
289
341
|
mkdir -p "$rvm_ruby_log_path" "$rvm_ruby_src_path"
|
290
342
|
__rvm_pushpop $rvm_src_path
|
291
|
-
__rvm_fetch_ruby
|
292
|
-
|
293
|
-
|
343
|
+
__rvm_fetch_ruby
|
344
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
345
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
346
|
+
fi
|
294
347
|
|
295
348
|
builtin cd "$rvm_ruby_src_path"
|
296
349
|
if [[ ! -z "$rvm_head_flag" ]] ; then __rvm_run "ant.dist" "ant dist" "Running 'ant dist' (this could take a few minutes) ..." ; fi
|
@@ -331,7 +384,7 @@ RubyWrapper
|
|
331
384
|
|
332
385
|
if [[ "$rvm_head_flag" = 1 ]] ; then
|
333
386
|
mono_version="$(mono -V | head -n 1 | cut -d ' ' -f5)"
|
334
|
-
if
|
387
|
+
if $rvm_scripts_path/match "$mono_version" "([0-9]+)\.([0-9]+)\.?([0-9]+)?" ; then
|
335
388
|
if [[ ${BASH_REMATCH[1]} -lt 2 ]] || ( [[ ${BASH_REMATCH[1]} -eq 2 ]] && [[ ${BASH_REMATCH[2]} -lt 6 ]] ) ; then
|
336
389
|
echo -e "Mono 2.6 (or greater) must be installed and in your path in order to build IronRuby from the repository."
|
337
390
|
echo -e "Version detected: ${BASH_REMATCH[0]}"
|
@@ -360,10 +413,15 @@ RubyWrapper
|
|
360
413
|
cp -r $rvm_ruby_src_path/ruby_home/lib/IronRuby
|
361
414
|
else
|
362
415
|
$rvm_scripts_path/log "info" "Retrieving IronRuby"
|
363
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
416
|
+
$rvm_scripts_path/fetch "$rvm_url"
|
417
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
418
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
419
|
+
fi
|
364
420
|
|
365
421
|
__rvm_run "extract" "unzip $rvm_archives_path/$rvm_ruby_package_file ironruby/bin/* ironruby/lib/* -d $rvm_ruby_home" "Extracting $rvm_ruby_package_file ..."
|
366
|
-
if [[
|
422
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
423
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
424
|
+
fi
|
367
425
|
|
368
426
|
mv $rvm_ruby_home/ironruby/* $rvm_ruby_home
|
369
427
|
rm -rf $rvm_ruby_home/ironruby
|
@@ -420,25 +478,38 @@ RubyWrapper
|
|
420
478
|
if which autoconf &> /dev/null ; then
|
421
479
|
__rvm_run "autoconf" "autoconf" "Running autoconf"
|
422
480
|
else
|
423
|
-
$rvm_scripts_path/log "fail" "rvm expects autoconf" ; result=$? ; return $result
|
481
|
+
$rvm_scripts_path/log "fail" "rvm expects autoconf to install this ruby interpreter, autoconf was not found in PATH. Aborting installation." ; result=$? ; return $result
|
424
482
|
fi
|
425
483
|
fi
|
426
484
|
|
427
485
|
if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
|
428
486
|
(($rvm_debug_flag)) && $rvm_scripts_path/log "debug" "Skipping configure step, Makefile exists so configure must have already been run."
|
429
487
|
elif [[ ! -z "$rvm_ruby_configure" ]] ; then
|
430
|
-
__rvm_run "configure" "$rvm_ruby_configure"
|
488
|
+
__rvm_run "configure" "$rvm_ruby_configure"
|
489
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
490
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
491
|
+
fi
|
492
|
+
|
431
493
|
elif [[ -s ./configure ]] ; then
|
432
|
-
__rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags" "Configuring $rvm_ruby_string using $rvm_ruby_configure_flags, this may take a while depending on your cpu(s)..."
|
494
|
+
__rvm_run "configure" "./configure --prefix=$rvm_ruby_home $rvm_ruby_configure_flags" "Configuring $rvm_ruby_string using $rvm_ruby_configure_flags, this may take a while depending on your cpu(s)..."
|
495
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
496
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to configure the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
497
|
+
fi
|
433
498
|
else
|
434
499
|
$rvm_scripts_path/log "error" "Skipping configure step, 'configure' script does not exist, did autoconf not run successfully?"
|
435
500
|
fi
|
436
501
|
|
437
502
|
rvm_ruby_make=${rvm_ruby_make:-"make"}
|
438
|
-
__rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while, depending on your cpu(s)..."
|
503
|
+
__rvm_run "make" "$rvm_ruby_make $rvm_make_flags" "Compiling $rvm_ruby_string, this may take a while, depending on your cpu(s)..."
|
504
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
505
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to run make. Aborting the installation." ; __rvm_pushpop ; return $result
|
506
|
+
fi
|
439
507
|
|
440
508
|
rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
|
441
|
-
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string"
|
509
|
+
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string"
|
510
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
511
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to run make install. Aborting the installation." ; __rvm_pushpop ; return $result
|
512
|
+
fi
|
442
513
|
|
443
514
|
$rvm_scripts_path/log "info" "Installation of $rvm_ruby_string is complete."
|
444
515
|
|
@@ -486,26 +557,43 @@ __rvm_fetch_ruby() {
|
|
486
557
|
rvm_url="$(__rvm_db "${rvm_ruby_interpreter}_url")/$rvm_ruby_package_file.$rvm_archive_extension"
|
487
558
|
fi
|
488
559
|
$rvm_scripts_path/log "info" "Downloading $rvm_ruby_package_file, this may take a while depending on your connection..."
|
489
|
-
$rvm_scripts_path/fetch "$rvm_url"
|
560
|
+
$rvm_scripts_path/fetch "$rvm_url"
|
561
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
562
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
563
|
+
fi
|
564
|
+
|
490
565
|
fi
|
491
|
-
__rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..."
|
566
|
+
__rvm_run "extract" "tar xzf $rvm_archives_path/$rvm_ruby_package_file.$rvm_archive_extension -C $rvm_src_path" "Extracting $rvm_ruby_package_file ..."
|
567
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
568
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to extract the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
569
|
+
fi
|
570
|
+
|
492
571
|
else
|
493
572
|
if [[ ! -z "$(echo $rvm_url | awk '/^git/')" ]] ; then
|
494
573
|
if [[ -d "$rvm_ruby_src_path/.git" ]] ; then
|
495
574
|
builtin cd $rvm_ruby_src_path
|
496
575
|
if [[ -z "$rvm_ruby_revision" ]] ; then
|
497
576
|
$rvm_scripts_path/log "info" "Pulling from $rvm_ruby_repo_url, this may take a while depending on your connection..."
|
498
|
-
git pull origin master
|
577
|
+
git pull origin master
|
578
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
579
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to update the source from the remote repository. Aborting the installation." ; __rvm_pushpop ; return $result
|
580
|
+
fi
|
499
581
|
else
|
500
582
|
if [[ -z "$rvm_ruby_sha" ]] ; then
|
501
583
|
git checkout HEAD
|
502
584
|
else
|
503
585
|
git checkout $(echo $rvm_ruby_sha | sed 's#^s##')
|
504
|
-
fi
|
586
|
+
fi
|
587
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
588
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to checkout the source branch. Aborting the installation." ; __rvm_pushpop ; return $result
|
589
|
+
fi
|
505
590
|
fi
|
506
591
|
else
|
507
592
|
$rvm_scripts_path/log "info" "Cloning from $rvm_ruby_repo_url, this may take a while depending on your connection..."
|
508
|
-
git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path
|
593
|
+
git clone --depth 1 $rvm_ruby_repo_url $rvm_ruby_src_path
|
594
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
595
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the repository. Aborting the installation." ; __rvm_pushpop ; return $result
|
596
|
+
fi
|
509
597
|
fi
|
510
598
|
else
|
511
599
|
if [[ ! -z "$rvm_head_flag" ]] || [[ "trunk" = "$rvm_ruby_revision" ]] ; then
|
@@ -515,6 +603,9 @@ __rvm_fetch_ruby() {
|
|
515
603
|
# TODO: Check if tag v is valid
|
516
604
|
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/tags/$(echo $rvm_ruby_tag | sed 's/^t//')"}"
|
517
605
|
rvm_rev=""
|
606
|
+
elif [[ "$rvm_major_version.$rvm_minor_version" = "8.8" ]] ; then
|
607
|
+
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/branches/ruby_1_${rvm_major_version}"}"
|
608
|
+
rvm_rev="-$rvm_ruby_revision"
|
518
609
|
else
|
519
610
|
rvm_url="${rvm_url:-"$rvm_ruby_repo_url/branches/ruby_1_${rvm_major_version}_${rvm_minor_version}"}"
|
520
611
|
rvm_rev="-$rvm_ruby_revision"
|
@@ -531,7 +622,11 @@ __rvm_fetch_ruby() {
|
|
531
622
|
else
|
532
623
|
rm -rf $rvm_ruby_src_path
|
533
624
|
__rvm_run "svn.checkout" "svn checkout -q ${rvm_rev/-r/-r } $rvm_url $rvm_ruby_src_path"
|
534
|
-
fi
|
625
|
+
fi
|
626
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
627
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch / update the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
628
|
+
fi
|
629
|
+
|
535
630
|
fi
|
536
631
|
fi
|
537
632
|
}
|
@@ -631,7 +726,10 @@ __rvm_rubygems_setup() {
|
|
631
726
|
if [[ ! -f "$rvm_src_path/$rvm_gem_package_name/setup.rb" ]]; then rm -rf "$rvm_src_path/$rvm_gem_package_name" ; fi
|
632
727
|
if [[ ! -d "$rvm_src_path/$rvm_gem_package_name" ]] ; then
|
633
728
|
$rvm_scripts_path/log "info" "Retrieving $rvm_gem_package_name"
|
634
|
-
$rvm_scripts_path/fetch "$rvm_gem_url"
|
729
|
+
$rvm_scripts_path/fetch "$rvm_gem_url"
|
730
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then
|
731
|
+
$rvm_scripts_path/log "error" "There has been an error while trying to fetch the source. Aborting the installation." ; __rvm_pushpop ; return $result
|
732
|
+
fi
|
635
733
|
mkdir -p "$rvm_src_path/$rvm_gem_package_name"
|
636
734
|
__rvm_run "rubygems.extract" "tar zxf $rvm_archives_path/$rvm_gem_package_name.tgz -C $rvm_src_path" "Extracting $rvm_gem_package_name"
|
637
735
|
fi
|
data/scripts/rvm
CHANGED
@@ -26,6 +26,7 @@ if [[ "$rvm_loaded_flag" != "1" ]] || [[ "$rvm_reload_flag" = "1" ]] ; then
|
|
26
26
|
source $rvm_path/scripts/array
|
27
27
|
source $rvm_path/scripts/utility
|
28
28
|
source $rvm_path/scripts/initialize
|
29
|
+
source $rvm_scripts_path/version
|
29
30
|
source $rvm_path/scripts/selector
|
30
31
|
source $rvm_path/scripts/cli
|
31
32
|
#source $rvm_path/scripts/gems
|
data/scripts/rvm-install
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
|
3
|
+
unset rvm_auto_flag
|
4
|
+
|
5
|
+
source scripts/version
|
6
|
+
source scripts/utility
|
7
|
+
|
8
|
+
usage() {
|
9
|
+
echo -e "
|
10
|
+
Usage:
|
11
|
+
${0} <options>
|
12
|
+
|
13
|
+
Options:
|
14
|
+
--auto : Automatically update shell profile files.
|
15
|
+
--prefix : Installation prefix directory.
|
16
|
+
--help : Display help/usage (this) message
|
17
|
+
--version : display rvm package version
|
18
|
+
"
|
19
|
+
}
|
20
|
+
|
21
|
+
while [[ $# -gt 0 ]] ; do
|
22
|
+
token="$1" ; shift
|
23
|
+
case "$token" in
|
24
|
+
--auto) rvm_auto_flag=1 ;;
|
25
|
+
--prefix) prefix_path="$1" ; shift ;;
|
26
|
+
--version) rvm_path="$(pwd)" ; __rvm_version ; unset rvm_path ; exit ;;
|
27
|
+
--help|*) usage ;;
|
28
|
+
esac
|
29
|
+
done
|
4
30
|
|
5
31
|
if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
|
6
32
|
if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
|
@@ -14,7 +40,6 @@ if ! [[ "$rvm_path" =~ /rvm/?$ ]] ; then
|
|
14
40
|
fi
|
15
41
|
fi
|
16
42
|
|
17
|
-
source scripts/utility
|
18
43
|
source scripts/initialize
|
19
44
|
|
20
45
|
__rvm_initialize
|
@@ -25,16 +50,16 @@ __rvm_initialize
|
|
25
50
|
item="$(tput setaf 2)* $(tput sgr0)"
|
26
51
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
27
52
|
cwd=$(pwd)
|
28
|
-
|
29
|
-
if [[ ! -d "$
|
30
|
-
|
53
|
+
source_path="${source_path:-"$(dirname $0 | xargs dirname)"}"
|
54
|
+
if [[ ! -d "$source_path" ]] ; then unset source_path ; fi
|
55
|
+
source_path="${source_path:-$cwd}"
|
31
56
|
|
32
57
|
# State what is required to use rvm
|
33
58
|
echo -e "\nInstalling rvm to $rvm_path/ ..."
|
34
59
|
for dir_name in src scripts bin log archives config gems examples ; do
|
35
60
|
mkdir -p "$rvm_path/$dir_name"
|
36
61
|
done
|
37
|
-
cp -f "$
|
62
|
+
cp -f "$source_path/README" "$rvm_path/"
|
38
63
|
|
39
64
|
#
|
40
65
|
# Scripts
|
@@ -42,8 +67,8 @@ cp -f "$source_dir/README" "$rvm_path/"
|
|
42
67
|
rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
|
43
68
|
for dir_name in config scripts examples lib hooks ; do
|
44
69
|
mkdir -p "$rvm_path/$dir_name"
|
45
|
-
if [[ -d "$
|
46
|
-
cp -Rf "$
|
70
|
+
if [[ -d "$source_path/$dir_name" ]] ; then
|
71
|
+
cp -Rf "$source_path/$dir_name" "$rvm_path"
|
47
72
|
fi
|
48
73
|
done ; unset dir_name
|
49
74
|
|
@@ -57,7 +82,7 @@ fi
|
|
57
82
|
# Cleanse and purge...
|
58
83
|
rm -f $rvm_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
|
59
84
|
for file in rvm-prompt rvm rvmsudo ; do
|
60
|
-
cp -f "$
|
85
|
+
cp -f "$source_path/binscripts/$file" $rvm_path/bin/
|
61
86
|
done
|
62
87
|
chmod +x $rvm_path/bin/*
|
63
88
|
|
@@ -83,6 +108,15 @@ if [[ ! -z "$rvm_auto_flag" ]] ; then
|
|
83
108
|
fi
|
84
109
|
fi
|
85
110
|
|
111
|
+
#
|
112
|
+
# TODO: Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/
|
113
|
+
#
|
114
|
+
#rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
|
115
|
+
#mkdir -p $rvm_rubies_path
|
116
|
+
#for ruby in "$rvm_path"/ruby-* "$rvm_path"/jruby-* "$rvm_path"/mput-* "$rvm_path"/rbx-* ; do
|
117
|
+
# if [[ -d "$ruby" ]] ; then mv "$ruby" "$rvm_rubies_path" ; fi
|
118
|
+
#done
|
119
|
+
|
86
120
|
if [[ "root" = "$(whoami)" ]] ; then
|
87
121
|
echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
|
88
122
|
mkdir -p $rvm_symlink_path
|
@@ -107,13 +141,15 @@ echo -e "If I do not respond right away, please hang around after asking your qu
|
|
107
141
|
echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
|
108
142
|
echo -e "\n ~ Wayne\n"
|
109
143
|
echo "================================================================================"
|
110
|
-
|
144
|
+
echo -e "Upgrades"
|
145
|
+
echo -e "Gems are now per interpreter installation instead of per interpreter/version"
|
146
|
+
echo -e "so for example to upgrade an older install of 1.8.6 and preserve gems:"
|
147
|
+
echo -e "rm -rf ~/.rvm/gems/ruby-1.8.6-p383 ; mv ~/.rvm/gems/ruby/1.8.6 ~/.rvm/gems/ruby-1.8.6-p383"
|
148
|
+
echo "================================================================================"
|
111
149
|
echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
|
112
|
-
echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bash_profile and
|
150
|
+
echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
|
113
151
|
echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
|
114
152
|
echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
|
115
153
|
echo -e "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
116
154
|
|
117
|
-
if [[ -x "$rvm_path/bin/rvm" ]] ; then "$rvm_path/bin/rvm" -v ; fi
|
118
|
-
|
119
155
|
exit 0
|
data/scripts/selector
CHANGED
@@ -52,7 +52,8 @@ __rvm_select() {
|
|
52
52
|
rvm_ruby_file="rubinius-$rvm_ruby_version-$rvm_ruby_patch_level"
|
53
53
|
else
|
54
54
|
unset rvm_ruby_patch_level
|
55
|
-
|
55
|
+
unset rvm_ruby_version
|
56
|
+
rvm_ruby_string="$rvm_ruby_interpreter-head"
|
56
57
|
fi
|
57
58
|
;;
|
58
59
|
|
@@ -157,7 +158,7 @@ __rvm_select() {
|
|
157
158
|
|
158
159
|
__rvm_gems_select
|
159
160
|
|
160
|
-
if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ "system" != "$rvm_ruby_interpreter" ]] ; then
|
161
|
+
if [[ ! -z "$rvm_ruby_interpreter" ]] && [[ "system" != "$rvm_ruby_interpreter" ]] && [[ "default" != "$rvm_ruby_interpreter" ]] ; then
|
161
162
|
if [[ ! -z "$rvm_ruby_version" ]] ; then
|
162
163
|
rvm_major_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $2 }')
|
163
164
|
rvm_minor_version=$(echo $rvm_ruby_version | awk -F'.' '{ print $3 }')
|
@@ -179,8 +180,7 @@ __rvm_select() {
|
|
179
180
|
|
180
181
|
export rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_url rvm_ruby_patch_level rvm_ruby_configure rvm_ruby_configure_flags rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_gem_set_name rvm_gem_path rvm_ruby_gem_home rvm_path rvm_src_path rvm_bin_path rvm_ruby_binary rvm_ruby_home rvm_log_path rvm_ruby_log_path rvm_src_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string
|
181
182
|
else
|
182
|
-
|
183
|
-
rvm_ruby_interpreter="system"
|
183
|
+
rvm_ruby_interpreter="${rvm_ruby_interpreter:-system}"
|
184
184
|
fi
|
185
185
|
}
|
186
186
|
|
@@ -194,8 +194,8 @@ __rvm_use() {
|
|
194
194
|
new_path=$rvm_bin_path:$new_path
|
195
195
|
|
196
196
|
if [[ -s $rvm_path/default ]] ; then
|
197
|
+
unset new_path
|
197
198
|
source $rvm_path/default
|
198
|
-
|
199
199
|
if [[ ! -z "$rvm_verbose_flag" ]] ; then
|
200
200
|
$rvm_scripts_path/log "info" "Now using default ruby."
|
201
201
|
fi
|
@@ -212,7 +212,7 @@ __rvm_use() {
|
|
212
212
|
new_path=$(echo $PATH | tr ':' '\n' | awk '$0 !~ /rvm/' | paste -sd : -)
|
213
213
|
new_path=$rvm_bin_path:$new_path
|
214
214
|
if [[ -s $rvm_path/system ]] ; then
|
215
|
-
grep "
|
215
|
+
grep "MY_RUBY_HOME='$rvm_path" "$rvm_path/system" > /dev/null
|
216
216
|
if [[ $? -eq 0 ]] ; then
|
217
217
|
rm -f $rvm_path/system # 'system' should *not* point to an rvm ruby.
|
218
218
|
else
|
@@ -275,16 +275,16 @@ __rvm_use() {
|
|
275
275
|
rm -f $rvm_path/default
|
276
276
|
rm -f $rvm_path/bin/default*
|
277
277
|
else
|
278
|
-
RUBY_VERSION="$($
|
278
|
+
RUBY_VERSION="$($rvm_ruby_home/bin/ruby -v | sed 's#^\(.*\) (.*$#\1#')"
|
279
279
|
export GEM_HOME GEM_PATH MY_RUBY_HOME RUBY_VERSION
|
280
280
|
|
281
|
-
echo "PATH
|
281
|
+
echo "export PATH=\"$rvm_ruby_home/bin:$rvm_ruby_gem_home/bin:$rvm_path/bin:\$PATH\"" > $rvm_path/default
|
282
282
|
|
283
|
-
for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gem_set_name; do
|
283
|
+
for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME IRBRC rvm_ruby_string rvm_gem_set_name ; do
|
284
284
|
eval "export $variable"
|
285
285
|
eval value=\$${variable}
|
286
286
|
if [[ ! -z "$value" ]] ; then
|
287
|
-
echo "${variable}='$value'
|
287
|
+
echo "export ${variable}='$value'" >> $rvm_path/default
|
288
288
|
else
|
289
289
|
echo "unset ${variable}" >> $rvm_path/default
|
290
290
|
fi
|
@@ -330,13 +330,15 @@ __rvm_ruby_string() {
|
|
330
330
|
if [[ "head" = "$string" ]] ; then
|
331
331
|
rvm_ruby_revision="head"
|
332
332
|
unset rvm_ruby_patch_level rvm_ruby_revision rvm_ruby_tag
|
333
|
-
rvm_head_flag=1
|
333
|
+
export rvm_head_flag=1
|
334
334
|
elif [[ "default" = "$string" ]] ; then
|
335
335
|
rvm_ruby_interpreter="default"
|
336
|
-
|
336
|
+
unset rvm_ruby_patch_level rvm_ruby_tag rvm_head_flag rvm_ruby_revision rvm_ruby_version rvm_gem_set_name
|
337
|
+
return
|
337
338
|
elif [[ "system" = "$string" ]] ; then
|
338
339
|
rvm_ruby_interpreter="system"
|
339
|
-
|
340
|
+
unset rvm_ruby_patch_level rvm_ruby_tag rvm_head_flag rvm_ruby_revision rvm_ruby_version rvm_gem_set_name
|
341
|
+
return
|
340
342
|
elif [[ "nightly" = "$string" ]] ; then
|
341
343
|
rvm_ruby_version="nightly"
|
342
344
|
rvm_nightly_flag=1
|
@@ -396,7 +398,7 @@ __rvm_ruby_string() {
|
|
396
398
|
fi
|
397
399
|
|
398
400
|
# Unspecified version
|
399
|
-
if [[ -z "$rvm_ruby_version" ]] ; then
|
401
|
+
if [[ -z "$rvm_ruby_version" ]] && [[ -z "$rvm_head_flag" ]]; then
|
400
402
|
rvm_ruby_version=${rvm_ruby_version:-"$(__rvm_db "${rvm_ruby_interpreter}_version")"}
|
401
403
|
fi
|
402
404
|
|
data/scripts/update
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
|
3
|
+
unset rvm_auto_flag
|
4
|
+
|
5
|
+
source scripts/version
|
6
|
+
source scripts/utility
|
7
|
+
|
8
|
+
usage() {
|
9
|
+
echo -e "
|
10
|
+
Usage:
|
11
|
+
${0} <options>
|
12
|
+
|
13
|
+
Options:
|
14
|
+
--auto : Automatically update shell profile files.
|
15
|
+
--prefix : Installation prefix directory.
|
16
|
+
--help : Display help/usage (this) message
|
17
|
+
--version : display rvm package version
|
18
|
+
"
|
19
|
+
}
|
20
|
+
|
21
|
+
while [[ $# -gt 0 ]] ; do
|
22
|
+
token="$1" ; shift
|
23
|
+
case "$token" in
|
24
|
+
--auto) rvm_auto_flag=1 ;;
|
25
|
+
--prefix) prefix_path="$1" ; shift ;;
|
26
|
+
--version) rvm_path="$(pwd)" ; __rvm_version ; unset rvm_path ; exit ;;
|
27
|
+
--help|*) usage ;;
|
28
|
+
esac
|
29
|
+
done
|
4
30
|
|
5
31
|
if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
|
6
32
|
if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
|
@@ -14,7 +40,6 @@ if ! [[ "$rvm_path" =~ /rvm/?$ ]] ; then
|
|
14
40
|
fi
|
15
41
|
fi
|
16
42
|
|
17
|
-
source scripts/utility
|
18
43
|
source scripts/initialize
|
19
44
|
|
20
45
|
__rvm_initialize
|
@@ -25,16 +50,16 @@ __rvm_initialize
|
|
25
50
|
item="$(tput setaf 2)* $(tput sgr0)"
|
26
51
|
question="\n$(tput setaf 2)<?>$(tput sgr0)"
|
27
52
|
cwd=$(pwd)
|
28
|
-
|
29
|
-
if [[ ! -d "$
|
30
|
-
|
53
|
+
source_path="${source_path:-"$(dirname $0 | xargs dirname)"}"
|
54
|
+
if [[ ! -d "$source_path" ]] ; then unset source_path ; fi
|
55
|
+
source_path="${source_path:-$cwd}"
|
31
56
|
|
32
57
|
# State what is required to use rvm
|
33
58
|
echo -e "\nInstalling rvm to $rvm_path/ ..."
|
34
59
|
for dir_name in src scripts bin log archives config gems examples ; do
|
35
60
|
mkdir -p "$rvm_path/$dir_name"
|
36
61
|
done
|
37
|
-
cp -f "$
|
62
|
+
cp -f "$source_path/README" "$rvm_path/"
|
38
63
|
|
39
64
|
#
|
40
65
|
# Scripts
|
@@ -42,8 +67,8 @@ cp -f "$source_dir/README" "$rvm_path/"
|
|
42
67
|
rm -rf $rvm_path/scripts # Clear the old scripts directory so that the old style rvm- scripts are cleared out.
|
43
68
|
for dir_name in config scripts examples lib hooks ; do
|
44
69
|
mkdir -p "$rvm_path/$dir_name"
|
45
|
-
if [[ -d "$
|
46
|
-
cp -Rf "$
|
70
|
+
if [[ -d "$source_path/$dir_name" ]] ; then
|
71
|
+
cp -Rf "$source_path/$dir_name" "$rvm_path"
|
47
72
|
fi
|
48
73
|
done ; unset dir_name
|
49
74
|
|
@@ -57,7 +82,7 @@ fi
|
|
57
82
|
# Cleanse and purge...
|
58
83
|
rm -f $rvm_path/bin/rvm ; rm -rf $rvm_path/bin/binscripts
|
59
84
|
for file in rvm-prompt rvm rvmsudo ; do
|
60
|
-
cp -f "$
|
85
|
+
cp -f "$source_path/binscripts/$file" $rvm_path/bin/
|
61
86
|
done
|
62
87
|
chmod +x $rvm_path/bin/*
|
63
88
|
|
@@ -83,6 +108,15 @@ if [[ ! -z "$rvm_auto_flag" ]] ; then
|
|
83
108
|
fi
|
84
109
|
fi
|
85
110
|
|
111
|
+
#
|
112
|
+
# TODO: Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/
|
113
|
+
#
|
114
|
+
#rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
|
115
|
+
#mkdir -p $rvm_rubies_path
|
116
|
+
#for ruby in "$rvm_path"/ruby-* "$rvm_path"/jruby-* "$rvm_path"/mput-* "$rvm_path"/rbx-* ; do
|
117
|
+
# if [[ -d "$ruby" ]] ; then mv "$ruby" "$rvm_rubies_path" ; fi
|
118
|
+
#done
|
119
|
+
|
86
120
|
if [[ "root" = "$(whoami)" ]] ; then
|
87
121
|
echo -e "\n Symlinking rvm to $rvm_symlink_path/rvm ..."
|
88
122
|
mkdir -p $rvm_symlink_path
|
@@ -107,13 +141,15 @@ echo -e "If I do not respond right away, please hang around after asking your qu
|
|
107
141
|
echo -e "\n w$(tput setaf 2)⦿‿⦿$(tput sgr0)t!"
|
108
142
|
echo -e "\n ~ Wayne\n"
|
109
143
|
echo "================================================================================"
|
110
|
-
|
144
|
+
echo -e "Upgrades"
|
145
|
+
echo -e "Gems are now per interpreter installation instead of per interpreter/version"
|
146
|
+
echo -e "so for example to upgrade an older install of 1.8.6 and preserve gems:"
|
147
|
+
echo -e "rm -rf ~/.rvm/gems/ruby-1.8.6-p383 ; mv ~/.rvm/gems/ruby/1.8.6 ~/.rvm/gems/ruby-1.8.6-p383"
|
148
|
+
echo "================================================================================"
|
111
149
|
echo -e "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
|
112
|
-
echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bash_profile and
|
150
|
+
echo -e "\n1) Place the folowing line at the end of your shell's loading files(.bashrc and then .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
|
113
151
|
echo -e "\n if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
|
114
152
|
echo -e "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."
|
115
153
|
echo -e "\n3) $(tput setaf 1)CLOSE THIS SHELL$(tput sgr0) and open a new one in order to use rvm.\n"
|
116
154
|
|
117
|
-
if [[ -x "$rvm_path/bin/rvm" ]] ; then "$rvm_path/bin/rvm" -v ; fi
|
118
|
-
|
119
155
|
exit 0
|
data/scripts/utility
CHANGED
@@ -134,7 +134,7 @@ __rvm_run() {
|
|
134
134
|
|
135
135
|
__rvm_cleanup_variables() {
|
136
136
|
__rvm_unset_ruby_variables
|
137
|
-
unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag
|
137
|
+
unset rvm_action rvm_irbrc_file rvm_command rvm_error_message rvm_gem_set_name rvm_url rvm_force_flag rvm_all_flag rvm_reconfigure_flag rvm_make_flags rvm_bin_flag rvm_load_flag rvm_dump_flag rvm_self_flag rvm_gem_flag rvm_rubygems_flag rvm_debug_flag rvm_delete_flag rvm_summary_flag rvm_test_flag _rvm_spec_flag rvm_json_flag rvm_yaml_flag rvm_shebang_flag rvm_env_flag rvm_tail_flag rvm_use_flag rvm_dir_flag rvm_list_flag rvm_empty_flag rvm_file_name rvm_benchmark_flag rvm_clear_flag rvm_name_flag rvm_verbose_flag rvm_user_flag rvm_system_flag rvm_ruby_configure_flags rvm_uninstall_flag rvm_install_flag rvm_llvm_flag
|
138
138
|
}
|
139
139
|
|
140
140
|
__rvm_unset_ruby_variables() {
|
@@ -279,7 +279,7 @@ __rvm_list() {
|
|
279
279
|
done < <(svn list http://svn.ruby-lang.org/repos/ruby/tags/ | awk '/^v1_[8|9]/')
|
280
280
|
echo -e "(ruby-)1.8.6(-p383)\n(ruby-)1.8.6-head\n(ruby-)1.8.7(-p248)\n(ruby-)1.8.7-head\n(ruby-)1.9.1(-p243)\n(ruby-)1.9.1(-p376)\n(ruby-)1.9.1-head\n(ruby-)1.9.2-preview1"
|
281
281
|
echo -e "jruby-1.2.0\njruby-1.3.0\njruby-1.3.1\njruby(-1.4.0) # the default\njruby-head"
|
282
|
-
echo -e "rbx(-
|
282
|
+
echo -e "rbx(-prc1) # default\nrbx-head"
|
283
283
|
echo -e "ree-1.8.6\nree(-1.8.7) # the default\nree-1.8.6-head\nree-1.8.7-head"
|
284
284
|
echo -e "mput(-head) # shyouhei head, the default mput"
|
285
285
|
echo -e "ironruby-0.9.3 # (1.0 RC1)\nironruby-head"
|
@@ -307,7 +307,7 @@ __rvm_list() {
|
|
307
307
|
done ; unset version
|
308
308
|
|
309
309
|
if [[ -f "$rvm_path/default" ]] && [[ -s $rvm_path/default ]] ; then
|
310
|
-
version=$(grep '
|
310
|
+
version=$(grep 'MY_RUBY_HOME' $rvm_path/default | awk -F"'" '{print $2}' | xargs basename)
|
311
311
|
if [[ ! -z "$version" ]] ; then
|
312
312
|
string="[ $(file $rvm_path/$version/bin/ruby | awk '/x86.64/ {print "x86_64"} /386/ {print "i386"} /ppc/ {print "ppc"}' | tr "\n" ' ')]"
|
313
313
|
if [[ "$version" = "$current_ruby" ]] ; then
|
@@ -667,12 +667,15 @@ __rvm_gems_select() {
|
|
667
667
|
if [[ -z "$(which gem 2>/dev/null)" ]] ; then return 0 ; fi
|
668
668
|
|
669
669
|
if [[ -z "$rvm_gem_set_name" ]] ; then
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
670
|
+
# No longer defaulting to 'sticky' gem sets.
|
671
|
+
# Set 'rvm_sticky_gemsets=1' in ~/.rvmrc to enable.
|
672
|
+
if [[ ! -z "$rvm_sticky_gemsets" ]] ; then
|
673
|
+
if [[ ! -z "$GEM_HOME" ]] ; then
|
674
|
+
rvm_gem_set_name=$(echo $GEM_HOME | xargs basename | awk -F'%' '{print $2}')
|
675
|
+
fi
|
676
|
+
if [[ ! -z "$rvm_ruby_gem_home" ]] ; then
|
677
|
+
rvm_gem_set_name=$(echo $rvm_ruby_gem_home | xargs basename | awk -F'%' '{print $2}')
|
678
|
+
fi
|
676
679
|
fi
|
677
680
|
|
678
681
|
if [[ ! -z "$rvm_gem_set_name" ]] && ! $rvm_scripts_path/match "$rvm_gem_set_name" "^[0-9]\.[0-9]" ; then
|
@@ -705,9 +708,3 @@ __rvm_gems_use() {
|
|
705
708
|
fi
|
706
709
|
}
|
707
710
|
|
708
|
-
__rvm_gems_clear() {
|
709
|
-
unset rvm_ruby_gem_home rvm_gem_set_name GEM_HOME GEM_PATH
|
710
|
-
__rvm_gems_select
|
711
|
-
__rvm_gems_use
|
712
|
-
}
|
713
|
-
|
data/scripts/version
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
__rvm_meta() {
|
4
|
+
rvm_meta_author="Wayne E. Seguin"
|
5
|
+
rvm_meta_author_email="wayneeseguin@gmail.com"
|
6
|
+
rvm_meta_website="http://rvm.beginrescueend.com/"
|
7
|
+
rvm_meta_version="${rvm_version}"
|
8
|
+
}
|
9
|
+
|
10
|
+
__rvm_version() {
|
11
|
+
__rvm_meta
|
12
|
+
echo -e "\nrvm ${rvm_meta_version} by ${rvm_meta_author} (${rvm_meta_author_email}) [${rvm_meta_website}]\n"
|
13
|
+
}
|
14
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.999
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wayne E. Seguin
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-01-07 00:00:00 -05:00
|
13
13
|
default_executable: rvm-install
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- scripts/symlink
|
68
68
|
- scripts/update
|
69
69
|
- scripts/utility
|
70
|
+
- scripts/version
|
70
71
|
has_rdoc: true
|
71
72
|
homepage: http://github.com/wayneeseguin/rvm
|
72
73
|
licenses: []
|