rvm 0.1.43 → 0.1.44

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.
@@ -1,21 +1,32 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- for rvmrc in /etc/rvmrc $HOME/.rvmrc ; do
4
- if [[ -f "$rvmrc" ]] ; then
5
- if grep -q '^\s*rvm .*$' $rvmrc ; then
6
- printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
7
- exit 1
8
- else
9
- source "$rvmrc"
3
+ if [[ -z "$rvm_ignore_rvmrc" ]]; then
4
+ for rvmrc in /etc/rvmrc "$HOME/.rvmrc" ; do
5
+ if [[ -f "$rvmrc" ]] ; then
6
+ if grep -q '^\s*rvm .*$' "$rvmrc" ; then
7
+ printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
8
+ exit 1
9
+ else
10
+ source "$rvmrc"
11
+ fi
10
12
  fi
11
- fi
12
- done
13
+ done
14
+ fi
15
+
16
+ [[ -z "$rvm_prefix" ]] && unset rvm_prefix
17
+ [[ -z "$rvm_path" ]] && unset rvm_path
13
18
 
14
- if [[ -z "$rvm_prefix" ]] ; then unset rvm_prefix ; fi
15
- if [[ -z "$rvm_path" ]] ; then unset rvm_path ; fi
19
+ # Setup default sandbox value. See scripts/rvm for origin.
20
+ if [[ -z "$rvm_sandboxed" ]]; then
21
+ if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
22
+ rvm_sandboxed=0
23
+ else
24
+ rvm_sandboxed=1
25
+ fi
26
+ fi
16
27
 
17
28
  if [[ -z "$rvm_prefix" ]] ; then
18
- if [[ "root" = "$(whoami)" ]] ; then
29
+ if [[ "$rvm_sandboxed" = "0" ]] ; then
19
30
  rvm_prefix="/usr/local"
20
31
  else
21
32
  rvm_prefix="$HOME/."
@@ -24,7 +35,7 @@ fi
24
35
 
25
36
  if [[ -z "$rvm_path" ]] ; then
26
37
  unset rvm_path
27
- if [[ "root" = "$(whoami)" ]] ; then
38
+ if [[ "$rvm_sandboxed" = "0" ]] ; then
28
39
  rvm_path="$rvm_prefix/rvm"
29
40
  else
30
41
  if [[ -d "$HOME/.rvm" ]] && [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
@@ -38,7 +49,7 @@ if [[ -z "$rvm_path" ]] ; then
38
49
  fi
39
50
 
40
51
  rvm_scripts_path="${rvm_scripts_path:-"$rvm_path/scripts"}"
41
- source $rvm_scripts_path/rvm
52
+ source "$rvm_scripts_path/rvm"
42
53
 
43
54
  unset rvm_interactive
44
55
 
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env bash
2
+
3
+ if [[ -n "$rvm_path" && -s "$rvm_path/scripts/rvm" ]]; then
4
+ source "$rvm_path/scripts/rvm"
5
+ elif [[ -s "/usr/local/lib/rvm" ]]; then
6
+ source "/usr/local/lib/rvm"
7
+ elif [[ -s "$HOME/.rvm/scripts/rvm" ]]; then
8
+ source "$HOME/.rvm/scripts/rvm"
9
+ elif [[ -s "/usr/local/rvm/scripts/rvm" ]]; then
10
+ source "/usr/local/rvm/scripts/rvm"
11
+ else
12
+ echo "Unable to detect rvm, please manually set the rvm_path env variable." >&2
13
+ exit 1
14
+ fi
15
+
16
+ rvm load-rvmrc > /dev/null 2>&1
17
+
18
+ exec ruby "$@"
@@ -25,6 +25,7 @@ if [[ ! -z "$ruby" ]] && [[ ! -z "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; the
25
25
  g|gemset) add "gemset" ;;
26
26
  u|unicode) add "unicode" ;;
27
27
  s|system) add "system" ;;
28
+ -d|--no-default) no_default=1 ;;
28
29
  *) echo "Unrecognized command line option '$token' for $0" ; exit 1 ;;
29
30
  esac
30
31
  done
