rvm 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/migrate
CHANGED
@@ -4,7 +4,8 @@ unset GREP_OPTIONS
|
|
4
4
|
|
5
5
|
source "$rvm_path/scripts/base"
|
6
6
|
|
7
|
-
usage()
|
7
|
+
usage()
|
8
|
+
{
|
8
9
|
printf "
|
9
10
|
|
10
11
|
Usage:
|
@@ -18,7 +19,8 @@ usage() {
|
|
18
19
|
" >&2
|
19
20
|
}
|
20
21
|
|
21
|
-
confirm()
|
22
|
+
confirm()
|
23
|
+
{
|
22
24
|
local confirmation_response
|
23
25
|
|
24
26
|
printf "$1 (Y/n): "
|
@@ -28,16 +30,20 @@ confirm() {
|
|
28
30
|
[[ -z "$confirmation_response" ]] || echo "$confirmation_response" | \grep -qi '^y'
|
29
31
|
}
|
30
32
|
|
31
|
-
die_with_error()
|
33
|
+
die_with_error()
|
34
|
+
{
|
32
35
|
"$rvm_path/scripts/log" "fail" "$1"
|
36
|
+
|
33
37
|
exit "${2:-1}"
|
34
38
|
}
|
35
39
|
|
36
|
-
expand_ruby_name()
|
40
|
+
expand_ruby_name()
|
41
|
+
{
|
37
42
|
"$rvm_path/scripts/tools" strings "$1" | awk -F"${rvm_gemset_separator:-"@"}" '{print $1}'
|
38
43
|
}
|
39
44
|
|
40
|
-
migrate_rubies()
|
45
|
+
migrate_rubies()
|
46
|
+
{
|
41
47
|
local origin_gemset destination_gemset gemset_name migrate_ruby_name migrate_alias_name migrate_new_alias_name binaries origin_wrappers_path full_bin_path expanded_symlink linked_binary_name new_wrapper_destination
|
42
48
|
|
43
49
|
expanded_source="$(expand_ruby_name "$source_ruby")"
|
data/scripts/monitor
CHANGED
@@ -7,7 +7,8 @@ source "$rvm_path/scripts/base"
|
|
7
7
|
|
8
8
|
rvm_monitor_sleep="${rvm_monitor_sleep:-2}"
|
9
9
|
|
10
|
-
timestamp()
|
10
|
+
timestamp()
|
11
|
+
{
|
11
12
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
12
13
|
echo $(stat -f "%m" $1)
|
13
14
|
else
|
@@ -15,20 +16,29 @@ timestamp() {
|
|
15
16
|
fi
|
16
17
|
}
|
17
18
|
|
18
|
-
push_if_timestamp_changed()
|
19
|
-
|
20
|
-
|
19
|
+
push_if_timestamp_changed()
|
20
|
+
{
|
21
|
+
local file=$1
|
22
|
+
|
23
|
+
local file_timestamp=$(timestamp "$file")
|
21
24
|
|
22
25
|
eval "time=\$${framework}_timestamp"
|
26
|
+
|
23
27
|
if [[ "$file_timestamp" -gt $time ]] ; then
|
28
|
+
|
24
29
|
array_push "changed_${framework}_files" $file
|
30
|
+
|
25
31
|
fi
|
26
32
|
}
|
27
33
|
|
28
|
-
update_timestamp()
|
34
|
+
update_timestamp()
|
35
|
+
{
|
29
36
|
if [[ -d "${1}/" ]] ; then
|
37
|
+
|
30
38
|
\touch "$rvm_path/${$}_${1}_timestamp"
|
39
|
+
|
31
40
|
eval "${1}_timestamp=\$(timestamp \"$rvm_path/${$}_${1}_timestamp\")"
|
41
|
+
|
32
42
|
fi
|
33
43
|
}
|
34
44
|
|
data/scripts/notes
CHANGED
@@ -63,8 +63,8 @@ dependencies:
|
|
63
63
|
rvm: bash curl git
|
64
64
|
|
65
65
|
# For MRI based rubies you will need:
|
66
|
-
ruby: pacman -Sy --noconfirm patch curl bison zlib readline libxml2 git
|
67
|
-
ruby-head: pacman -Sy --noconfirm subversion autoconf diffutils patch bison
|
66
|
+
ruby: pacman -Sy --noconfirm patch curl bison zlib readline libxml2 git make
|
67
|
+
ruby-head: pacman -Sy --noconfirm subversion autoconf diffutils patch bison make
|
68
68
|
|
69
69
|
# For JRuby (if you wish to use it) you will need:
|
70
70
|
jruby: pacman -Sy --noconfirm jdk jre curl
|
data/scripts/override_gem
CHANGED
data/scripts/package
CHANGED
@@ -5,8 +5,8 @@ if [[ "$rvm_trace_flag" -eq 2 ]] ; then set -x ; export rvm_trace_flag ; fi
|
|
5
5
|
rvm_base_except="selector"
|
6
6
|
source "$rvm_path/scripts/base"
|
7
7
|
|
8
|
-
install_package()
|
9
|
-
|
8
|
+
install_package()
|
9
|
+
{
|
10
10
|
__rvm_db "${package}_url" "package_url"
|
11
11
|
|
12
12
|
if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi
|
@@ -93,7 +93,8 @@ install_package() {
|
|
93
93
|
return ${result:-0}
|
94
94
|
}
|
95
95
|
|
96
|
-
readline()
|
96
|
+
readline()
|
97
|
+
{
|
97
98
|
package="readline" ; archive_format="tar.gz"
|
98
99
|
for version in 5.2 6.0 ; do
|
99
100
|
configure_flags="--disable-dependency-tracking --disable-static --enable-shared"
|
@@ -101,17 +102,20 @@ readline() {
|
|
101
102
|
done
|
102
103
|
}
|
103
104
|
|
104
|
-
iconv()
|
105
|
+
iconv()
|
106
|
+
{
|
105
107
|
package="libiconv" ; version=1.13.1 ; archive_format="tar.gz"
|
106
108
|
install_package
|
107
109
|
}
|
108
110
|
|
109
|
-
curl()
|
111
|
+
curl()
|
112
|
+
{
|
110
113
|
package="curl" ; version=7.19.7 ; archive_format="tar.gz"
|
111
114
|
install_package
|
112
115
|
}
|
113
116
|
|
114
|
-
openssl()
|
117
|
+
openssl()
|
118
|
+
{
|
115
119
|
package="openssl" ; version="0.9.8n" ; archive_format="tar.gz"
|
116
120
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
117
121
|
|
@@ -159,34 +163,40 @@ openssl() {
|
|
159
163
|
install_package
|
160
164
|
}
|
161
165
|
|
162
|
-
zlib()
|
166
|
+
zlib()
|
167
|
+
{
|
163
168
|
package="zlib" ; version="1.2.5" ; archive_format="tar.gz"
|
164
169
|
install_package
|
165
170
|
}
|
166
171
|
|
167
|
-
autoconf()
|
172
|
+
autoconf()
|
173
|
+
{
|
168
174
|
package="autoconf" ; version="2.65" ; archive_format="tar.gz"
|
169
175
|
prefix_path="$usr_path"
|
170
176
|
install_package
|
171
177
|
}
|
172
178
|
|
173
|
-
ncurses()
|
179
|
+
ncurses()
|
180
|
+
{
|
174
181
|
package="ncurses" ; version="5.7" ; archive_format="tar.gz"
|
175
182
|
configure_flags="--with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs"
|
176
183
|
install_package
|
177
184
|
}
|
178
185
|
|
179
|
-
pkgconfig()
|
186
|
+
pkgconfig()
|
187
|
+
{
|
180
188
|
package="pkg-config" ; version="0.23" archive_format="tar.gz"
|
181
189
|
install_package
|
182
190
|
}
|
183
191
|
|
184
|
-
gettext()
|
192
|
+
gettext()
|
193
|
+
{
|
185
194
|
package="gettext" ; version="0.17" ; archive_format="tar.gz"
|
186
195
|
install_package
|
187
196
|
}
|
188
197
|
|
189
|
-
libxml2()
|
198
|
+
libxml2()
|
199
|
+
{
|
190
200
|
package="libxml2" ; version="2.7.3" ; archive_format="tar.gz"
|
191
201
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
192
202
|
configure="./configure --prefix=$usr_path --build=i686-apple-darwin$(uname -r) --host=i686-apple-darwin$(uname -r)"
|
@@ -195,7 +205,8 @@ libxml2() {
|
|
195
205
|
unset prefix_path
|
196
206
|
}
|
197
207
|
|
198
|
-
glib()
|
208
|
+
glib()
|
209
|
+
{
|
199
210
|
pkgconfig
|
200
211
|
gettext
|
201
212
|
package="glib" ; version="2.23.1" ; archive_format="tar.gz"
|
@@ -204,7 +215,8 @@ glib() {
|
|
204
215
|
install_package
|
205
216
|
}
|
206
217
|
|
207
|
-
mono()
|
218
|
+
mono()
|
219
|
+
{
|
208
220
|
glib
|
209
221
|
|
210
222
|
__rvm_mono_env
|
@@ -212,7 +224,8 @@ mono() {
|
|
212
224
|
install_package
|
213
225
|
}
|
214
226
|
|
215
|
-
llvm()
|
227
|
+
llvm()
|
228
|
+
{
|
216
229
|
package="llvm" ; version="89156"
|
217
230
|
if [[ ! -z "$rvm_make_flags_flag" ]] ; then __rvm_make_flags ; fi
|
218
231
|
(
|
data/scripts/patches
CHANGED
@@ -4,7 +4,8 @@
|
|
4
4
|
# and dealing with patches.
|
5
5
|
|
6
6
|
# Returns the path used to look for a patch given a specific name.
|
7
|
-
__rvm_patch_lookup_path()
|
7
|
+
__rvm_patch_lookup_path()
|
8
|
+
{
|
8
9
|
echo "/"
|
9
10
|
|
10
11
|
[[ -n "${rvm_patch_original_pwd:-""}" ]] && echo "$rvm_patch_original_pwd/"
|
@@ -16,7 +17,8 @@ __rvm_patch_lookup_path() {
|
|
16
17
|
return $?
|
17
18
|
}
|
18
19
|
|
19
|
-
__rvm_expand_patch_name()
|
20
|
+
__rvm_expand_patch_name()
|
21
|
+
{
|
20
22
|
local name expanded_patch_name
|
21
23
|
|
22
24
|
name="${1:-""}"
|
@@ -36,7 +38,8 @@ __rvm_expand_patch_name() {
|
|
36
38
|
}
|
37
39
|
|
38
40
|
# Return the full patch for a given patch.
|
39
|
-
__rvm_lookup_full_patch_path()
|
41
|
+
__rvm_lookup_full_patch_path()
|
42
|
+
{
|
40
43
|
local extension patch_path directory directories
|
41
44
|
|
42
45
|
# Absolute path, pwd and then finally the rvm patches path.
|
data/scripts/patchsets
CHANGED
@@ -6,7 +6,8 @@ source "$rvm_path/scripts/base"
|
|
6
6
|
|
7
7
|
source "$rvm_path/scripts/patches"
|
8
8
|
|
9
|
-
lookup_patchset()
|
9
|
+
lookup_patchset()
|
10
|
+
{
|
10
11
|
|
11
12
|
local paths lookup_path
|
12
13
|
|
@@ -31,7 +32,8 @@ lookup_patchset() {
|
|
31
32
|
}
|
32
33
|
|
33
34
|
# Return the full patch for a given patch.
|
34
|
-
__rvm_lookup_full_patch_path()
|
35
|
+
__rvm_lookup_full_patch_path()
|
36
|
+
{
|
35
37
|
|
36
38
|
local directory directories extension patch_path
|
37
39
|
|
@@ -56,7 +58,8 @@ __rvm_lookup_full_patch_path() {
|
|
56
58
|
return 1
|
57
59
|
}
|
58
60
|
|
59
|
-
usage()
|
61
|
+
usage()
|
62
|
+
{
|
60
63
|
printf "
|
61
64
|
|
62
65
|
Usage:
|
data/scripts/repair
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
source "$rvm_path/scripts/base"
|
4
4
|
|
5
|
-
usage()
|
5
|
+
usage()
|
6
|
+
{
|
6
7
|
printf "
|
7
8
|
Usage:
|
8
9
|
|
@@ -13,13 +14,41 @@ usage() {
|
|
13
14
|
symlinks - Repair symlinks
|
14
15
|
environments - Repair environments
|
15
16
|
archives - Repair archives
|
17
|
+
gemsets - Repair gemsets
|
16
18
|
all - Repair all of the above
|
17
19
|
|
18
20
|
"
|
19
21
|
}
|
20
22
|
|
21
|
-
|
23
|
+
repair_gemsets()
|
24
|
+
{
|
25
|
+
local directory directories
|
22
26
|
|
27
|
+
"$rvm_path/scripts/log" "info" \
|
28
|
+
"Removing gemsets missing names or interpreters."
|
29
|
+
|
30
|
+
(
|
31
|
+
builtin cd "${rvm_gems_path:-"rvm_path/gems"}"
|
32
|
+
|
33
|
+
directories=(
|
34
|
+
$( find . -mindepth 1 -maxdepth 1 -type d | grep '@$' )
|
35
|
+
$( find . -mindepth 1 -maxdepth 1 -type d | grep '^./@')
|
36
|
+
)
|
37
|
+
|
38
|
+
for directory in "${directories[@]//.\/}" ; do
|
39
|
+
|
40
|
+
rm -rf "./$directory/"
|
41
|
+
|
42
|
+
done
|
43
|
+
)
|
44
|
+
|
45
|
+
"$rvm_path/scripts/log" "info" "Gemsets repaired."
|
46
|
+
|
47
|
+
return 0
|
48
|
+
}
|
49
|
+
|
50
|
+
repair_wrappers()
|
51
|
+
{
|
23
52
|
local wrapper_ruby_name
|
24
53
|
|
25
54
|
"$rvm_path/scripts/log" "info" "Regenerating all wrappers..."
|
@@ -36,12 +65,13 @@ repair_wrappers() {
|
|
36
65
|
|
37
66
|
"$rvm_path/scripts/log" "info" "Wrappers regenerated"
|
38
67
|
|
68
|
+
return 0
|
39
69
|
}
|
40
70
|
|
41
71
|
# Removes stale symlinks in $rvm_bin_path, likely
|
42
72
|
# related to wrappers.
|
43
|
-
repair_symlinks()
|
44
|
-
|
73
|
+
repair_symlinks()
|
74
|
+
{
|
45
75
|
"$rvm_path/scripts/log" "info" "Repairing symlinks..."
|
46
76
|
|
47
77
|
(
|
@@ -49,7 +79,10 @@ repair_symlinks() {
|
|
49
79
|
|
50
80
|
for executable_name in $(\find \. -type l); do
|
51
81
|
|
52
|
-
[[ -e "$executable_name"
|
82
|
+
if [[ -e "$executable_name" \
|
83
|
+
|| "$(readlink "$executable_name")" != "$rvm_path/wrappers/"* ]] ; then
|
84
|
+
continue
|
85
|
+
fi
|
53
86
|
|
54
87
|
if [[ -f "$executable_name" ]] ; then
|
55
88
|
|
@@ -66,12 +99,13 @@ repair_symlinks() {
|
|
66
99
|
}
|
67
100
|
|
68
101
|
# Regenerates each symlink file.
|
69
|
-
repair_environments()
|
102
|
+
repair_environments()
|
103
|
+
{
|
70
104
|
local environment_name environments
|
71
105
|
|
72
106
|
"$rvm_path/scripts/log" "info" "Regenerating environments..."
|
73
107
|
|
74
|
-
environments=($(cd "$rvm_path/environments" ; find . -maxdepth 1 -mindepth 1 -type f))
|
108
|
+
environments=($(builtin cd "$rvm_path/environments" ; find . -maxdepth 1 -mindepth 1 -type f))
|
75
109
|
|
76
110
|
for environment_name in "${environments[@]//.\/}" ; do
|
77
111
|
|
@@ -98,12 +132,13 @@ repair_environments() {
|
|
98
132
|
}
|
99
133
|
|
100
134
|
# Removes archives that have incorrect md5 sums.
|
101
|
-
repair_archives()
|
102
|
-
|
135
|
+
repair_archives()
|
136
|
+
{
|
103
137
|
local archive_file archives stored_md5sum
|
138
|
+
|
104
139
|
"$rvm_path/scripts/log" "info" "Repairing archives..."
|
105
140
|
|
106
|
-
archives=($(cd "${rvm_archives_path:-"$rvm_path/archives"}" ; find . -maxdepth 1 -mindepth 1 -type f))
|
141
|
+
archives=($(builtin cd "${rvm_archives_path:-"$rvm_path/archives"}" ; find . -maxdepth 1 -mindepth 1 -type f))
|
107
142
|
|
108
143
|
for archive_file in "${archives[@]//.\/}" ; do
|
109
144
|
|
@@ -127,8 +162,8 @@ repair_archives() {
|
|
127
162
|
return 0
|
128
163
|
}
|
129
164
|
|
130
|
-
repair_all()
|
131
|
-
|
165
|
+
repair_all()
|
166
|
+
{
|
132
167
|
repair_symlinks
|
133
168
|
|
134
169
|
repair_archives
|
@@ -153,6 +188,7 @@ fi
|
|
153
188
|
case "$action" in
|
154
189
|
all) repair_all ;;
|
155
190
|
symlinks) repair_symlinks ;;
|
191
|
+
gemsets) repair_gemsets ;;
|
156
192
|
environments) repair_environments ;;
|
157
193
|
archives) repair_archives ;;
|
158
194
|
wrappers) repair_wrappers ;;
|
data/scripts/rubygems
CHANGED
@@ -6,8 +6,8 @@ result=0
|
|
6
6
|
|
7
7
|
__rvm_become
|
8
8
|
|
9
|
-
rubygems_setup()
|
10
|
-
|
9
|
+
rubygems_setup()
|
10
|
+
{
|
11
11
|
__rvm_warn_on_rubyopt
|
12
12
|
|
13
13
|
unset RUBYOPT
|
@@ -45,6 +45,7 @@ rubygems_setup() {
|
|
45
45
|
fi
|
46
46
|
|
47
47
|
"$rvm_path/scripts/log" "info" "Installing rubygems dedicated to $rvm_ruby_string..."
|
48
|
+
|
48
49
|
rvm_rubygems_version="$version"
|
49
50
|
rvm_gem_package_name="rubygems-$rvm_rubygems_version"
|
50
51
|
rvm_rubygems_url=$(__rvm_db "rubygems_${rvm_rubygems_version}_url")
|
data/scripts/rvm-install
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
3
|
set -o errtrace
|
4
|
+
set -o errexit
|
5
|
+
|
4
6
|
export PS4='+[${BASH_SOURCE}] : ${LINENO} : ${FUNCNAME[0]:+${FUNCNAME[0]}() $ }'
|
5
7
|
|
6
8
|
if [[ -z "$rvm_selfcontained" ]]; then
|
7
|
-
if [[ "root" = "$(whoami)"
|
9
|
+
if [[ "root" = "$(whoami)" \
|
10
|
+
|| -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
|
8
11
|
export rvm_selfcontained=0
|
9
12
|
else
|
10
13
|
export rvm_selfcontained=1
|
@@ -15,34 +18,49 @@ unset rvm_auto_flag
|
|
15
18
|
|
16
19
|
install_source_path="$(dirname "$0" | sed 's#\/scripts$##')"
|
17
20
|
|
18
|
-
if [[ -d "$install_source_path/scripts"
|
21
|
+
if [[ -d "$install_source_path/scripts" \
|
22
|
+
&& -s "$install_source_path/scripts/utility" ]] ; then
|
19
23
|
builtin cd "$install_source_path"
|
20
24
|
fi
|
21
25
|
|
22
26
|
source scripts/version
|
23
27
|
source scripts/utility
|
24
28
|
|
25
|
-
usage()
|
29
|
+
usage()
|
30
|
+
{
|
26
31
|
printf "
|
27
32
|
Usage:
|
33
|
+
|
28
34
|
${0} [options]
|
29
35
|
|
30
36
|
options:
|
37
|
+
|
31
38
|
--auto : Automatically update shell profile files.
|
39
|
+
|
32
40
|
--prefix : Installation prefix directory.
|
41
|
+
|
33
42
|
--help : Display help/usage (this) message
|
43
|
+
|
34
44
|
--version : display rvm package version
|
45
|
+
|
35
46
|
"
|
36
47
|
}
|
37
48
|
|
38
|
-
check_rubyopt_conditions()
|
49
|
+
check_rubyopt_conditions()
|
50
|
+
{
|
39
51
|
if [[ -n "${RUBYOPT:-""}" ]]; then
|
40
|
-
printf "
|
41
|
-
|
52
|
+
printf "
|
53
|
+
|
54
|
+
WARNING: You have RUBYOPT set in your current environment.
|
55
|
+
This may cause rubies to not work as you expect them to as it is not supported
|
56
|
+
by all of them If errors show up, please try unsetting RUBYOPT first.
|
57
|
+
|
58
|
+
"
|
42
59
|
fi
|
43
60
|
}
|
44
61
|
|
45
|
-
andand_return_instructions()
|
62
|
+
andand_return_instructions()
|
63
|
+
{
|
46
64
|
printf "
|
47
65
|
This means that if you see something like:
|
48
66
|
|
@@ -63,7 +81,8 @@ EOF - This marks the end of the .bashrc file
|
|
63
81
|
"
|
64
82
|
}
|
65
83
|
|
66
|
-
installation_complete()
|
84
|
+
installation_complete()
|
85
|
+
{
|
67
86
|
printf "
|
68
87
|
You must now complete the install by loading RVM in new shells.
|
69
88
|
|
@@ -91,7 +110,8 @@ installation_complete() {
|
|
91
110
|
\n"
|
92
111
|
}
|
93
112
|
|
94
|
-
andand_return_warning()
|
113
|
+
andand_return_warning()
|
114
|
+
{
|
95
115
|
printf "
|
96
116
|
WARNING: you have a 'return' statement in your ~/.bashrc
|
97
117
|
This could cause some features of RVM to not work.
|
@@ -104,7 +124,8 @@ andand_return_warning() {
|
|
104
124
|
\n"
|
105
125
|
}
|
106
126
|
|
107
|
-
thank_you()
|
127
|
+
thank_you()
|
128
|
+
{
|
108
129
|
printf "
|
109
130
|
${name:-"$(whoami)"},
|
110
131
|
|
@@ -135,7 +156,8 @@ or opening a new shell
|
|
135
156
|
"
|
136
157
|
}
|
137
158
|
|
138
|
-
upgrade_notes()
|
159
|
+
upgrade_notes()
|
160
|
+
{
|
139
161
|
printf "
|
140
162
|
|
141
163
|
Upgrade Notes
|
@@ -187,14 +209,23 @@ fi
|
|
187
209
|
|
188
210
|
source scripts/initialize
|
189
211
|
|
190
|
-
if grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null
|
212
|
+
if grep -q 'scripts/rvm' "$HOME"/.bash* 2>/dev/null \
|
213
|
+
|| grep -q 'scripts/rvm' "$HOME"/.zsh* 2>/dev/null ; then
|
214
|
+
|
191
215
|
if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
|
216
|
+
|
192
217
|
export upgrade_flag=1
|
218
|
+
|
193
219
|
else
|
220
|
+
|
194
221
|
export upgrade_flag=0
|
222
|
+
|
195
223
|
fi
|
224
|
+
|
196
225
|
else
|
226
|
+
|
197
227
|
export upgrade_flag=0
|
228
|
+
|
198
229
|
fi
|
199
230
|
|
200
231
|
__rvm_initialize
|
@@ -237,7 +268,17 @@ else
|
|
237
268
|
|
238
269
|
fi
|
239
270
|
|
240
|
-
directories=(
|
271
|
+
directories=(
|
272
|
+
"${rvm_archives_path:-"$rvm_path/archives"}"
|
273
|
+
"${rvm_src_path:-"$rvm_path/src"}"
|
274
|
+
"${rvm_log_path:-"$rvm_path/log"}"
|
275
|
+
"$rvm_bin_path"
|
276
|
+
"${rvm_gems_path:-"$rvm_path/gems"}"
|
277
|
+
"${rvm_rubies_path:-"$rvm_path/rubies"}"
|
278
|
+
"$rvm_path/config"
|
279
|
+
"${rvm_tmp_path:-"$rvm_path/tmp"}"
|
280
|
+
"$rvm_path/bin"
|
281
|
+
)
|
241
282
|
|
242
283
|
for directory in "${directories[@]}" ; do
|
243
284
|
|
@@ -277,7 +318,8 @@ for dir_name in config scripts examples lib hooks help patches; do
|
|
277
318
|
done
|
278
319
|
|
279
320
|
if [[ ! -s "$rvm_path/config/user" ]] ; then
|
280
|
-
echo '#
|
321
|
+
echo '# User settings, overrides db settings and persists across installs.' \
|
322
|
+
>> "$rvm_path/config/user"
|
281
323
|
fi
|
282
324
|
|
283
325
|
scripts=(monitor match log install color db fetch log set package)
|
@@ -321,9 +363,12 @@ if [[ ${rvm_auto_flag:-0} -eq 1 ]] ; then
|
|
321
363
|
|
322
364
|
if ! grep -q '.profile' "$rcfile" ; then
|
323
365
|
|
324
|
-
echo " Adding
|
366
|
+
echo " Adding profile sourcing line to $rcfile."
|
325
367
|
|
326
|
-
printf "
|
368
|
+
printf "
|
369
|
+
# rvm-install added line:
|
370
|
+
[[ -s \$HOME/.profile ]] && source \$HOME/.profile
|
371
|
+
" >> "$rcfile"
|
327
372
|
|
328
373
|
fi
|
329
374
|
|
@@ -331,9 +376,12 @@ if [[ ${rvm_auto_flag:-0} -eq 1 ]] ; then
|
|
331
376
|
|
332
377
|
if ! grep -q "scripts\/rvm" "$rcfile" ; then
|
333
378
|
|
334
|
-
echo " Adding
|
379
|
+
echo " Adding rvm loading line to $rcfile."
|
335
380
|
|
336
|
-
printf "
|
381
|
+
printf "
|
382
|
+
# rvm-install added:
|
383
|
+
[[ -s \"$rvm_path/.rvm/scripts/rvm\" ]] && . \"$rvm_path/.rvm/scripts/rvm\"
|
384
|
+
" >> "$rcfile"
|
337
385
|
|
338
386
|
fi
|
339
387
|
|
@@ -352,9 +400,10 @@ if [[ -d gemsets/ ]] ; then
|
|
352
400
|
|
353
401
|
fi
|
354
402
|
|
355
|
-
for gemset_file in $(
|
403
|
+
for gemset_file in $(find "$PWD/gemsets" -iname '*.gems' | sed 's/^\.\///') ; do
|
356
404
|
|
357
|
-
|
405
|
+
cwd="${PWD//\//\\/}\/gemsets\/"
|
406
|
+
destination="$rvm_path/gemsets/${gemset_file/$cwd}"
|
358
407
|
|
359
408
|
destination_path="$(dirname "$destination")"
|
360
409
|
|
@@ -362,7 +411,7 @@ if [[ -d gemsets/ ]] ; then
|
|
362
411
|
|
363
412
|
mkdir -p "$destination_path"
|
364
413
|
|
365
|
-
cp "
|
414
|
+
cp "$gemset_file" "$destination"
|
366
415
|
|
367
416
|
fi
|
368
417
|
|
@@ -404,7 +453,8 @@ fi
|
|
404
453
|
#
|
405
454
|
mkdir -p "${rvm_rubies_path:-"$rvm_path/rubies"}/"
|
406
455
|
|
407
|
-
for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-*
|
456
|
+
for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* \
|
457
|
+
$rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
|
408
458
|
|
409
459
|
if [[ -d "$ruby" ]] ; then
|
410
460
|
|
@@ -416,7 +466,8 @@ for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-*
|
|
416
466
|
|
417
467
|
if [[ -s "$new_path/bin/$file" ]] ; then
|
418
468
|
|
419
|
-
sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}"
|
469
|
+
sed -e '1,1s=.*=#!'"${new_path}/bin/ruby=" "${new_path}/bin/${file}" \
|
470
|
+
> "${new_path}/bin/${file}.new"
|
420
471
|
|
421
472
|
mv -f "$new_path/bin/$file.new" "$new_path/bin/$file"
|
422
473
|
|
@@ -481,7 +532,8 @@ done
|
|
481
532
|
# Move from legacy defaults to the new, alias based system.
|
482
533
|
if [[ -s "$rvm_path/config/default" ]]; then
|
483
534
|
|
484
|
-
original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default"
|
535
|
+
original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" \
|
536
|
+
| awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
|
485
537
|
|
486
538
|
if [[ -n "$original_version" ]]; then
|
487
539
|
|
@@ -505,19 +557,24 @@ mkdir -p "${rvm_bin_path:-"$rvm_path/bin"}"
|
|
505
557
|
files=(rvm rvmsudo rvm-shell rvm-auto-ruby)
|
506
558
|
for file in "${files[@]}" ; do
|
507
559
|
|
508
|
-
[[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]]
|
560
|
+
if [[ -s "${rvm_bin_path:-"$rvm_path/bin"}/$file" ]] ; then
|
561
|
+
|
562
|
+
chmod +x "${rvm_bin_path:-"$rvm_path/bin"}/$file"
|
563
|
+
|
564
|
+
fi
|
509
565
|
|
510
566
|
done
|
511
567
|
|
512
568
|
printf "\n Copying manpages into place."
|
513
569
|
|
514
|
-
files=($(builtin cd "$install_source_path/man" ;
|
570
|
+
files=($(builtin cd "$install_source_path/man" ; \
|
571
|
+
find . -maxdepth 1 -mindepth 1 -type f -print))
|
515
572
|
|
516
573
|
for file in "${files[@]//.\/}" ; do
|
517
574
|
|
518
|
-
rm -rf "$rvm_man_path/$
|
575
|
+
rm -rf "$rvm_man_path/$file"
|
519
576
|
|
520
|
-
cp -R "$install_source_path/man/$
|
577
|
+
cp -R "$install_source_path/man/$file" "$rvm_man_path/"
|
521
578
|
|
522
579
|
done
|
523
580
|
|
@@ -537,7 +594,7 @@ if [[ ${#files[@]} -gt 0 ]] ; then
|
|
537
594
|
fi
|
538
595
|
|
539
596
|
if [[ $upgrade_flag -eq 0 ]] ; then
|
540
|
-
chmod +x ./
|
597
|
+
chmod +x ./scripts/notes # Sometimes things don't clone properly :/
|
541
598
|
./scripts/notes
|
542
599
|
fi
|
543
600
|
|
@@ -549,8 +606,6 @@ if [[ ${upgrade_flag:-0} -eq 1 ]] ; then
|
|
549
606
|
|
550
607
|
check_rubyopt_conditions
|
551
608
|
|
552
|
-
regenerate_wrappers
|
553
|
-
|
554
609
|
printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
|
555
610
|
|
556
611
|
else
|