rvm 0.0.80 → 0.0.81
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/README +1 -2
- data/install +45 -43
- data/lib/VERSION.yml +1 -1
- data/rvm.gemspec +7 -2
- data/scripts/cli +13 -36
- data/scripts/color +43 -46
- data/scripts/completion +3 -23
- data/scripts/db +34 -0
- data/scripts/fetch +65 -0
- data/scripts/gems +16 -16
- data/scripts/initialize +19 -0
- data/scripts/install +45 -43
- data/scripts/log +14 -0
- data/scripts/match +16 -0
- data/scripts/monitor +1 -0
- data/scripts/ruby-installer +73 -70
- data/scripts/rvm +14 -28
- data/scripts/rvm-install +45 -43
- data/scripts/selector +57 -45
- data/scripts/update +45 -43
- data/scripts/utility +78 -262
- metadata +7 -2
- data/binscripts/gemsync +0 -21
data/scripts/update
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
#!/usr/bin/env bash
|
2
2
|
|
3
|
-
|
4
|
-
if [[ -f "
|
5
|
-
if [[
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
3
|
+
if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
|
4
|
+
if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
|
5
|
+
if [[ -z "$rvm_path" ]] ; then unset rvm_path ; fi
|
6
|
+
|
7
|
+
if [[ -z "$rvm_path" ]] ; then
|
8
|
+
if [[ "root" = "$(whoami)" ]] ; then
|
9
|
+
rvm_path="${rvm_path:-/usr/local/rvm}"
|
10
|
+
else
|
11
|
+
rvm_path="${rvm_path:-$HOME/.rvm}"
|
12
|
+
fi
|
11
13
|
fi
|
12
14
|
|
15
|
+
source scripts/initialize
|
16
|
+
|
13
17
|
#
|
14
18
|
# Setup
|
15
19
|
#
|
@@ -21,8 +25,8 @@ if [[ ! -d "$source_dir" ]] ; then unset source_dir ; fi
|
|
21
25
|
source_dir="${source_dir:-$cwd}"
|
22
26
|
|
23
27
|
# State what is required to use rvm
|
24
|
-
echo -e "\n$(tput setaf 2)rvm$(tput sgr0)
|
25
|
-
echo -e "\n Installing
|
28
|
+
echo -e "\n$(tput setaf 2)rvm$(tput sgr0) - shell scripts that allows a user to manage multiple ruby versions in their own account."
|
29
|
+
echo -e "\n Installing to $rvm_path..."
|
26
30
|
for dir_name in src scripts bin log archives config gems examples ; do
|
27
31
|
mkdir -p "$rvm_path/$dir_name"
|
28
32
|
done
|
@@ -47,15 +51,15 @@ ln -nfs $rvm_path/scripts/rvm $rvm_path/bin/rvm
|
|
47
51
|
#
|
48
52
|
# RC Files
|
49
53
|
#
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
if [[ -
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
for rcfile in $(echo $rvm_rc_files) ; do
|
55
|
+
if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
|
56
|
+
if [[ -z "$(awk "/$(echo "$rvm_path/scripts/rvm" | sed 's#/#\\/#g')/" $rcfile)" ]] ; then
|
57
|
+
echo " Adding 'if [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" -le 0 ]] ; then source $rvm_path/scripts/rvm ; fi' to $rcfile."
|
58
|
+
echo -e "\n# rvm-install added line:\nif [[ -s $rvm_path/scripts/rvm ]] && [[ "\$rvm_loaded_flag" != "1" ]] ; then source $rvm_path/scripts/rvm ; fi\n" >> $rcfile
|
59
|
+
else
|
60
|
+
: # it exists... remove it and append at the end
|
61
|
+
fi
|
62
|
+
done
|
59
63
|
|
60
64
|
if [[ "root" = "$(whoami)" ]] ; then
|
61
65
|
ln -nfs $rvm_path/scripts/rvm /usr/local/bin/rvm
|
@@ -66,7 +70,7 @@ fi
|
|
66
70
|
# System Checks
|
67
71
|
#
|
68
72
|
system="$(uname)"
|
69
|
-
echo -e "\n
|
73
|
+
echo -e "\n$(tput setaf 2)Notes: $(tput sgr0)\n"
|
70
74
|
if [[ "Linux" = "$system" ]] ; then
|
71
75
|
rvm_apt_get_binary="$(which aptitude 2> /dev/null)"
|
72
76
|
rvm_emerge_binary="$(which emerge 2> /dev/null)"
|
@@ -74,44 +78,42 @@ if [[ "Linux" = "$system" ]] ; then
|
|
74
78
|
rvm_yum_binary="$(which yum 2> /dev/null)"
|
75
79
|
|
76
80
|
if [[ ! -z "$rvm_apt_get_binary" ]] ; then
|
77
|
-
echo -e "
|
78
|
-
echo -e "
|
79
|
-
echo -e "
|
80
|
-
echo -e "
|
81
|
-
echo -e "
|
82
|
-
echo -e "
|
81
|
+
echo -e " $item For JRuby (if you wish to use it) you will need:"
|
82
|
+
echo -e " $ aptitude install sun-java6-bin sun-java6-jre sun-java6-jdk"
|
83
|
+
echo -e " $item For ree (if you wish to use it) you will need:"
|
84
|
+
echo -e " $ aptitude install libreadline5-dev libssl-dev bison"
|
85
|
+
echo -e " $item For 1.9.X (if you wish to use it) we additionally recommend:"
|
86
|
+
echo -e " $ aptitude install libxml2-dev"
|
83
87
|
|
84
88
|
elif [[ ! -z "$rvm_emerge_binary" ]] ; then
|
85
|
-
echo -e "
|
86
|
-
echo -e "
|
89
|
+
echo -e " $item For JRuby (if you wish to use it) you will need:"
|
90
|
+
echo -e " $ emerge dev-java/sun-jdk dev-java/sun-jre-bin"
|
87
91
|
|
88
92
|
elif [[ ! -z "$rvm_pacman_binary" ]] ; then
|
89
|
-
echo -e "
|
90
|
-
echo -e "
|
93
|
+
echo -e " $item For JRuby (if you wish to use it) you will need:"
|
94
|
+
echo -e " $ pacman -Sy jdk jre"
|
91
95
|
|
92
96
|
elif [[ ! -z "$rvm_yum_binary" ]] ; then
|
93
|
-
echo -e "
|
94
|
-
echo -e "
|
97
|
+
echo -e " $item For ree (if you wish to use it) you will need:"
|
98
|
+
echo -e " $ yum install -y rpm-build gcc gcc-c++ redhat-rpm-config ; then download and rpmbuild and install the sdk, Have fun..."
|
95
99
|
|
96
100
|
else
|
97
|
-
echo -e "
|
98
|
-
echo -e "
|
101
|
+
echo -e " $item For JRuby (if you wish to use it) you will need:"
|
102
|
+
echo -e " The SUN java runtime environment and development kit."
|
99
103
|
fi
|
100
104
|
elif [[ "Darwin" = "$system" ]] ; then
|
101
|
-
echo -e "
|
102
|
-
echo -e "
|
105
|
+
echo -e " $item Be sure that you have XCode Tools installed in order to use rvm."
|
106
|
+
echo -e " $item If you intend on installing MacRuby you must install LLVM first."
|
103
107
|
fi
|
104
108
|
|
105
|
-
echo -e "
|
106
|
-
echo -e "
|
107
|
-
echo -e "
|
109
|
+
echo -e " $item In order to use rvm the following line must occur in your shell's loading files, after all path/variable settings.:"
|
110
|
+
echo -e " $item if [[ -s $rvm_path/scripts/rvm ]] ; then source $rvm_path/scripts/rvm ; fi"
|
111
|
+
echo -e " $item CLOSE THIS SHELL AND OPEN A NEW ONE in order to use rvm."
|
108
112
|
|
109
|
-
echo -e "\n
|
113
|
+
echo -e "\n$(tput setaf 2)RTFM:\n $(tput sgr0) http://rvm.beginrescueend.com/ \n"
|
110
114
|
echo -e "$(tput setaf 2)w⦿‿⦿t!$(tput sgr0)"
|
111
115
|
echo -e "\n ~ Wayne\n"
|
112
116
|
|
113
|
-
|
114
|
-
rvm -v
|
115
|
-
echo
|
117
|
+
$rvm_path/bin/rvm -v
|
116
118
|
|
117
119
|
exit 0
|
data/scripts/utility
CHANGED
@@ -34,22 +34,22 @@ Info
|
|
34
34
|
}
|
35
35
|
|
36
36
|
__rvm_debug() {
|
37
|
-
|
38
|
-
|
37
|
+
$rvm_scripts_path/log "debug" "PATH:\n$(echo $PATH | awk -F":" '{print $1":"$2":"$3":"$4":"$5}')"
|
38
|
+
$rvm_scripts_path/log "debug" "uname -a: $(uname -a)"
|
39
39
|
|
40
40
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
41
|
+
$rvm_scripts_path/log "debug" "uname -r: $(uname -r)"
|
42
|
+
$rvm_scripts_path/log "debug" "uname -m: $(uname -m)"
|
43
|
+
$rvm_scripts_path/log "debug" "sw_vers: $(sw_vers | tr "\n" ',')"
|
44
|
+
$rvm_scripts_path/log "debug" "ARCHFLAGS: $ARCHFLAGS"
|
45
|
+
$rvm_scripts_path/log "debug" "LDFLAGS: $LDFLAGS"
|
46
|
+
$rvm_scripts_path/log "debug" "CFLAGS: $CFLAGS"
|
47
|
+
$rvm_scripts_path/log "debug" "/Developer/SDKs/*:$(basename -a /Developer/SDKs/* | tr "\n" ',')"
|
48
48
|
fi
|
49
49
|
|
50
50
|
for file_name in $(echo $rc_files) ; do
|
51
51
|
if [[ -s "$file_name" ]] ; then
|
52
|
-
|
52
|
+
$rvm_scripts_path/log "debug" "$file_name:\n$(grep 'rvm' $file_name)"
|
53
53
|
fi
|
54
54
|
done
|
55
55
|
|
@@ -61,32 +61,11 @@ __rvm_debug() {
|
|
61
61
|
|
62
62
|
for file_name in $(echo $debug_files); do
|
63
63
|
if [[ -f "$file_name" ]] && [[ -s "$file_name" ]] ; then
|
64
|
-
|
64
|
+
$rvm_scripts_path/log "debug" "$file_name (filtered):\n$(cat $file_name | awk '!/assword|_key/')\n"
|
65
65
|
fi
|
66
66
|
done
|
67
67
|
|
68
|
-
|
69
|
-
|
70
|
-
if [[ -f "$rvm_path/bin/rvm" ]] ; then
|
71
|
-
__rvm_log "error" "rvm script in bin! \n$(\ls -laht $rvm_path/bin/rvm)"
|
72
|
-
fi
|
73
|
-
}
|
74
|
-
|
75
|
-
# Logging functions based on level
|
76
|
-
# TODO: Allow specification of a base file name to output to.
|
77
|
-
__rvm_log() {
|
78
|
-
if [[ ! -z "$2" ]] ; then level=$1 ; shift ; else level="info" ; fi
|
79
|
-
message=$1
|
80
|
-
case "$level" in
|
81
|
-
debug) shift ;
|
82
|
-
((rvm_debug_flag)) && echo -e "$(tput setaf 5)<d>$(tput sgr0) $message $(tput setaf 5)</d> $(tput sgr0) "
|
83
|
-
;;
|
84
|
-
info) shift ; echo -e "$(tput setaf 2)<i>$(tput sgr0) $message $(tput setaf 2)</i> $(tput sgr0) " ;;
|
85
|
-
warn) shift ; echo -e "$(tput setaf 3)<w>$(tput sgr0) $message $(tput setaf 3)</w> $(tput sgr0) " ;;
|
86
|
-
error) shift ; echo -e "$(tput setaf 1)<e>$(tput sgr0) $message $(tput setaf 1)</e> $(tput sgr0) " ;;
|
87
|
-
fail) shift ; echo -e "$(tput setaf 1)<f>$(tput sgr0) $message $(tput setaf 1)</f> $(tput sgr0) " ; __rvm_pushpop ; return 1 ;;
|
88
|
-
*) echo -e "$message"
|
89
|
-
esac
|
68
|
+
$rvm_scripts_path/log "debug" "gem sources:\n$(gem sources | awk '/gems/')"
|
90
69
|
}
|
91
70
|
|
92
71
|
if [[ ! -z "$ZSH_VERSION" ]] ; then __shell_array_start=1 ; else __shell_array_start=0 ; fi
|
@@ -115,8 +94,8 @@ __rvm_run() {
|
|
115
94
|
rvm_ruby_log_path="${rvm_ruby_log_path:-$rvm_path/log}"
|
116
95
|
mkdir -p $(dirname "$rvm_ruby_log_path/$log_file_name.log")
|
117
96
|
|
118
|
-
if [[ ! -z "$message" ]] ; then
|
119
|
-
|
97
|
+
if [[ ! -z "$message" ]] ; then $rvm_scripts_path/log "info" "$message" ; fi
|
98
|
+
(( $rvm_debug_flag )) && $rvm_scripts_path/log "debug" "Executing: $command"
|
120
99
|
touch "$rvm_ruby_log_path/$log_file_name.log" "$rvm_ruby_log_path/$log_file_name.error.log" # for zsh :(
|
121
100
|
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $command" | tee "$rvm_ruby_log_path/$log_file_name.log" > "$rvm_ruby_log_path/$log_file_name.error.log"
|
122
101
|
if [[ -z "$rvm_niceness" ]] || [[ "0" = "$rvm_niceness" ]] ; then
|
@@ -124,17 +103,17 @@ __rvm_run() {
|
|
124
103
|
else
|
125
104
|
eval "nice -n $rvm_niceness \$($command)" >> $rvm_ruby_log_path/$log_file_name.log 2>> $rvm_ruby_log_path/$log_file_name.error.log
|
126
105
|
fi
|
127
|
-
if [[ $? -gt 0 ]] ; then
|
106
|
+
if [[ $? -gt 0 ]] ; then $rvm_scripts_path/log "error" "Error running '$command', please check $rvm_ruby_log_path/$log_file_name.error.log" ; __rvm_pushpop ; return 1 ; fi
|
128
107
|
unset log_file command
|
129
108
|
}
|
130
109
|
|
131
110
|
__rvm_cleanup_variables() {
|
132
111
|
__rvm_unset_ruby_variables
|
133
|
-
unset rvm_ruby_selected_flag rvm_action rvm_irbrc_file
|
112
|
+
unset rvm_ruby_selected_flag 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 CFLAGS LDFLAGS ARCHFLAGS
|
134
113
|
}
|
135
114
|
|
136
115
|
__rvm_unset_ruby_variables() {
|
137
|
-
unset rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_ruby_binary rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_string rvm_ruby_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_head_flag rvm_ruby_configure
|
116
|
+
unset rvm_ruby_interpreter rvm_ruby_version rvm_ruby_repo_url rvm_ruby_package_name rvm_ruby_patch_level rvm_ruby_make rvm_ruby_make_install rvm_ruby_revision rvm_ruby_tag rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_ruby_binary rvm_ruby_home rvm_ruby_log_path rvm_ruby_src_path rvm_ruby_irbrc rvm_ruby_selected_flag rvm_ruby_string rvm_ruby_string rvm_ruby_src_path rvm_ruby_repo_url rvm_major_version rvm_minor_version rvm_ruby_gem_home rvm_head_flag rvm_ruby_configure rvm_ruby_mode
|
138
117
|
}
|
139
118
|
|
140
119
|
__rvm_load_rvmrc() {
|
@@ -171,62 +150,6 @@ RubyWrapper
|
|
171
150
|
chmod +x $rvm_path/bin/$rvm_ruby_package_name
|
172
151
|
}
|
173
152
|
|
174
|
-
__rvm_fetch() {
|
175
|
-
__rvm_pushpop $rvm_archives_path
|
176
|
-
if [[ -z "$1" ]] ; then log "fail" "BUG: __rvm_fetch called without an argument :/" ; return 1 ; fi
|
177
|
-
archive=$(basename "$1") ; downlaod=1
|
178
|
-
__rvm_log "debug" "Fetching $archive"
|
179
|
-
# Check first if we have the correct archive
|
180
|
-
if [[ -e "$archive" ]] && [[ -e "$archive.md5" ]] ; then
|
181
|
-
__rvm_log "debug" "Found archive and its md5, testing correctness"
|
182
|
-
if [[ $(md5sum --status -c "$archive.md5") -gt 0 ]] ; then
|
183
|
-
__rvm_log "debug" "Archive is bad, downloading"
|
184
|
-
download=1
|
185
|
-
else
|
186
|
-
__rvm_log "debug" "Archive is good, not downloading"
|
187
|
-
download=0
|
188
|
-
result=0
|
189
|
-
fi
|
190
|
-
else
|
191
|
-
__rvm_log "debug" "No archive or no MD5, downloading"
|
192
|
-
download=1
|
193
|
-
fi
|
194
|
-
if [[ $download -gt 0 ]] ; then
|
195
|
-
eval $rvm_fetch "$1"
|
196
|
-
result=$?
|
197
|
-
if [[ $result -gt 0 ]] ; then
|
198
|
-
retry=0
|
199
|
-
if [[ $result -eq 78 ]] ; then
|
200
|
-
__rvm_log "error" "The requested url does not exist: '$1'"
|
201
|
-
elif [[ $result -eq 18 ]] ; then
|
202
|
-
__rvm_log "error" "Partial file. Only a part of the file was transferred. Removing partial and re-trying."
|
203
|
-
rm -f "$archive"
|
204
|
-
retry=1
|
205
|
-
elif [[ $result -eq 33 ]] ; then
|
206
|
-
__rvm_log "debug" "Server does not support 'range' command, removing '$archive'"
|
207
|
-
rm -f "$archive"
|
208
|
-
retry=1
|
209
|
-
else
|
210
|
-
__rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log"
|
211
|
-
fi
|
212
|
-
|
213
|
-
if [[ $retry -eq 1 ]] ; then
|
214
|
-
eval $rvm_fetch "$1"
|
215
|
-
result=$?
|
216
|
-
if [[ $result -gt 0 ]] ; then
|
217
|
-
__rvm_log "error" "There was an error, please check $rvm_ruby_log_path/*.error.log"
|
218
|
-
fi
|
219
|
-
fi
|
220
|
-
|
221
|
-
fi
|
222
|
-
__rvm_pushpop
|
223
|
-
fi
|
224
|
-
|
225
|
-
unset archive
|
226
|
-
unset download
|
227
|
-
return $result
|
228
|
-
}
|
229
|
-
|
230
153
|
__rvm_load_defaults() {
|
231
154
|
if [[ ! -s "$rvm_path/system" ]] ; then
|
232
155
|
for variable in RUBY_VERSION GEM_HOME GEM_PATH MY_RUBY_HOME ; do
|
@@ -241,24 +164,24 @@ __rvm_load_defaults() {
|
|
241
164
|
done
|
242
165
|
fi
|
243
166
|
|
244
|
-
rvm_system_ruby=$(
|
167
|
+
rvm_system_ruby=$($rvm_scripts_path/db "$rvm_config_path/db" "system_ruby")
|
245
168
|
if [[ ! -z "$rvm_system_ruby" ]] ; then
|
246
169
|
rvm_system_ruby=$(which ruby)
|
247
170
|
if [[ $? -ne 0 ]] ; then
|
248
|
-
|
171
|
+
$rvm_scripts_path/log "info" "System ruby not found, no db will be stored."
|
249
172
|
else
|
250
|
-
|
173
|
+
$rvm_scripts_path/db "$rvm_config_path/db" "system_ruby" "$rvm_system_ruby"
|
251
174
|
|
252
175
|
# Now store system system & user gem paths
|
253
|
-
rvm_system_user_gem_path=$(
|
176
|
+
rvm_system_user_gem_path=$($rvm_scripts_path/db "$rvm_config_path/db" "system_user_gem_path")
|
254
177
|
if [[ -z "$rvm_system_user_gem_path" ]] ; then
|
255
178
|
rvm_system_user_gem_path=$( rvm system ; gem env gemdir user; )
|
256
|
-
|
179
|
+
$rvm_scripts_path/db "$rvm_config_path/db" "system_user_gem_path" "$rvm_system_user_gem_path"
|
257
180
|
fi
|
258
|
-
rvm_system_gem_path=$(
|
181
|
+
rvm_system_gem_path=$($rvm_scripts_path/db "$rvm_config_path/db" "system_gem_path")
|
259
182
|
if [[ -z "$rvm_system_gem_path" ]] ; then
|
260
183
|
rvm_system_gem_path=$( rvm system ; gem env gemdir; )
|
261
|
-
|
184
|
+
$rvm_scripts_path/db "$rvm_config_path/db" "system_gem_path" "$rvm_system_gem_path"
|
262
185
|
fi
|
263
186
|
fi
|
264
187
|
fi
|
@@ -277,7 +200,7 @@ __rvm_reset() {
|
|
277
200
|
__rvm_select
|
278
201
|
|
279
202
|
for system_config in system_ruby system_gem_path system_user_gem_path ; do
|
280
|
-
|
203
|
+
$rvm_scripts_path/db "$rvm_config_path/db" "$system_config" "delete"
|
281
204
|
done ; unset system_config variable
|
282
205
|
|
283
206
|
rm -f $rvm_path/bin/ruby $rvm_path/bin/gem $rvm_path/bin/rake $rvm_path/bin/irb $rvm_path/bin/default*
|
@@ -285,23 +208,23 @@ __rvm_reset() {
|
|
285
208
|
|
286
209
|
__rvm_implode() {
|
287
210
|
while : ; do
|
288
|
-
|
211
|
+
$rvm_scripts_path/log "warn" "Are you SURE you wish for rvm to implode? This will remove $rvm_path ? (type 'yes' or 'no')"
|
289
212
|
read response
|
290
213
|
if [[ "yes" = "$response" ]] ; then
|
291
214
|
if [[ "/" = "$rvm_path" ]] ; then
|
292
|
-
|
215
|
+
$rvm_scripts_path/log "error" "remove '/' ?!... NO!"
|
293
216
|
else
|
294
217
|
if [[ -d "$rvm_path" ]] ; then
|
295
|
-
|
218
|
+
$rvm_scripts_path/log "info" "Hai! Removing $rvm_path"
|
296
219
|
rm -rf $rvm_path/
|
297
|
-
|
220
|
+
$rvm_scripts_path/log "info" "$rvm_path has been removed."
|
298
221
|
else
|
299
|
-
|
222
|
+
$rvm_scripts_path/log "info" "It appears that $rvm_path is already non existant."
|
300
223
|
fi
|
301
224
|
fi
|
302
225
|
break
|
303
226
|
elif [[ "no" = "$response" ]] ; then
|
304
|
-
|
227
|
+
$rvm_scripts_path/log "info" "Cancelling implosion, no harm done :)"
|
305
228
|
break
|
306
229
|
fi
|
307
230
|
done
|
@@ -310,75 +233,12 @@ __rvm_implode() {
|
|
310
233
|
__rvm_source_dir() {
|
311
234
|
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
|
312
235
|
if [[ -z "$rvm_ruby_src_path" ]] ; then
|
313
|
-
|
236
|
+
$rvm_scripts_path/log "fail" "No source directory exists for the default implementation."
|
314
237
|
else
|
315
238
|
echo "$rvm_ruby_src_path"
|
316
239
|
fi
|
317
240
|
}
|
318
241
|
|
319
|
-
# clones from source implementation/version to default
|
320
|
-
# TODO: Merge this into 'rvm sync'
|
321
|
-
__rvm_gemdup() {
|
322
|
-
if [[ -z "$rvm_ruby_selected_flag" ]] ; then __rvm_select $* ; fi
|
323
|
-
__rvm_log "debug" "$rvm_ruby_interpreter"
|
324
|
-
if [[ "default" = "$rvm_ruby_interpreter" ]] ; then
|
325
|
-
# TODO: $rvm_path/default first, then system user
|
326
|
-
rvm_source_gem_path="$rvm_system_user_gem_path"
|
327
|
-
elif [[ "user" = "$rvm_ruby_interpreter" ]] ; then
|
328
|
-
rvm_source_gem_path="$rvm_system_user_gem_path"
|
329
|
-
elif [[ "system" = "$rvm_ruby_interpreter" ]] ; then
|
330
|
-
rvm_source_gem_path="$rvm_system_gem_path"
|
331
|
-
else
|
332
|
-
# TODO: use selector for this?
|
333
|
-
rvm_source_gem_path=${rvm_ruby_gem_home/$rvm_ruby_interpreter/$rvm_ruby_version}
|
334
|
-
fi
|
335
|
-
__rvm_gem_sync
|
336
|
-
}
|
337
|
-
|
338
|
-
__rvm_gem_sync() {
|
339
|
-
if [[ ! -z "$rvm_source_gem_path" ]] ; then
|
340
|
-
for rvm_gem_name_version in $rvm_source_gem_path/gems/* ; do
|
341
|
-
rvm_gem_name_version=$(basename $rvm_gem_name_version)
|
342
|
-
rvm_gem_name="${rvm_gem_name_version%-*}"
|
343
|
-
rvm_gem_version="${rvm_gem_name_version##*-}"
|
344
|
-
if [[ -d $GEM_HOME/gems/$rvm_gem_name_version ]] ; then
|
345
|
-
echo "$rvm_gem_name_version already installed."
|
346
|
-
else
|
347
|
-
__rvm_gi "$rvm_source_gem_path/cache/$rvm_gem_name-$rvm_gem_version.gem"
|
348
|
-
fi
|
349
|
-
done
|
350
|
-
unset rvm_gem_name_version rvm_gem_name rvm_gem_version
|
351
|
-
else
|
352
|
-
__rvm_log "fail" "Unknown ruby selected :("
|
353
|
-
result=1
|
354
|
-
fi
|
355
|
-
}
|
356
|
-
|
357
|
-
__rvm_db() {
|
358
|
-
rvm_hash_file="$rvm_config_path/db"
|
359
|
-
touch $rvm_hash_file
|
360
|
-
key="$1" ; shift
|
361
|
-
|
362
|
-
if [[ -z "$key" ]] ; then
|
363
|
-
__rvm_log "fail" "__rvm_db must be called with at least one argument: __rvm_db key [value]"
|
364
|
-
else
|
365
|
-
value="$*"
|
366
|
-
if [[ "unset" = "$value" ]] || [[ "delete" = "$value" ]] ; then
|
367
|
-
sed -i.tmp "s#^$key=.*\$##" $rvm_hash_file
|
368
|
-
else
|
369
|
-
if [[ -z "$value" ]] ; then # get
|
370
|
-
awk -F= '/^'"$key"'=/{print $2}' $rvm_hash_file
|
371
|
-
else # set
|
372
|
-
if [[ -z "$(awk -F= "/^'"$key"'=/{print $2}" $rvm_hash_file)" ]] ; then # append
|
373
|
-
echo "$key=$value" >> $rvm_hash_file
|
374
|
-
else # overwrite
|
375
|
-
sed -i.tmp "s#^$key=.*\$#$key=$value#" $rvm_hash_file
|
376
|
-
fi
|
377
|
-
fi
|
378
|
-
fi
|
379
|
-
fi
|
380
|
-
}
|
381
|
-
|
382
242
|
__rvm_list() {
|
383
243
|
if [[ ! -z "$rvm_all_flag" ]] ; then
|
384
244
|
while read -r tag
|
@@ -488,50 +348,11 @@ __rvm_list() {
|
|
488
348
|
}
|
489
349
|
|
490
350
|
__rvm_initialize() {
|
491
|
-
# TODO: Sanitize user input, ensure that there is a / a the end...
|
492
|
-
if [[ "root" = "$(whoami)" ]] ; then
|
493
|
-
rvm_prefix_path="${rvm_prefix_path:-/usr/local/}"
|
494
|
-
rc_files="/etc/profile /etc/zshenv"
|
495
|
-
else
|
496
|
-
if [[ -f "$HOME/.rvm/scripts/rvm" ]] ; then
|
497
|
-
rvm_prefix_path="${rvm_prefix_path:-"$HOME/."}"
|
498
|
-
else
|
499
|
-
rvm_prefix_path="${rvm_prefix_path:-"/usr/local/"}"
|
500
|
-
fi
|
501
|
-
rc_files="$HOME/.bash_profile $HOME/.bashrc $HOME/.zshrc"
|
502
|
-
fi
|
503
|
-
|
504
|
-
if [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '.' ]] || [[ "${rvm_prefix_path#${rvm_prefix_path%?}}" = '/' ]] ; then
|
505
|
-
rvm_path="${rvm_prefix_path}rvm"
|
506
|
-
else
|
507
|
-
rvm_path="${rvm_prefix_path}/rvm"
|
508
|
-
fi
|
509
|
-
|
510
|
-
rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
|
511
|
-
rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
|
512
|
-
rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
|
513
|
-
rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
|
514
|
-
rvm_gem_path="${rvm_gem_path:-"$rvm_path/gems"}"
|
515
|
-
rvm_config_path="${rvm_config_path:-"$rvm_path/config"}"
|
516
|
-
rvm_temp_path="${rvm_temp_path:-"$rvm_path/tmp"}"
|
517
|
-
|
518
|
-
rvm_ruby_repo_url="${rvm_ruby_repo_url:-"http://svn.ruby-lang.org/repos/ruby"}"
|
519
|
-
# Rubinius sha1's will be available after RC1.
|
520
|
-
rvm_rubinius_repo_url="${rvm_rubinius_repo_url:-"git://github.com/evanphx/rubinius.git"}"
|
521
|
-
rvm_shyouhei_repo_url="${rvm_shyouhei_repo_url:-"git://github.com/shyouhei/ruby.git"}"
|
522
|
-
rvm_jruby_repo_url="${rvm_jruby_repo_url:-"git://kenai.com/jruby~main"}"
|
523
351
|
rvm_ruby_load_path="."
|
524
352
|
rvm_ruby_require=""
|
525
353
|
|
526
354
|
__rvm_clean_path
|
527
355
|
|
528
|
-
rvm_fetch=$(which curl)
|
529
|
-
if [[ $? -ne 0 ]] ; then
|
530
|
-
__rvm_log "fail" "rvm requires curl, which does not seem to exist in your path :("
|
531
|
-
else
|
532
|
-
rvm_fetch="$rvm_fetch -O -L --create-dirs -C - " # -s for silent
|
533
|
-
fi
|
534
|
-
|
535
356
|
rvm_result=$(echo $PATH | grep 'rvm\/bin:')
|
536
357
|
if [[ -z "$rvm_result" ]] ; then
|
537
358
|
PATH=$rvm_bin_path:$PATH ; export PATH
|
@@ -554,9 +375,9 @@ __rvm_update_rvm() {
|
|
554
375
|
__rvm_pushpop "$rvm_src_path"
|
555
376
|
if [[ "head" = "$rvm_ruby_revision" ]] ; then
|
556
377
|
if [[ -d "$rvm_src_path/rvm/.git" ]] ; then
|
557
|
-
cd $rvm_src_path/rvm/ && git pull origin master && ./scripts/install
|
378
|
+
builtin cd $rvm_src_path/rvm/ && git pull origin master && ./scripts/install
|
558
379
|
else
|
559
|
-
cd $rvm_src_path && git clone git://github.com/wayneeseguin/rvm.git && cd rvm/ && ./install
|
380
|
+
builtin cd $rvm_src_path && git clone git://github.com/wayneeseguin/rvm.git && builtin cd rvm/ && ./install
|
560
381
|
fi
|
561
382
|
else
|
562
383
|
# TODO: rvm_install_path:
|
@@ -566,14 +387,14 @@ __rvm_update_rvm() {
|
|
566
387
|
}
|
567
388
|
|
568
389
|
__rvm_reboot() {
|
569
|
-
|
390
|
+
$rvm_scripts_path/log "warn" "Do you wish to reset rvm? ('yes', or 'no')"
|
570
391
|
read response
|
571
392
|
if [[ "yes" = "$response" ]] ; then
|
572
|
-
cd $rvm_path
|
393
|
+
builtin cd $rvm_path
|
573
394
|
__rvm_reset
|
574
395
|
mv $rvm_path/archives ~/.archives
|
575
396
|
if [[ "/" = "$rvm_path" ]] ; then
|
576
|
-
|
397
|
+
$rvm_scripts_path/log "error" "remove '/' ?!... NO!"
|
577
398
|
else
|
578
399
|
if [[ -d "$rvm_path" ]] ; then rm -rf "$rvm_path/" ; fi
|
579
400
|
fi
|
@@ -581,7 +402,7 @@ __rvm_reboot() {
|
|
581
402
|
__rvm_update_rvm
|
582
403
|
source $rvm_path/scripts/rvm
|
583
404
|
else
|
584
|
-
|
405
|
+
$rvm_scripts_path/log "info" "Carry on then..."
|
585
406
|
fi ; unset response
|
586
407
|
}
|
587
408
|
|
@@ -594,25 +415,30 @@ __rvm_ruby_do() {
|
|
594
415
|
elif [[ "system" = "$rvm_ruby_string" ]] && [[ -x "$(which $binary)" ]] ; then
|
595
416
|
binary="$(which $binary)"
|
596
417
|
else
|
597
|
-
|
418
|
+
$rvm_scripts_path/log "warn" "'$binary not found for $rvm_ruby_string' either does not exist or is not executable? :("
|
598
419
|
__rvm_unset_ruby_variables
|
599
420
|
return 1
|
600
421
|
fi
|
601
422
|
|
423
|
+
if [[ ! -z "$rvm_ruby_mode" ]] ; then
|
424
|
+
rvm_ruby_string="$rvm_ruby_string-$rvm_ruby_mode"
|
425
|
+
rvm_ruby_mode="--$(echo $rvm_ruby_mode | sed 's/^m//')"
|
426
|
+
fi
|
427
|
+
|
602
428
|
load_path="$rvm_ruby_home/bin:$rvm_ruby_load_path"
|
603
429
|
# TODO: the else case below should be run if $rvm_ruby_args =~ /\.rb$/
|
604
430
|
if [[ "ruby" = "$binary" ]] && [[ "$rvm_benchmark_flag" -ne 1 ]] ; then
|
605
|
-
if match "$rvm_ruby_args" "\.rb$" ; then
|
431
|
+
if $rvm_scripts_path/match "$rvm_ruby_args" "\.rb$" ; then
|
606
432
|
if [[ -z "$prefix" ]] ; then prefix="-S" ; fi
|
607
|
-
if ! match "$rvm_ruby_args" "$prefix" ; then
|
433
|
+
if ! $rvm_scripts_path/match "$rvm_ruby_args" "$prefix" ; then
|
608
434
|
rvm_ruby_args="$prefix $rvm_ruby_args"
|
609
435
|
fi
|
610
436
|
fi
|
611
|
-
rvm_command="$binary $rvm_ruby_require -I$load_path $rvm_ruby_args"
|
437
|
+
rvm_command="$binary $rvm_ruby_mode $rvm_ruby_require -I$load_path $rvm_ruby_args"
|
612
438
|
elif [[ "gem" = "$binary" ]] && match "$rvm_ruby_args" '^install' ; then
|
613
|
-
rvm_command="$binary $rvm_ruby_args --no-rdoc --no-ri"
|
439
|
+
rvm_command="$binary $rvm_ruby_mode $rvm_ruby_args --no-rdoc --no-ri"
|
614
440
|
else
|
615
|
-
rvm_command="$binary $rvm_ruby_args"
|
441
|
+
rvm_command="$binary $rvm_ruby_mode $rvm_ruby_args"
|
616
442
|
fi
|
617
443
|
|
618
444
|
if [[ ! -z "$rvm_json_flag" ]] || [[ ! -z "$rvm_yaml_flag" ]] || [[ ! -z "$rvm_summary_flag" ]] ; then
|
@@ -620,7 +446,7 @@ __rvm_ruby_do() {
|
|
620
446
|
touch ./log/$rvm_ruby_string/$rvm_action.log ./log/$rvm_ruby_string/$rvm_action.error.log
|
621
447
|
eval "$rvm_command" >> ./log/$rvm_ruby_string/$rvm_action.log 2>> ./log/$rvm_ruby_string/$rvm_action.error.log
|
622
448
|
else
|
623
|
-
echo -e "\n\n\033[0;32m$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v | tr "\n" ' ')\033[0m\n"
|
449
|
+
echo -e "\n\n\033[0;32m$rvm_ruby_string: $($rvm_ruby_home/bin/ruby -v $rvm_ruby_mode | tr "\n" ' ')\033[0m\n"
|
624
450
|
eval "$rvm_command"
|
625
451
|
fi
|
626
452
|
result=$?
|
@@ -693,7 +519,7 @@ __rvm_yaml() {
|
|
693
519
|
total=${#rubies[*]}
|
694
520
|
if [[ ! -z "$ZSH_VERSION" ]] ; then array_start=1 ; else array_start=0 ; fi
|
695
521
|
for (( index = $array_start ; index < $total + $array_start ; index++ )) ; do
|
696
|
-
|
522
|
+
(( $rvm_debug_flag )) && $rvm_scripts_path/log "debug" "${rubies[$index]}: ${statuses[$index]}"
|
697
523
|
yaml="$yaml\n \"${rubies[$index]}\": ${statuses[$index]}"
|
698
524
|
done ; unset index array_start
|
699
525
|
mkdir -p log
|
@@ -712,7 +538,7 @@ __rvm_json() {
|
|
712
538
|
total=${#rubies[*]}
|
713
539
|
if [[ ! -z "$ZSH_VERSION" ]] ; then array_start=1 ; else array_start=0 ; fi
|
714
540
|
for (( index = $array_start ; index < $total + $array_start ; index++ )) ; do
|
715
|
-
|
541
|
+
(( $rvm_debug_flag )) && $rvm_scripts_path/log "debug" "${rubies[$index]}: ${statuses[$index]}"
|
716
542
|
json="$json\n {\"${rubies[$index]}\": ${statuses[$index]}}"
|
717
543
|
if (( $index + 1 < $total + $array_start )) ; then json="$json, " ; fi
|
718
544
|
done ; unset index array_start
|
@@ -770,7 +596,7 @@ __rvm_state() {
|
|
770
596
|
__rvm_inspect() {
|
771
597
|
for binary in $rvm_ruby_args ; do
|
772
598
|
actual_file=$(which $binary)
|
773
|
-
|
599
|
+
$rvm_scripts_path/log "info" "$actual_file:"
|
774
600
|
if [[ ! -z "$rvm_shebang_flag" ]] ; then cat $actual_file | head -n 1 ; fi
|
775
601
|
if [[ ! -z "$rvm_env_flag" ]] ; then cat $actual_file | awk '/ENV/' ; fi
|
776
602
|
if [[ ! -z "$rvm_path_flag" ]] ; then cat $actual_file | awk '/PATH/' ; fi
|
@@ -788,10 +614,11 @@ __rvm_readline_install() {
|
|
788
614
|
__rvm_pushpop $rvm_src_path
|
789
615
|
package="readline" ; version="5.2" ; archive_format="tar.gz"
|
790
616
|
# TODO: Figure out how to list, grab and apply the patches
|
791
|
-
|
792
|
-
|
617
|
+
$rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
|
618
|
+
$rvm_scripts_path/fetch "ftp://ftp.gnu.org/gnu/readline/$package-$version.$archive_format"
|
619
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
|
793
620
|
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
|
794
|
-
cd "$rvm_src_path/$package-$version"
|
621
|
+
builtin cd "$rvm_src_path/$package-$version"
|
795
622
|
if [[ "Darwin" = "$(uname)" ]] ; then
|
796
623
|
#sdk=$(\ls -t /Developer/SDKs/ | head -n 1)
|
797
624
|
#CFLAGS="-isysroot /Developer/SDKs/$sdk -arch i386 -arch x86_64"
|
@@ -810,10 +637,11 @@ __rvm_iconv_install() {
|
|
810
637
|
__rvm_make_flags
|
811
638
|
__rvm_pushpop $rvm_src_path
|
812
639
|
package="libiconv" ; version=1.13.1 ; archive_format="tar.gz"
|
813
|
-
|
814
|
-
|
640
|
+
$rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
|
641
|
+
$rvm_scripts_path/fetch "http://ftp.gnu.org/pub/gnu/libiconv/$package-$version.$archive_format"
|
642
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
|
815
643
|
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
|
816
|
-
cd "$rvm_src_path/$package-$version"
|
644
|
+
builtin cd "$rvm_src_path/$package-$version"
|
817
645
|
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
|
818
646
|
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
|
819
647
|
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
|
@@ -824,30 +652,31 @@ __rvm_curl_install() {
|
|
824
652
|
__rvm_make_flags
|
825
653
|
__rvm_pushpop $rvm_src_path
|
826
654
|
package="curl" ; version=7.19.7 ; archive_format="tar.gz"
|
827
|
-
|
828
|
-
|
655
|
+
$rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
|
656
|
+
$rvm_scripts_path/fetch "http://curl.haxx.se/download/$package-$version.$archive_format"
|
657
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
|
829
658
|
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
|
830
|
-
cd "$rvm_src_path/$package-$version"
|
659
|
+
builtin cd "$rvm_src_path/$package-$version"
|
831
660
|
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
|
832
661
|
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
|
833
662
|
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
|
834
663
|
__rvm_pushpop
|
835
664
|
}
|
836
665
|
|
837
|
-
|
838
666
|
__rvm_openssl_install() {
|
839
667
|
__rvm_make_flags
|
840
|
-
if match "$rvm_archflags" "x86_64" ; then
|
668
|
+
if $rvm_scripts_path/match "$rvm_archflags" "x86_64" ; then
|
841
669
|
openssl_os="os/compiler darwin64-x86_64-cc"
|
842
670
|
else
|
843
671
|
openssl_os="os/compiler darwin-i386-cc"
|
844
672
|
fi
|
845
673
|
__rvm_pushpop $rvm_src_path
|
846
674
|
package="openssl" ; version="0.9.8k" ; archive_format="tar.gz"
|
847
|
-
|
848
|
-
|
675
|
+
$rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
|
676
|
+
$rvm_scripts_path/fetch "http://www.openssl.org/source/$package-$version.tar.gz"
|
677
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
|
849
678
|
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
|
850
|
-
cd "$rvm_src_path/$package-$version"
|
679
|
+
builtin cd "$rvm_src_path/$package-$version"
|
851
680
|
__rvm_run "$package/config" "./config --prefix=$rvm_path/usr zlib no-asm no-krb5 shared" "Configuring $package."
|
852
681
|
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
|
853
682
|
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
|
@@ -858,10 +687,11 @@ __rvm_zlib_install() {
|
|
858
687
|
__rvm_make_flags
|
859
688
|
__rvm_pushpop $rvm_src_path
|
860
689
|
package="zlib" ; version="1.2.3" ; archive_format="tar.gz"
|
861
|
-
|
862
|
-
|
690
|
+
$rvm_scripts_path/log "info" "Retrieving $package-$version.$archive_format"
|
691
|
+
$rvm_scripts_path/fetch "http://www.zlib.net/$package-$version.tar.gz"
|
692
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
|
863
693
|
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package-$version.$archive_format -C $rvm_src_path" "Extracting $package-$version.$archive_format"
|
864
|
-
cd "$rvm_src_path/$package-$version"
|
694
|
+
builtin cd "$rvm_src_path/$package-$version"
|
865
695
|
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr" "Configuring $package."
|
866
696
|
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
|
867
697
|
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
|
@@ -872,10 +702,11 @@ __rvm_ncurses_install() {
|
|
872
702
|
__rvm_make_flags
|
873
703
|
__rvm_pushpop $rvm_src_path
|
874
704
|
package="ncurses" ; version="5.7" ; archive_format="tar.gz"
|
875
|
-
|
876
|
-
|
705
|
+
$rvm_scripts_path/log "info" "Retrieving $package"
|
706
|
+
$rvm_scripts_path/fetch "ftp://invisible-island.net/ncurses/ncurses.tar.gz"
|
707
|
+
result=$? ; if [[ "$result" -gt 0 ]] ; then return $result ; fi
|
877
708
|
__rvm_run "$package/extract" "tar zxf $rvm_archives_path/$package.$archive_format -C $rvm_src_path" "Extracting $package.$archive_format"
|
878
|
-
cd "$rvm_src_path/$package-$version"
|
709
|
+
builtin cd "$rvm_src_path/$package-$version"
|
879
710
|
__rvm_run "$package/configure" "./configure --prefix=$rvm_path/usr --with-shared --disable-rpath --without-debug --without-ada --enable-safe-sprintf --enable-sigwinch --without-progs" "Configuring $package."
|
880
711
|
__rvm_run "$package/make" "/usr/bin/make $rvm_make_flags" "Compiling $package"
|
881
712
|
__rvm_run "$package/make.install" "/usr/bin/make install" "Installing $package to $rvm_path/usr"
|
@@ -980,18 +811,3 @@ array_push() {
|
|
980
811
|
eval "index=\$((\${#${array}[*]} + $__array_start))"
|
981
812
|
eval "${array}[${index}]=${item}"
|
982
813
|
}
|
983
|
-
|
984
|
-
match() {
|
985
|
-
#if [[ ! -z "$BASH_VERSION" ]] && [[ ${BASH_VERSION:0:1} -gt 2 ]] && [[ ${BASH_VERSION:2:1} -ge 1 ]] ; then
|
986
|
-
#[[ "$1" =~ $2 ]] ; return $?
|
987
|
-
# elif [[ ! -z "$ZSH_VERSION"]] && [[ ${ZSH_VERSION:0:1} -gt 3 ]] && [[ ${ZSH_VERSION:2:1} -ge 2 ]] && [[ ${ZSH_VERSION:4:1} -ge 4 ]] ; then
|
988
|
-
# return [[ "$1" =~ "$2" ]]
|
989
|
-
#else
|
990
|
-
if [ ! -z "$(echo "$1" | awk "/${2}/")" ] ; then
|
991
|
-
return 0
|
992
|
-
else
|
993
|
-
return 1
|
994
|
-
fi
|
995
|
-
#fi
|
996
|
-
}
|
997
|
-
|