@@ -38,6 +39,11 @@ if [[ ! -z "$ruby" ]] && [[ ! -z "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; the
38
39
 
39
40
  ruby_string=$(dirname "$ruby" | xargs dirname | xargs basename)
40
41
 
42
+ # Dont' display anything if no default flag was provided and we're using the default ruby
43
+ if [[ -n "$no_default" && "$(rvm tools identifier)" = "$(rvm alias show default)" ]]; then
44
+ exit 0
45
+ fi
46
+
41
47
  if [[ ! -z "$interpreter_flag" ]] || [[ ! -z "$unicode_flag" ]] ; then
42
48
  interpreter="$(echo $ruby_string | awk -F'-' '{print $1}')"
43
49
  fi
@@ -10,22 +10,24 @@ __rvm_shell_lookup_script() {
10
10
  done
11
11
  }
12
12
 
13
- # If the first argument isn't -c, remove it and set
14
- # it to the ruby string value.
15
- if [[ -n "$1" && -n "$(echo "$1" | grep -v '^-')" ]]; then
13
+ # If the first argument isn't -c, remove it and set it to the ruby string value.
14
+ if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | grep -v '^-')" ]]; then
16
15
  rvm_shell_ruby_string="$1"
17
16
  shift
18
17
  fi
19
18
 
20
- if [[ -n "$rvm_shell_ruby_string" ]]; then
21
- rvm_shell_rvm_path="$(__rvm_shell_lookup_script)"
22
- if [[ -n "$rvm_shell_rvm_path" ]]; then
23
- source "$rvm_shell_rvm_path"
24
- rvm "$rvm_shell_ruby_string"
25
- if [[ "$?" -gt 0 ]]; then
26
- echo "Error: RVM was unable to use '#$rvm_shell_ruby_string'" 1>&2
27
- exit 1
28
- fi
19
+ rvm_shell_rvm_path="$(__rvm_shell_lookup_script)"
20
+ if [[ -n "$rvm_shell_rvm_path" ]]; then
21
+ source "$rvm_shell_rvm_path"
22
+ # Setup as expected.
23
+ if [[ -n "$rvm_shell_ruby_string" ]]; then
24
+ rvm "$rvm_shell_ruby_string"
25
+ if [[ "$?" -gt 0 ]]; then
26
+ echo "Error: RVM was unable to use '$rvm_shell_ruby_string'" 1>&2
27
+ exit 1
28
+ fi
29
+ else
30
+ rvm load-rvmrc >/dev/null 2>&1
29
31
  fi
30
32
  fi
31
33
 
@@ -1,6 +1,10 @@
1
1
  #!/usr/bin/env bash
2
- if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
3
- if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
2
+
3
+ if [[ -z "$rvm_ignore_rvmrc" ]]; then
4
+ [[ -s /etc/rvmrc ]] && source /etc/rvmrc
5
+ [[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
6
+ fi
7
+
4
8
  rvm_path="${rvm_path:-$HOME/.rvm}"
5
9
  mkdir -p $rvm_path/src/
6
10
  cd $rvm_path/src
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- if [[ -f /etc/rvmrc ]] ; then source /etc/rvmrc ; fi
4
- if [[ -f "$HOME/.rvmrc" ]] ; then source "$HOME/.rvmrc" ; fi
3
+ if [[ -z "$rvm_ignore_rvmrc" ]]; then
4
+ [[ -s /etc/rvmrc ]] && source /etc/rvmrc
5
+ [[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
6
+ fi
7
+
5
8
  rvm_path="${rvm_path:-$HOME/.rvm}"
6
9
  mkdir -p $rvm_path/src/
7
10
  cd $rvm_path/src
@@ -1,3 +1,10 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- exec sudo -E "$@"
3
+ prefix="PATH='$PATH'"
4
+ if [[ ! -z "$BUNDLE_PATH" ]] ; then prefix="BUNDLE_PATH='$BUNDLE_PATH' $prefix" ; fi
5
+ if [[ ! -z "$GEM_HOME" ]] ; then prefix="GEM_HOME='$GEM_HOME' $prefix" ; fi
6
+ if [[ ! -z "$GEM_PATH" ]] ; then prefix="GEM_PATH='$GEM_PATH' $prefix" ; fi
7
+
8
+ eval "sudo" "/usr/bin/env $prefix $@"
9
+ # rvm_env_prefix="PATH='$PATH'"
10
+ # exec sudo -E /usr/bin/env "$rvm_env_prefix" "$@"
data/config/db CHANGED
@@ -46,7 +46,7 @@ macruby_version=0.6
46
46
  macruby_url=http://www.macruby.org/files
47
47
  macruby_repo_url=git://git.macruby.org/macruby/MacRuby.git
48
48
  macruby_nightly_url=http://www.macruby.org/files/nightlies/macruby_nightly-latest.pkg
49
- maglev_version=23832
49
+ maglev_version=23913
50
50
  maglev_url=http://glass-downloads.gemstone.com/maglev
51
51
  maglev_repo_url=git://github.com/MagLev/maglev.git
52
52
  shyouhei_repo_url=git://github.com/shyouhei/ruby.git
@@ -31,7 +31,7 @@ ree-1.8.6-head
31
31
  ree-1.8.7-head
32
32
 
33
33
  # MagLev
34
- maglev(-23832)
34
+ maglev(-23913)
35
35
  maglev-head
36
36
 
37
37
  # Shyouhei head, the default mput
data/config/md5 CHANGED
@@ -50,7 +50,7 @@ zlib-1.2.3.tar.gz=debc62758716a169df9f62e6ab2bc634
50
50
  curl-7.19.7.tar.gz=ecb2e37e45c9933e2a963cabe03670ab
51
51
  pkg-config-0.23.tar.gz=d922a88782b64441d06547632fd85744
52
52
  ironruby-1.0.zip=7a92888837b3507355ed391dbfc0ab83
53
- GemStone-23832.Darwin-i386.tar.gz=2e5d34c21a064b04103def63d0221149
54
- GemStone-23832.Linux-x86_64.tar.gz=429f81c5c0ec4c8d7188f176b1dc3374
55
- MagLev-23832.Darwin-i386.tar.gz=d9925605f27a2b454aede7b410d99b8b
56
- MagLev-23832.Linux-x86_64.tar.gz=f3f7048a353e1b1724adcecb56d50766
53
+ GemStone-23913.Darwin-i386.tar.gz=8115f487253aa09d38b303e0e49c62b3
54
+ GemStone-23913.Linux-x86_64.tar.gz=bd7832caef3768eb49d39e433366fc2e
55
+ MagLev-23913.Darwin-i386.tar.gz=35c60bfcea8d84e64af01c024c548019
56
+ MagLev-23913.Linux-x86_64.tar.gz=ea8e1096293a652a8a9b00cbe2eda12d
@@ -3,7 +3,7 @@
3
3
  echo "Snapshotting the current environment gem list into snapshot.gems"
4
4
  file_name="snapshot.gems"
5
5
  echo '# system snapshot gemset file' > snapshot.gems
6
- for gem in $(gem list | sed 's#[\(|\)]##g' | sed 's#, #,#g' | tr ' ' ';') ; do
6
+ for gem in $(gem list | sed 's#[\(|\)]##g' | sed 's#, #,#g' | \tr ' ' ';') ; do
7
7
  name="$(echo $gem | awk -F';' '{print $1}')"
8
8
  versions="$(echo $gem | awk -F';' '{print $2}' | sed 's#,# #g')"
9
9
  for version in $versions ; do
@@ -13,10 +13,13 @@ if ! command -v git >/dev/null 2>&1 ; then
13
13
  fi
14
14
 
15
15
  # Load the rvm config.
16
- [[ -s /etc/rvmrc ]] && source /etc/rvmrc
17
- [[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
16
+ if [[ -z "$rvm_ignore_rvmrc" ]]; then
17
+ [[ -s /etc/rvmrc ]] && source /etc/rvmrc
18
+ [[ -s "$HOME/.rvmrc" ]] && source "$HOME/.rvmrc"
19
+ fi
18
20
 
19
21
  rvm_path="${rvm_path:-"/usr/local/rvm"}"
22
+ export rvm_sandboxed=0
20
23
 
21
24
  mkdir -p "$rvm_path/src/"
22
25
  builtin cd "$rvm_path/src"
@@ -27,8 +30,8 @@ git clone --depth 1 git://github.com/wayneeseguin/rvm.git
27
30
 
28
31
  builtin cd rvm
29
32
 
30
- "Running the install script."
31
- bash ./scripts/install
33
+ echo "Running the install script."
34
+ bash ./scripts/install "$@"
32
35
 
33
36
  rvm_group_name="${rvm_group_name:-"rvm"}"
34
37
 
@@ -52,13 +55,12 @@ rm -f /etc/rvmrc
52
55
  touch /etc/rvmrc
53
56
  cat > /etc/rvmrc <<END_OF_RVMRC
54
57
  # Setup default configuration for rvm.
55
- export rvm_path="/usr/local/rvm"
58
+ umask g+w
59
+ export rvm_sandboxed=0
56
60
  export rvm_prefix="/usr/local"
57
- export rvm_bin_path="\$rvm_prefix/bin"
58
- export rvm_man_path="\$rvm_prefix/share/man"
59
61
  END_OF_RVMRC
60
62
 
61
- echo "Generating /etc/load_rvm to load rvm"
63
+ echo "Generating /usr/local/lib/rvm to load rvm"
62
64
  rm -f /usr/local/lib/rvm
63
65
  touch /usr/local/lib/rvm
64
66
  cat > /usr/local/lib/rvm <<END_OF_RVM_SH
@@ -70,10 +72,10 @@ elif [[ -s "/usr/local/rvm/scripts/rvm" ]]; then
70
72
  fi
71
73
  END_OF_RVM_SH
72
74
 
73
- echo "Correct permissions on rvmrc and load_rvm"
75
+ echo "Correct permissions on rvmrc and the rvm loader"
74
76
  # Finally, ensure the rvmrc is owned by the group.
75
77
  for file in /etc/rvmrc /usr/local/lib/rvm ; do
76
- chown root:"$rvm_groop_name" "$file"
78
+ chown root:"$rvm_group_name" "$file"
77
79
  chmod g+w "$file"
78
80
  done; unset file
79
81
 
@@ -1,2 +1 @@
1
1
  rake
2
- rdoc
@@ -1,2 +1 @@
1
1
  rake
2
- rdoc
data/install CHANGED
@@ -1,10 +1,18 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
+ if [[ -z "$rvm_sandboxed" ]]; then
4
+ if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
5
+ export rvm_sandboxed=0
6
+ else
7
+ export rvm_sandboxed=1
8
+ fi
9
+ fi
10
+
3
11
  unset rvm_auto_flag
4
12
 
5
- install_source_path=$(dirname $0)
13
+ install_source_path="$(dirname "$0" | sed 's#\/scripts$##')"
6
14
  if [[ -d "$install_source_path/scripts" ]] && [[ -s "$install_source_path/scripts/utility" ]] ; then
7
- builtin cd $install_source_path
15
+ builtin cd "$install_source_path"
8
16
  fi
9
17
 
10
18
  source scripts/version
@@ -53,7 +61,7 @@ done
53
61
 
54
62
  if [[ -z "$rvm_prefix" ]] ; then
55
63
  __rvm_load_rvmrc
56
- if [[ "root" = "$(whoami)" ]] ; then
64
+ if [[ "$rvm_sandboxed" = "0" ]] ; then
57
65
  rvm_prefix="${rvm_prefix:-"/usr/local/"}"
58
66
  else
59
67
  rvm_prefix="${rvm_prefix:-"$HOME/."}"
@@ -64,7 +72,7 @@ if [[ -z "$rvm_path" ]] ; then rvm_path="${rvm_prefix}rvm" ; fi
64
72
 
65
73
  source scripts/initialize
66
74
 
67
- if grep -q 'scripts/rvm' $HOME/.bash* || grep -q 'scripts/rvm' $HOME/.zsh*; then
75
+ if grep -q 'scripts/rvm' $HOME/.bash* 2>/dev/null || grep -q 'scripts/rvm' $HOME/.zsh* 2>/dev/null; then
68
76
  if [[ -d "$rvm_path" ]] && [[ -s "${rvm_path}/scripts/rvm" ]] ; then
69
77
  export upgrade_flag=1
70
78
  else
@@ -114,7 +122,7 @@ fi
114
122
 
115
123
  spinner
116
124
 
117
- mkdir -p $rvm_archives_path $rvm_src_path $rvm_log_path $rvm_bin_path $rvm_gems_path $rvm_rubies_path $rvm_config_path $rvm_hooks_path $rvm_tmp_path
125
+ mkdir -p "$rvm_archives_path" "$rvm_src_path" "$rvm_log_path" "$rvm_bin_path" "$rvm_gems_path" "$rvm_rubies_path" "$rvm_config_path" "$rvm_hooks_path" "$rvm_tmp_path"
118
126
 
119
127
  for file in README LICENCE ; do
120
128
  spinner
@@ -148,7 +156,7 @@ done
148
156
  # Bin Scripts
149
157
  #
150
158
  # Cleanse and purge...
151
- for file in rvm-prompt rvm rvmsudo rvm-shell ; do
159
+ for file in rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby ; do
152
160
  spinner && perl -e 'sleep 0.2'
153
161
  rm -f "$rvm_bin_path/$file"
154
162
  cp -f "$source_path/binscripts/$file" $rvm_bin_path/
@@ -183,29 +191,30 @@ fi
183
191
  # Initial Interpreter Gemsets.
184
192
  #
185
193
  spinner
186
- mkdir -p "$rvm_gemsets_path"
187
- for gemset_file in $(cd gemsets ; find . -iname '*.gems' | sed 's/^\.\///') ; do
188
- source_path="$(pwd)/gemsets"
189
- destination="$rvm_gemsets_path/$gemset_file"
190
- destination_path="$(dirname "$destination")"
191
- if [[ ! -s "$destination" ]] ; then
192
- mkdir -p "$destination_path"
193
- cp "$source_path/$gemset_file" "$destination"
194
- fi
195
- done ; unset destination destination_path source_path gemset_file
194
+ if [[ -d gemsets/ ]] ; then
195
+ mkdir -p "$rvm_gemsets_path"
196
+ for gemset_file in $(cd gemsets ; find . -iname '*.gems' | sed 's/^\.\///') ; do
197
+ destination="$rvm_gemsets_path/$gemset_file"
198
+ destination_path="$(dirname "$destination")"
199
+ if [[ ! -s "$destination" ]] ; then
200
+ mkdir -p "$destination_path"
201
+ cp "gemsets/$gemset_file" "$destination"
202
+ fi
203
+ done ; unset destination destination_path gemset_file
204
+ fi
196
205
 
197
206
  spinner
198
- mkdir -p "$rvm_patchsets_path"
199
- for patchsets_file in $(cd gemsets ; find . -iname '*' | sed 's/^\.\///') ; do
200
- source_path="$(pwd)/gemsets"
201
- destination="$rvm_patchsets_path/$patchset_file"
202
- destination_path="$(dirname "$destination")"
203
- if [[ ! -s "$destination" ]] ; then
204
- mkdir -p "$destination_path"
205
- cp "$source_path/$patchset_file" "$destination"
206
- fi
207
- done ; unset destination destination_path source_path patchset_file
208
-
207
+ if [[ -d patchsets/ ]] ; then
208
+ mkdir -p "$rvm_patchsets_path"
209
+ for patchset_file in $(cd patchsets ; find . -iname '*' | sed 's/^\.\///') ; do
210
+ destination="$rvm_patchsets_path/$patchset_file"
211
+ destination_path="$(dirname "$destination")"
212
+ if [[ ! -s "$destination" ]] ; then
213
+ mkdir -p "$destination_path"
214
+ cp "patchsets/$patchset_file" "$destination"
215
+ fi
216
+ done ; unset destination destination_path patchset_file
217
+ fi
209
218
 
210
219
  #
211
220
  # Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0.
@@ -276,7 +285,7 @@ fi
276
285
 
277
286
  printf "\n Correct permissions for base binaries in $rvm_bin_path..."
278
287
  mkdir -p $rvm_bin_path
279
- for file in rvm rvmsudo rvm-shell ; do
288
+ for file in rvm rvmsudo rvm-shell rvm-auto-ruby; do
280
289
  [[ -s "$rvm_bin_path/$file" ]] && chmod +x "$rvm_bin_path/$file"
281
290
  done; unset file
282
291
  printf "\n Copying manpages into place."
@@ -285,9 +294,7 @@ for man_file in $(\ls "$install_source_path/man"); do
285
294
  cp -R "$install_source_path/man/$man_file" "$rvm_man_path/"
286
295
  done
287
296
 
288
- if [[ "$upgrade_flag" -eq 0 ]] ; then
289
- ./scripts/notes
290
- fi
297
+ [[ "$upgrade_flag" = 0 ]] && ./scripts/notes
291
298
 
292
299
  name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
293
300
  printf "\n\n${name:-"$(whoami)"},\n"
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 1
4
- :patch: 43
4
+ :patch: 44
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rvm}
8
- s.version = "0.1.43"
8
+ s.version = "0.1.44"
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{2010-07-21}
12
+ s.date = %q{2010-08-06}
13
13
  s.default_executable = %q{rvm-install}
14
14
  s.description = %q{Manages Ruby interpreter environments and switching between them.}
15
15
  s.email = %q{wayneeseguin@gmail.com}
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
21
21
  "LICENCE",
22
22
  "README",
23
23
  "binscripts/rvm",
24
+ "binscripts/rvm-auto-ruby",
24
25
  "binscripts/rvm-prompt",
25
26
  "binscripts/rvm-shell",
26
27
  "binscripts/rvm-update-head",
@@ -100,6 +101,7 @@ Gem::Specification.new do |s|
100
101
  "scripts/disk-usage",
101
102
  "scripts/docs",
102
103
  "scripts/env",
104
+ "scripts/environment-convertor",
103
105
  "scripts/fetch",
104
106
  "scripts/gemsets",
105
107
  "scripts/hash",
@@ -123,6 +125,7 @@ Gem::Specification.new do |s|
123
125
  "scripts/package",
124
126
  "scripts/patches",
125
127
  "scripts/patchsets",
128
+ "scripts/repair",
126
129
  "scripts/rubygems",
127
130
  "scripts/rvm",
128
131
  "scripts/rvm-install",