Permalink
Browse files

Merge branch 'release/1.13.0' into stable

  • Loading branch information...
2 parents 6c7f976 + a0906be commit d21fac71da6925ba921e5f3b2699d42d1f5cc6fa @mpapis mpapis committed Apr 24, 2012
Showing with 140 additions and 126 deletions.
  1. +1 −1 VERSION
  2. +1 −1 binscripts/rvm
  3. +1 −1 binscripts/rvm-auto-ruby
  4. +2 −2 binscripts/rvm-exec
  5. +10 −3 binscripts/rvm-installer
  6. +2 −2 binscripts/rvm-prompt
  7. +2 −2 binscripts/rvm-shell
  8. +1 −1 binscripts/rvmsudo
  9. +1 −0 help/alt.md
  10. +1 −1 scripts/alias
  11. +1 −1 scripts/base
  12. +2 −2 scripts/cli
  13. +1 −1 scripts/completion
  14. +1 −1 scripts/docs
  15. +5 −5 scripts/external
  16. +0 −1 scripts/extras/rails
  17. +2 −2 scripts/functions/build
  18. +0 −1 scripts/functions/cleanup
  19. +1 −1 scripts/functions/developer
  20. +1 −1 scripts/functions/env
  21. +4 −5 scripts/functions/environment
  22. +1 −1 scripts/functions/gemset
  23. +3 −3 scripts/functions/group
  24. +1 −1 scripts/functions/hooks/jruby
  25. +1 −1 scripts/functions/init
  26. +4 −4 scripts/functions/install
  27. +16 −16 scripts/functions/installer
  28. +3 −3 scripts/functions/manage/base
  29. +1 −1 scripts/functions/manage/maglev
  30. +1 −1 scripts/functions/manage/rubinius
  31. +2 −2 scripts/functions/pkg
  32. +8 −8 scripts/functions/rvmrc
  33. +3 −3 scripts/functions/utility
  34. +4 −4 scripts/gemsets
  35. +1 −1 scripts/info
  36. +1 −2 scripts/initialize
  37. +1 −1 scripts/install
  38. +3 −3 scripts/list
  39. +5 −5 scripts/maglev
  40. +2 −2 scripts/migrate
  41. +12 −2 scripts/notes
  42. +2 −2 scripts/repair
  43. +1 −1 scripts/rubygems
  44. +3 −3 scripts/rvm
  45. +1 −1 scripts/rvm-install
  46. +6 −6 scripts/selector
  47. +2 −2 scripts/snapshot
  48. +3 −3 scripts/tools
  49. +1 −1 scripts/update
  50. +5 −5 scripts/upgrade
  51. +3 −3 scripts/zsh/Completion/_rvm
View
2 VERSION
@@ -1 +1 @@
-1.12.5
+1.13.0
View
2 binscripts/rvm
@@ -7,7 +7,7 @@ then
do
if [[ -f "$rvmrc" ]]
then
- if grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "
Error:
View
2 binscripts/rvm-auto-ruby
@@ -8,7 +8,7 @@ then
do
if [[ -f "$rvmrc" ]]
then
- if \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
return 1
View
4 binscripts/rvm-exec
@@ -8,7 +8,7 @@ then
do
if [[ -f "$rvmrc" ]]
then
- if grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "\n Error:
$rvmrc is for rvm settings only.
@@ -49,7 +49,7 @@ __rvm_shell_lookup_script() {
done
}
-if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | \grep -v '^-')" ]]; then
+if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | GREP_OPTIONS="" \grep -v '^-')" ]]; then
rvm_shell_ruby_string="$1"
shift
fi
View
13 binscripts/rvm-installer
@@ -1,5 +1,12 @@
#!/usr/bin/env bash
+if [[ -n "${BASH_VERSION:-}" ]] &&
+ (( 65536 * ${BASH_VERSINFO[0]} + 256 * ${BASH_VERSINFO[1]} + ${BASH_VERSINFO[2]} < 197168 ))
+then
+ echo "BASH 3.2.48 required (you have $BASH_VERSION)"
+ exit 1
+fi
+
shopt -s extglob
PS4="+ \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
export PS4
@@ -17,7 +24,7 @@ else
rvm_tar_command=tar
fi
if [[ ! " ${rvm_tar_options:-} " =~ " --no-same-owner " ]] && \
- $rvm_tar_command --help | \grep -- --no-same-owner >/dev/null
+ $rvm_tar_command --help | GREP_OPTIONS="" \grep -- --no-same-owner >/dev/null
then
rvm_tar_options="${rvm_tar_options:-} --no-same-owner"
rvm_tar_options="${rvm_tar_options## }"
@@ -67,7 +74,7 @@ fetch_version()
curl -s https://api.github.com/repos/wayneeseguin/rvm/tags |
sed -n '/"name": / {s/^.*".*": "\(.*\)".*$/\1/; p;}' |
sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n |
- grep "^${1:-}" | tail -n 1
+ GREP_OPTIONS="" \grep "^${1:-}" | tail -n 1
}
install_release()
@@ -181,7 +188,7 @@ then
do
if [[ -s "$rvmrc" ]]
then
- if \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "
Error: $rvmrc is for rvm settings only.
View
4 binscripts/rvm-prompt
@@ -37,7 +37,7 @@ add_raw_token()
rvm_gemset_separator="${rvm_gemset_separator:-"@"}"
-ruby=$( builtin command -v ruby | grep -v $rvm_path/bin/ruby )
+ruby=$( builtin command -v ruby | GREP_OPTIONS="" \grep -v $rvm_path/bin/ruby )
if [[ -n "$ruby" && -n "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; then
@@ -193,7 +193,7 @@ if [[ -n "$ruby" && -n "$(echo "$ruby" | awk '/rvm/{print}')" ]] ; then
esac
- if echo "$ruby_string" | \grep '-head' >/dev/null 2>&1 ; then
+ if echo "$ruby_string" | GREP_OPTIONS="" \grep '-head' >/dev/null 2>&1 ; then
unicode="${unicode}"
View
4 binscripts/rvm-shell
@@ -8,7 +8,7 @@ then
do
if [[ -f "$rvmrc" ]]
then
- if \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
return 1
@@ -58,7 +58,7 @@ case $0 in
esac
selected_shell="$(basename "${selected_shell}")"
-if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | \grep -v '^-')" ]]
+if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | GREP_OPTIONS="" \grep -v '^-')" ]]
then
rvm_shell_ruby_string="$1"
shift
View
2 binscripts/rvmsudo
@@ -43,7 +43,7 @@ done
if [[ $# -gt 0 ]]
then
- eval command sudo \"\${sudo_args[@]}\" /usr/bin/env $(/usr/bin/env | grep -E '^rvm|^gemset|^PATH|^IRBRC|RUBY|GEM' | sed 's/=\(.*\)$/="\1"/' ) \"\$@\"
+ eval command sudo \"\${sudo_args[@]}\" /usr/bin/env $(/usr/bin/env | GREP_OPTIONS="" \grep -E '^rvm|^gemset|^PATH|^IRBRC|RUBY|GEM' | sed 's/=\(.*\)$/="\1"/' ) \"\$@\"
else
printf "%b" "Usage:\n $0 [--trace] [--verbose] [sudo-options] command [command-options]\n"
fi
View
1 help/alt.md
@@ -8,6 +8,7 @@ Other implementations allowing to switch ruby environment:
- https://github.com/niw/rubies
- https://github.com/hmans/rbfu
- https://github.com/sam/rb-switch
+- https://github.com/nkryptic/sandbox
- https://github.com/sstephenson/rbenv
- https://github.com/cpetschnig/switch-ruby
- https://github.com/mugenken/p5-Ruby-VersionManager (Perl!)
View
2 scripts/alias
@@ -252,7 +252,7 @@ result=0
if [[ ! -f "$rvm_path/config/alias" ]] ; then touch "$rvm_path/config/alias" ; fi
-if printf "%b" "$alias_name" | grep "${rvm_gemset_separator:-"@"}" >/dev/null 2>&1 ; then
+if printf "%b" "$alias_name" | GREP_OPTIONS="" \grep "${rvm_gemset_separator:-"@"}" >/dev/null 2>&1 ; then
gemset_name="${alias_name/*${rvm_gemset_separator:-"@"}/}"
alias_name="${alias_name/${rvm_gemset_separator:-"@"}*/}"
else
View
2 scripts/base
@@ -42,7 +42,7 @@ then
do
if [[ -f "$rvmrc" ]]
then
- if \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "
Error:
View
4 scripts/cli
@@ -826,7 +826,7 @@ rvm()
do
if [[ -f "$rvmrc" ]]
then
- if \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "
Error:
@@ -1057,7 +1057,7 @@ Please do one of the following:
rvm_error "Could not detect ruby version/name for installation, please be more specific."
false #report error
- elif (( ${rvm_force_flag:-0} == 0 )) && "$rvm_scripts_path"/list strings | grep "^${selected_ruby}$" > /dev/null
+ elif (( ${rvm_force_flag:-0} == 0 )) && "$rvm_scripts_path"/list strings | GREP_OPTIONS="" \grep "^${selected_ruby}$" > /dev/null
then
rvm_log "Already installed ${selected_ruby}.
To reinstall use:
View
2 scripts/completion
@@ -34,7 +34,7 @@ __rvm_rubies ()
__rvm_gemsets ()
{
- echo "$(rvm gemset list | \grep -v gemset 2>/dev/null)"
+ echo "$(rvm gemset list | GREP_OPTIONS="" \grep -v gemset 2>/dev/null)"
}
__rvm_help_pages ()
View
2 scripts/docs
@@ -97,7 +97,7 @@ generate_rdoc()
rvm_log "( Errors will be logged to ${rvm_log_path}/$rvm_docs_ruby_string/docs.log )"
- if gem list | \grep ^hanna >/dev/null 2>&1
+ if gem list | GREP_OPTIONS="" \grep ^hanna >/dev/null 2>&1
then
hanna -o "${rvm_docs_path:-"$rvm_path/docs"}/$rvm_docs_ruby_string/$rvm_docs_type" --inline-source --line-numbers --fmt=html > /dev/null 2>> "${rvm_log_path}/$rvm_docs_ruby_string/docs.log"
View
10 scripts/external
@@ -10,7 +10,7 @@ external_automount()
)
}
-external_grep_existing()
+external_GREP_OPTIONS="" \grep_existing()
{
typeset IFS
typeset -a existing
@@ -27,7 +27,7 @@ external_grep_existing()
: existing:${existing[@]}:
if (( ${#existing[@]} > 0 ))
then
- grep -vE "${existing[@]}" -
+ GREP_OPTIONS="" \grep -vE "${existing[@]}" -
else
cat -
fi
@@ -48,7 +48,7 @@ external_mount_uniq()
then
"${ruby_path}" -rrbconfig -e "puts RbConfig::CONFIG['prefix']" 2>/dev/null
fi
- done | sort -u | external_grep_existing
+ done | sort -u | external_GREP_OPTIONS="" \grep_existing
) )
if (( ${#ruby_paths[@]} == 0 ))
@@ -67,11 +67,11 @@ external_mount()
{
typeset path ruby_path prefix_path
path="$1"
- if [[ ! -d "${path}" && -x "${path}" ]] && "${path}" --version | grep rub >/dev/null
+ if [[ ! -d "${path}" && -x "${path}" ]] && "${path}" --version | GREP_OPTIONS="" \grep rub >/dev/null
then
ruby_path="${path}"
prefix_path="$("${path}" -rrbconfig -e "puts RbConfig::CONFIG['prefix']")"
- elif [[ -d "${path}" && -x "${path}/bin/ruby" ]] && "${path}/bin/ruby" --version | grep rub >/dev/null
+ elif [[ -d "${path}" && -x "${path}/bin/ruby" ]] && "${path}/bin/ruby" --version | GREP_OPTIONS="" \grep rub >/dev/null
then
ruby_path="${path}/bin/ruby"
prefix_path="$("${ruby_path}" -rrbconfig -e "puts RbConfig::CONFIG['prefix']")"
View
1 scripts/extras/rails
@@ -26,7 +26,6 @@
enable_extendglob() {
if [[ -n "${ZSH_VERSION:-}" ]] ; then
- emulate -L zsh
setopt extendedglob
else
if [[ -n "${BASH_VERSION:-}" ]] ; then
View
4 scripts/functions/build
@@ -28,7 +28,7 @@ __rvm_compiler_is_llvm()
typeset compiler
if compiler=$(__rvm_found_compiler)
then
- $compiler --version | grep -i llvm >/dev/null
+ $compiler --version | GREP_OPTIONS="" \grep -i llvm >/dev/null
else
return 1
fi
@@ -135,7 +135,7 @@ __rvm_mri_rubies()
for _ruby in $( find $rvm_rubies_path/ -maxdepth 1 -mindepth 1 -type d -not -type l )
do
printf "%b" "${_ruby##*/}\n"
- done | grep -E "$versions"
+ done | GREP_OPTIONS="" \grep -E "$versions"
}
# Returns the first mri compatible (partly) ruby for use
View
1 scripts/functions/cleanup
@@ -12,7 +12,6 @@ __rvm_rm_rf()
#NOTE: RVM Requires extended globbing shell feature turned on.
if [[ -n "${ZSH_VERSION:-}" ]]
then
- emulate -L zsh # setopts should only be local
setopt extendedglob
else
if [[ -n "${BASH_VERSION:-}" ]]
View
2 scripts/functions/developer
@@ -35,7 +35,7 @@ rvmselect()
ln -fs "${rvm_path}.${name}" "${rvm_path}"
- ls -al "$(basename "${rvm_path}")" | grep "$rvm_path" | awk '/rvm/{print "=> "$NF}'
+ ls -al "$(basename "${rvm_path}")" | GREP_OPTIONS="" \grep "$rvm_path" | awk '/rvm/{print "=> "$NF}'
return $?
}
View
2 scripts/functions/env
@@ -45,7 +45,7 @@ __rvm_cleanse_variables()
# Add bin path if not present
__rvm_conditionally_add_bin_path()
{
- if printf "%b" "${PATH//:/ }" | \grep -vF "${rvm_bin_path}" >/dev/null 2>&1
+ if printf "%b" "${PATH//:/ }" | GREP_OPTIONS="" \grep -vF "${rvm_bin_path}" >/dev/null 2>&1
then
case "${rvm_ruby_string:-"system"}" in
system)
View
9 scripts/functions/environment
@@ -88,7 +88,7 @@ __rvm_ensure_has_environment_files()
\mkdir -p "$rvm_environments_path"
fi
- if [[ ! -s "$file_name" ]] || ! grep 'rvm_env_string=' "$file_name" >/dev/null
+ if [[ ! -s "$file_name" ]] || ! GREP_OPTIONS="" \grep 'rvm_env_string=' "$file_name" >/dev/null
then
rm -f "$file_name"
printf "%b" \
@@ -241,17 +241,17 @@ __rvm_setup()
then
export rvm_zsh_clobber rvm_zsh_nomatch
# Set clobber for zsh users, for compatibility with bash's append operator ( >> file ) behavior
- if setopt | \grep -s '^noclobber$' >/dev/null 2>&1
+ if setopt | GREP_OPTIONS="" \grep -s '^noclobber$' >/dev/null 2>&1
then rvm_zsh_clobber=0
else rvm_zsh_clobber=1
fi
setopt clobber
# Set no_nomatch so globs that don't match any files don't print out a warning
- if setopt | \grep -s '^nonomatch$' >/dev/null 2>&1
+ if setopt | GREP_OPTIONS="" \grep -s '^nonomatch$' >/dev/null 2>&1
then rvm_zsh_nomatch=0
else rvm_zsh_nomatch=1
fi
- setopt no_nomatch # TODO: changing a user's options isn't polite.
+ setopt no_nomatch
fi
}
@@ -281,7 +281,6 @@ __rvm_teardown()
if [[ -n "${ZSH_VERSION:-""}" ]]
then
- emulate -L zsh
# If rvm_zsh_clobber is 0 then "setopt" contained "noclobber" before rvm performed "setopt clobber".
(( rvm_zsh_clobber == 0 )) && setopt noclobber
# If rvm_zsh_nomatch is 0 then "setopt" contained "nonomatch" before rvm performed "setopt nonomatch".
View
2 scripts/functions/gemset
@@ -19,7 +19,7 @@ __rvm_current_gemset()
__rvm_using_gemset_globalcache()
{
"$rvm_scripts_path/db" "$rvm_user_path/db" \
- "use_gemset_globalcache" | \grep '^true$' >/dev/null 2>&1
+ "use_gemset_globalcache" | GREP_OPTIONS="" \grep '^true$' >/dev/null 2>&1
return $?
}
View
6 scripts/functions/group
@@ -36,16 +36,16 @@ setup_rvm_group_users()
{
case "$(uname)" in
"Darwin")
- usernames=$(dscl . -search /Users PrimaryGroupID 20 | grep PrimaryGroupID | cut -f 1)
+ usernames=$(dscl . -search /Users PrimaryGroupID 20 | GREP_OPTIONS="" \grep PrimaryGroupID | cut -f 1)
;;
*)
- usernames=($(grep -xF -f <(cat /etc/passwd | cut -d: -f1) <(find /home -mindepth 1 -maxdepth 1 -type d | cut -d '/' -f 3)))
+ usernames=($(GREP_OPTIONS="" \grep -xF -f <(cat /etc/passwd | cut -d: -f1) <(find /home -mindepth 1 -maxdepth 1 -type d | cut -d '/' -f 3)))
;;
esac
for user in ${usernames[@]}
do
- if ! groups "$user" | grep 'rvm' >/dev/null 2>&1
+ if ! groups "$user" | GREP_OPTIONS="" \grep 'rvm' >/dev/null 2>&1
then
printf "%b" "Ensuring '$user' is in group '$rvm_group_name'\n"
add_user_to_rvm_group $user
View
2 scripts/functions/hooks/jruby
@@ -4,7 +4,7 @@ export JRUBY_OPTS
jruby_ngserver_is_running()
{
- ps auxww | grep '[c]om.martiansoftware.nailgun.NGServer' >/dev/null
+ ps auxww | GREP_OPTIONS="" \grep '[c]om.martiansoftware.nailgun.NGServer' >/dev/null
}
jruby_ngserver_start()
View
2 scripts/functions/init
@@ -13,7 +13,7 @@ __rvm_load_rvmrc()
do
if [[ -s "$_file" ]]
then
- if \grep '^\s*rvm .*$' "$_file" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$_file" >/dev/null 2>&1
then
rvm_error "
$_file is for rvm settings only.
View
8 scripts/functions/install
@@ -17,7 +17,7 @@ __rvm_record_install()
\rm -f "$rvm_install_record_file.tmp"
- \grep -v "^$recorded_ruby_name " < "$rvm_install_record_file" \
+ GREP_OPTIONS="" \grep -v "^$recorded_ruby_name " < "$rvm_install_record_file" \
> "$rvm_install_record_file.tmp"
echo "$rvm_install_command" >> "$rvm_install_record_file.tmp"
@@ -41,7 +41,7 @@ __rvm_remove_install_record()
\mv "$rvm_install_record_file" "$rvm_install_record_file.tmp"
- \grep -v "^$recorded_ruby_name " < "$rvm_install_record_file.tmp" \
+ GREP_OPTIONS="" \grep -v "^$recorded_ruby_name " < "$rvm_install_record_file.tmp" \
> "$rvm_install_record_file"
\rm -f "$rvm_install_record_file.tmp"
@@ -62,9 +62,9 @@ __rvm_recorded_install_command()
recorded_ruby_match="^$recorded_ruby_name "
if [[ -s "$rvm_user_path/installs" ]] \
- && \grep "$recorded_ruby_match" "$rvm_user_path/installs" >/dev/null 2>&1 ; then
+ && GREP_OPTIONS="" \grep "$recorded_ruby_match" "$rvm_user_path/installs" >/dev/null 2>&1 ; then
- \grep "$recorded_ruby_match" < "$rvm_user_path/installs" | head -n1
+ GREP_OPTIONS="" \grep "$recorded_ruby_match" < "$rvm_user_path/installs" | head -n1
else
return 1
View
32 scripts/functions/installer
@@ -103,7 +103,7 @@ determine_install_path()
do
if [[ -f "$rvmrc" ]]
then
- if \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
return 1
@@ -271,9 +271,9 @@ install_rvm_hooks()
__rvm_rm_rf "$rvm_path/$entry"
fi
# Source is first level hook (after_use) and target is custom user hook, preserve it
- if echo "$entry" | \grep -E '^hooks/[[:alpha:]]+_[[:alpha:]]+$' >/dev/null &&
+ if echo "$entry" | GREP_OPTIONS="" \grep -E '^hooks/[[:alpha:]]+_[[:alpha:]]+$' >/dev/null &&
[[ -f "$rvm_path/$entry" ]] &&
- ! grep "$(basename ${entry})_\*" "$rvm_path/$entry" >/dev/null
+ ! GREP_OPTIONS="" \grep "$(basename ${entry})_\*" "$rvm_path/$entry" >/dev/null
then
mv -f "$rvm_path/$entry" "$rvm_path/${entry}_custom"
fi
@@ -302,7 +302,7 @@ install_rvm_hooks()
#fix broken copy of after_use to after_use_custom
if [[ -f "$rvm_path/hooks/after_use_custom" ]] &&
- grep "after_use_\*" "$rvm_path/hooks/after_use_custom" >/dev/null
+ GREP_OPTIONS="" \grep "after_use_\*" "$rvm_path/hooks/after_use_custom" >/dev/null
then
rm -f "$rvm_path/hooks/after_use_custom"
fi
@@ -346,7 +346,7 @@ setup_configuration_files()
fi
# Prune old (keyed-by-hash) trust entries
- grep '^_' user/rvmrcs > user/rvmrcs.new || true
+ GREP_OPTIONS="" \grep '^_' user/rvmrcs > user/rvmrcs.new || true
mv user/rvmrcs.new user/rvmrcs
popd >/dev/null
@@ -520,9 +520,9 @@ cleanse_old_environments()
then
for file in "${environments[@]}"
do
- if grep 'BUNDLE_PATH' "$file" > /dev/null 2>&1
+ if GREP_OPTIONS="" \grep 'BUNDLE_PATH' "$file" > /dev/null 2>&1
then
- grep -v 'BUNDLE_PATH' "$file" > "$file.new"
+ GREP_OPTIONS="" \grep -v 'BUNDLE_PATH' "$file" > "$file.new"
mv "$file.new" "$file"
fi
done
@@ -571,7 +571,7 @@ migrate_defaults()
# Move from legacy defaults to the new, alias based system.
if [[ -s "$rvm_path/config/default" ]]
then
- original_version="$(basename "$(grep GEM_HOME "$rvm_path/config/default" \
+ original_version="$(basename "$(GREP_OPTIONS="" \grep GEM_HOME "$rvm_path/config/default" \
| awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator:-"@"}#")")"
if [[ -n "$original_version" ]]
@@ -727,7 +727,7 @@ setup_rvm_group()
else __group_params=( ${__group_params} )
fi
- if \grep "$rvm_group_name" /etc/group >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep "$rvm_group_name" /etc/group >/dev/null 2>&1
then
echo " RVM system user group '$rvm_group_name' exists, proceeding with installation."
else
@@ -879,15 +879,15 @@ fi
fi
if (( add_to_profile_flag )) &&
- ! grep "source ${etc_profile_file}" /etc/profile >/dev/null 2>&1
+ ! GREP_OPTIONS="" \grep "source ${etc_profile_file}" /etc/profile >/dev/null 2>&1
then
printf "%b" "\nsource ${etc_profile_file}\n" >> /etc/profile
fi
for zshrc_file in $( find /etc/ -name zshrc -type f 2>/dev/null || true )
do
- if ! grep "source /etc/bash" "${zshrc_file}" &&
- ! grep "source /etc/profile" "${zshrc_file}"
+ if ! GREP_OPTIONS="" \grep "source /etc/bash" "${zshrc_file}" &&
+ ! GREP_OPTIONS="" \grep "source /etc/profile" "${zshrc_file}"
then
printf "%b" "\nsource ${etc_profile_file}\n" >> $zshrc_file
fi
@@ -901,7 +901,7 @@ setup_rvmrc()
if (( UID == 0 ))
then
rvmrc_file="/etc/rvmrc"
- if ! grep 'umask g+w' $rvmrc_file >/dev/null 2>&1
+ if ! GREP_OPTIONS="" \grep 'umask g+w' $rvmrc_file >/dev/null 2>&1
then
echo 'umask g+w' >> $rvmrc_file
fi
@@ -943,14 +943,14 @@ setup_user_profile()
for profile_file in ${search_list[@]}
do
[[ -f $profile_file ]] &&
- \grep PATH=.*\$HOME/.rvm/bin $profile_file >/dev/null &&
+ GREP_OPTIONS="" \grep PATH=.*\$HOME/.rvm/bin $profile_file >/dev/null &&
found_rc+=( $profile_file ) || true
[[ -f $profile_file ]] && { {
- \grep \..*scripts/rvm $profile_file >/dev/null &&
+ GREP_OPTIONS="" \grep \..*scripts/rvm $profile_file >/dev/null &&
found_login+=( $profile_file )
} || {
- \grep source.*scripts/rvm $profile_file >/dev/null &&
+ GREP_OPTIONS="" \grep source.*scripts/rvm $profile_file >/dev/null &&
found_login+=( $profile_file )
} } || true
done
View
6 scripts/functions/manage/base
@@ -57,7 +57,7 @@ __rvm_apply_patches()
# If set, extract the patch level from the patch name.
patch_level=1
- if echo "$patch_name" | \grep "$patch_level_separator" >/dev/null 2>&1; then
+ if echo "$patch_name" | GREP_OPTIONS="" \grep "$patch_level_separator" >/dev/null 2>&1; then
patch_level=${patch_name//*${patch_level_separator}/}
patch_name="${patch_name//${patch_level_separator}*/}"
fi
@@ -303,7 +303,7 @@ __rvm_install_ruby()
rvm_error "
The used ruby name (-n) is not valid, it was matched as:
-$( env | grep "^rvm.*=$__rvm_ruby_name$" || printf "# Was not used at all\n")
+$( env | GREP_OPTIONS="" \grep "^rvm.*=$__rvm_ruby_name$" || printf "# Was not used at all\n")
for more details on selecting names please visit:
https://rvm.io/rubies/named/
@@ -584,7 +584,7 @@ __rvm_fetch_ruby()
true ${rvm_ruby_url:="$rvm_ruby_repo_url"}
- if echo "$rvm_ruby_url" | grep 'git' >/dev/null 2>&1
+ if echo "$rvm_ruby_url" | GREP_OPTIONS="" \grep 'git' >/dev/null 2>&1
then # Using a git url.
case "$rvm_ruby_interpreter" in
ruby)
View
2 scripts/functions/manage/maglev
@@ -38,7 +38,7 @@ maglev_install()
then
builtin cd "${rvm_src_path}/$rvm_ruby_string"
- rvm_gemstone_package_file="GemStone-$(\grep ^GEMSTONE version.txt | cut -f2 -d-).${system}-${arch}"
+ rvm_gemstone_package_file="GemStone-$(GREP_OPTIONS="" \grep ^GEMSTONE version.txt | cut -f2 -d-).${system}-${arch}"
rvm_gemstone_url="$maglev_url/${rvm_gemstone_package_file}.${rvm_archive_extension}"
fi
View
2 scripts/functions/manage/rubinius
@@ -8,7 +8,7 @@ file_exists_at_url()
then
( #subshell to be able to temporary disable curl function
unset curl 2>/dev/null
- if curl -slk --head ${_url} 2>&1 | \head -n 1 | \grep '200 OK' >/dev/null 2>&1
+ if curl -slk --head ${_url} 2>&1 | \head -n 1 | GREP_OPTIONS="" \grep '200 OK' >/dev/null 2>&1
then
return 0
else
View
4 scripts/functions/pkg
@@ -69,7 +69,7 @@ install_package()
then
if [[ -z "${rvm_autoconf_flags:-}" ]]
then
- if uname -s | grep -iE 'cygwin|mingw' >/dev/null
+ if uname -s | GREP_OPTIONS="" \grep -iE 'cygwin|mingw' >/dev/null
then # no symlinks on windows :(
rvm_autoconf_flags="-ivf"
else
@@ -251,7 +251,7 @@ libyaml_installed()
{
typeset path
path="${prefix_path:-${rvm_usr_path:-${rvm_path}/usr}}"
- [[ -f "${path}/include/yaml.h" ]] && \find "${path}" -name libyaml.so | \grep '.*' >/dev/null
+ [[ -f "${path}/include/yaml.h" ]] && \find "${path}" -name libyaml.so | GREP_OPTIONS="" \grep '.*' >/dev/null
}
glib()
View
16 scripts/functions/rvmrc
@@ -527,7 +527,7 @@ __rvm_load_project_config()
for _gem in ${_gem_names//,/ }
do
# TODO: add support for versions
- if ! gem list | \grep "^${_gem} " > /dev/null
+ if ! gem list | GREP_OPTIONS="" \grep "^${_gem} " > /dev/null
then gem install "${_gem}"
fi
done
@@ -564,7 +564,7 @@ __rvm_load_project_config()
if [[ "${rvm_autoinstall_bundler_flag:-0}" == "1" ]]
then
_bundler_version="$(sed -n '/^#ruby-bundler-version=/ {s/#ruby-bundler-version=//;p;}' < "$1")"
- if ! gem list | \grep "^bundler " | \grep "${_bundler_version}" > /dev/null
+ if ! gem list | GREP_OPTIONS="" \grep "^bundler " | \grep "${_bundler_version}" > /dev/null
then
[[ -z "${_bundler_version}" ]] || _bundler_version=" -v ${_bundler_version}"
gem install "bundler${_bundler_version}"
@@ -590,7 +590,7 @@ __rvm_load_project_config()
if [[ "${rvm_autoinstall_bundler_flag:-0}" == 1 && -f "$(dirname $1)/Gemfile" ]]
then
_bundler_version="$(sed -n '/^#ruby-bundler-version=/ {s/#ruby-bundler-version=//;p;}' < "$1")".strip
- if ! gem list | \grep "^bundler " | \grep "${_bundler_version}" > /dev/null
+ if ! gem list | GREP_OPTIONS="" \grep "^bundler " | \grep "${_bundler_version}" > /dev/null
then
[[ -z "${_bundler_version}" ]] || _bundler_version=" -v ${_bundler_version}"
gem install "bundler${_bundler_version}"
@@ -606,7 +606,7 @@ __rvm_load_project_config()
esac
if [[ -n "${__gemfile:-}" && -f "${__gemfile:-}" ]]
- then bundle install --gemfile="${__gemfile}" | grep -vE '^Using|Your bundle is complete'
+ then bundle install --gemfile="${__gemfile}" | GREP_OPTIONS="" \grep -vE '^Using|Your bundle is complete'
fi
}
@@ -744,7 +744,7 @@ fi
# filename=\".gems\"
# if [[ -s \"\$filename\" ]]
# then
-# rvm gemset import \"\$filename\" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
+# rvm gemset import \"\$filename\" | GREP_OPTIONS="" \grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
# fi
" >> .rvmrc
done
@@ -754,15 +754,15 @@ fi
# If you use bundler, this might be useful to you:
# if [[ -s Gemfile ]] && {
# ! builtin command -v bundle >/dev/null ||
-# builtin command -v bundle | grep \$rvm_path/bin/bundle >/dev/null
+# builtin command -v bundle | GREP_OPTIONS="" \grep \$rvm_path/bin/bundle >/dev/null
# }
# then
# printf \"%b\" \"The rubygem 'bundler' is not installed. Installing it now.\\\\n\"
# gem install bundler
# fi
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
# then
-# bundle install | grep -vE '^Using|Your bundle is complete'
+# bundle install | GREP_OPTIONS="" \grep -vE '^Using|Your bundle is complete'
# fi
" >> .rvmrc
fi
@@ -782,7 +782,7 @@ __rvm_project_dir_check()
[[ -f "$1/.rbenv-version" && -s "$1/.rbenv-version" ]] ||
{
[[ -f "$1/Gemfile" && -s "$1/Gemfile" ]] &&
- \grep "^#ruby=" "$1/Gemfile" >/dev/null
+ GREP_OPTIONS="" \grep "^#ruby=" "$1/Gemfile" >/dev/null
}
}
}
View
6 scripts/functions/utility
@@ -8,7 +8,7 @@ else
fi
if [[ ! " ${rvm_tar_options:-} " =~ " --no-same-owner " ]] && \
- $rvm_tar_command --help | \grep -- --no-same-owner >/dev/null
+ $rvm_tar_command --help | GREP_OPTIONS="" \grep -- --no-same-owner >/dev/null
then
rvm_tar_options="${rvm_tar_options:-} --no-same-owner"
rvm_tar_options="${rvm_tar_options## }"
@@ -339,8 +339,8 @@ __rvm_version_compare()
counter=1
IFS="+" # to put + in transformer ;)
- v1d=$( printf -- $1 | \grep -o '\.' | wc -l )
- v2d=$( printf -- $3 | \grep -o '\.' | wc -l )
+ v1d=$( printf -- $1 | GREP_OPTIONS="" \grep -o '\.' | wc -l )
+ v2d=$( printf -- $3 | GREP_OPTIONS="" \grep -o '\.' | wc -l )
if [[ $v1d -ge $v2d ]]
then dots=$v1d
View
8 scripts/gemsets
@@ -46,7 +46,7 @@ gemset_update()
rvm_ruby_strings="$(
builtin cd "${rvm_gems_path:-"$rvm_path/gems"}" ;
find . -maxdepth 1 -mindepth 1 -type d -print 2>/dev/null \
- | grep -v '^\(doc\|cache\|@\|system\)' | \tr '\n' ','
+ | GREP_OPTIONS="" \grep -v '^\(doc\|cache\|@\|system\)' | \tr '\n' ','
)"
rvm_ruby_strings="${rvm_ruby_strings/%,}"
rvm_ruby_strings="${rvm_ruby_strings//.\/}"
@@ -694,7 +694,7 @@ __rvm_parse_gems_args()
gem="${gems_args/;*}"
gem_prefix=""
- if echo "$gems_args" | grep ';' >/dev/null 2>&1
+ if echo "$gems_args" | GREP_OPTIONS="" \grep ';' >/dev/null 2>&1
then
gem_prefix="${gems_args/*;}"
fi
@@ -848,7 +848,7 @@ gemset_info()
{
if (( ${rvm_user_flag:-0} == 1 ))
then
- (__rvm_use system ; gem env | grep "\- $HOME" | awk '{print $NF}')
+ (__rvm_use system ; gem env | GREP_OPTIONS="" \grep "\- $HOME" | awk '{print $NF}')
elif [[ ${rvm_system_flag:-0} == 1 ]]
then
(__rvm_use system ; gem env $action system)
@@ -1045,7 +1045,7 @@ rvm_sticky_flag=1
if [[ -z "$rvm_ruby_string" ]]
then
- if echo "${GEM_HOME:-""}" | grep "${rvm_path}" >/dev/null 2>&1
+ if echo "${GEM_HOME:-""}" | GREP_OPTIONS="" \grep "${rvm_path}" >/dev/null 2>&1
then
rvm_ruby_string="${GEM_HOME##*/}"
rvm_ruby_string="${rvm_ruby_string%%@*}"
View
2 scripts/info
@@ -154,7 +154,7 @@ $(__rvm_version)
for file_name in "$HOME/.bashrc" "$HOME/.bash_profile" "$HOME/.zshenv" ; do
if [[ -s "$file_name" ]] ; then
- rvm_info="$rvm_info\n$file_name:\n$(\grep 'rvm' "$file_name" 2>/dev/null || true)"
+ rvm_info="$rvm_info\n$file_name:\n$(GREP_OPTIONS="" \grep 'rvm' "$file_name" 2>/dev/null || true)"
fi
done
View
3 scripts/initialize
@@ -28,7 +28,6 @@ then
shopt -s extglob
elif [[ -n "${ZSH_VERSION:-}" ]]
then
- emulate -L zsh
setopt extendedglob
setopt kshglob
setopt no_glob_subst
@@ -59,7 +58,7 @@ then
do
if [[ -f "$rvmrc" ]]
then
- if \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "
Error:
View
2 scripts/install
@@ -66,7 +66,7 @@ do
set -o xtrace
export rvm_trace_flag=1
echo "$@"
- env | grep '^rvm_'
+ env | GREP_OPTIONS="" \grep '^rvm_'
export PS4="+ \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
;;
(--help)
View
6 scripts/list
@@ -51,7 +51,7 @@ list_gemsets()
continue
fi
- if printf "%b" "$version" | grep '^jruby-' >/dev/null 2>&1
+ if printf "%b" "$version" | GREP_OPTIONS="" \grep '^jruby-' >/dev/null 2>&1
then
string="[ $("$rvm_rubies_path/$ruby_version_name/bin/ruby" -v | awk '{print $NF}' | sed -e 's/\[//' -e 's/\]//') ]"
@@ -83,7 +83,7 @@ list_gemsets()
if [[ -f "$rvm_path/config/default" && -s "$rvm_path/config/default" ]]
then
version=$(
- grep 'MY_RUBY_HOME' "$rvm_path/config/default" | head -1 | awk -F"'" '{print $2}' | xargs basename --
+ GREP_OPTIONS="" \grep 'MY_RUBY_HOME' "$rvm_path/config/default" | head -1 | awk -F"'" '{print $2}' | xargs basename --
)
if [[ -n "$version" ]]
@@ -190,7 +190,7 @@ list_gemset_strings()
builtin cd "${rvm_gems_path:-"$rvm_path/gems"}"
find . -maxdepth 1 -mindepth 1 -type d 2>/dev/null | \
xargs -n1 basename -- | \
- command grep -v '^\(@\|doc$\|cache$\|system$\)' | sort
+ command GREP_OPTIONS="" \grep -v '^\(@\|doc$\|cache$\|system$\)' | sort
))
for gemset in "${gemsets[@]//.\/}"
View
10 scripts/maglev
@@ -102,7 +102,7 @@ case "$system" in
SunOS)
# TODO: figure memory needs for SunOS
# Investigate project.max-shm-memory
- totalMemMB="$(/usr/sbin/prtconf | \grep Memory | cut -f3 -d' ')"
+ totalMemMB="$(/usr/sbin/prtconf | GREP_OPTIONS="" \grep Memory | cut -f3 -d' ')"
totalMem=$(($totalMemMB * 1048576))
shmmax=$(($totalMem / 4))
shmall=$(($shmmax / 4096))
@@ -183,7 +183,7 @@ fi
# At this point, shared memory settings contain the values we want,
# put them in sysctl.conf so they are preserved.
-if [[ ! -f /etc/sysctl.conf ]] || (( $(\grep -sc "kern.*.shm" /etc/sysctl.conf) == 0 ))
+if [[ ! -f /etc/sysctl.conf ]] || (( $(GREP_OPTIONS="" \grep -sc "kern.*.shm" /etc/sysctl.conf) == 0 ))
then
case "$system" in
Linux)
@@ -219,18 +219,18 @@ then
else
rvm_log "The following shared memory settings already exist in /etc/sysctl.conf"
echo "To change them, remove the following lines from /etc/sysctl.conf and rerun this script"
- \grep "kern.*.shm" /etc/sysctl.conf
+ GREP_OPTIONS="" \grep "kern.*.shm" /etc/sysctl.conf
fi
# Now setup for NetLDI in case we ever need it.
rvm_log "Setting up GemStone netldi service port"
-if (( $(\grep -sc "^gs64ldi" /etc/services) == 0 ))
+if (( $(GREP_OPTIONS="" \grep -sc "^gs64ldi" /etc/services) == 0 ))
then
echo '[[Info]] Adding "gs64ldi 50378/tcp" to /etc/services'
sudo bash -c 'echo "gs64ldi 50378/tcp # Gemstone netldi" >> /etc/services'
else
rvm_log "GemStone netldi service port is already set in /etc/services"
echo "To change it, remove the following line from /etc/services and rerun this script"
- \grep "^gs64ldi" /etc/services
+ GREP_OPTIONS="" \grep "^gs64ldi" /etc/services
fi
View
4 scripts/migrate
@@ -28,7 +28,7 @@ confirm()
read -r confirmation_response
[[ -z "$confirmation_response" ]] ||
- echo "$confirmation_response" | \grep -i '^y' >/dev/null 2>&1
+ echo "$confirmation_response" | GREP_OPTIONS="" \grep -i '^y' >/dev/null 2>&1
}
die_with_error()
@@ -106,7 +106,7 @@ migrate_rubies()
__rvm_run_with_env "gemset.pristine" "$destination_gemset" "rvm gemset pristine" "Making gemset $destination_gemset pristine."
- done < <("$rvm_scripts_path/list" gemsets strings | \grep "^$expanded_source")
+ done < <("$rvm_scripts_path/list" gemsets strings | GREP_OPTIONS="" \grep "^$expanded_source")
if confirm 'Do you wish to move over aliases?'
View
14 scripts/notes
@@ -79,7 +79,7 @@ $notes_type Notes:
printf "\n"
if [[ -f /etc/profile.d/rvm.sh ]] &&
- ! grep rvm_stored_umask /etc/profile.d/rvm.sh >/dev/null
+ ! GREP_OPTIONS="" \grep rvm_stored_umask /etc/profile.d/rvm.sh >/dev/null
then
printf "%b" "
* WARNING: your RVM loading script \`/etc/profile.d/rvm.sh\` is deprecated
@@ -99,7 +99,7 @@ $notes_type Notes:
open new terminal and validate environment is clean from old rvm settings:
- env | grep rvm
+ env | GREP_OPTIONS="" \grep rvm
install RVM:
@@ -126,6 +126,16 @@ $notes_type Notes:
otherwise add it to ~/.bash_login:
source ~/.profile
+
+"
+ fi
+
+ if [[ -n "${ZSH_VERSION:-}" ]] &&
+ (( 65536 * ${ZSH_VERSION:0:1} + 256 * ${ZSH_VERSION:2:1} + ${ZSH_VERSION:4} != 262924 ))
+ then
+ printf "%b" "
+ * WARNING: ZSH 4.3.12 is recommended, you have $ZSH_VERSION.
+
"
fi
} | new_notes | eval "${PAGER:-cat}"
View
4 scripts/repair
@@ -30,8 +30,8 @@ repair_gemsets()
builtin cd "${rvm_gems_path:-"rvm_path/gems"}"
directories=(
- $( find . -mindepth 1 -maxdepth 1 -type d | grep '@$' )
- $( find . -mindepth 1 -maxdepth 1 -type d | grep '^./@')
+ $( find . -mindepth 1 -maxdepth 1 -type d | GREP_OPTIONS="" \grep '@$' )
+ $( find . -mindepth 1 -maxdepth 1 -type d | GREP_OPTIONS="" \grep '^./@')
)
for directory in "${directories[@]//.\/}"
View
2 scripts/rubygems
@@ -91,7 +91,7 @@ rubygems_select_version_url()
case "$version" in
latest-*)
version="${version#latest-}"
- version="$(rubygems_version_list | grep "^${version}\." | tail -n 1 )"
+ version="$(rubygems_version_list | GREP_OPTIONS="" \grep "^${version}\." | tail -n 1 )"
version="${version}"
;;
esac
View
6 scripts/rvm
@@ -19,7 +19,7 @@ then
do
if [[ -f "$rvmrc" ]]
then
- if \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
+ if GREP_OPTIONS="" \grep '^\s*rvm .*$' "$rvmrc" >/dev/null 2>&1
then
printf "%b" "
Error:
@@ -116,8 +116,8 @@ then
alias rvm-restart="rvm_reload_flag=1 source '${rvm_scripts_path:-${rvm_path}/scripts}/rvm'"
if ! builtin command -v ruby >/dev/null 2>&1 ||
- builtin command -v ruby | \grep -v "${rvm_path}" >/dev/null ||
- builtin command -v ruby | \grep "${rvm_path}/bin/ruby$" >/dev/null
+ builtin command -v ruby | GREP_OPTIONS="" \grep -v "${rvm_path}" >/dev/null ||
+ builtin command -v ruby | GREP_OPTIONS="" \grep "${rvm_path}/bin/ruby$" >/dev/null
then
if [[ -s "$rvm_environments_path/default" ]]
then
View
2 scripts/rvm-install
@@ -62,7 +62,7 @@ do
set -o xtrace
export rvm_trace_flag=1
echo "$@"
- env | grep '^rvm_'
+ env | GREP_OPTIONS="" \grep '^rvm_'
export PS4="+ \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
;;
(--help)
View
12 scripts/selector
@@ -160,7 +160,7 @@ __rvm_select()
rvm_ruby_url="${rvm_ruby_repo_url:-$(__rvm_db "maglev_repo_url")}"
rvm_gemstone_version=$(
command curl -s https://raw.github.com/MagLev/maglev/master/version.txt |
- grep ^GEMSTONE | cut -f2 -d-
+ GREP_OPTIONS="" \grep ^GEMSTONE | cut -f2 -d-
)
rvm_gemstone_package_file="GemStone-${rvm_gemstone_version}.${system}-${arch}"
else
@@ -174,7 +174,7 @@ __rvm_select()
awk '/MagLev-'${rvm_ruby_version}':/ {print $2 }'
)
command curl -s https://raw.github.com/MagLev/maglev/$version_tag_commit/version.txt |
- grep ^GEMSTONE | cut -f2 -d-
+ GREP_OPTIONS="" \grep ^GEMSTONE | cut -f2 -d-
)
rvm_gemstone_package_file="GemStone-${rvm_gemstone_version}.${system}-${arch}"
export MAGLEV_HOME="$rvm_rubies_path/$rvm_ruby_string"
@@ -382,7 +382,7 @@ __rvm_use_system() {
if [[ -s "$rvm_path/config/system" ]]
then
- \grep "MY_RUBY_HOME='$rvm_rubies_path" "$rvm_path/config/system" > /dev/null
+ GREP_OPTIONS="" \grep "MY_RUBY_HOME='$rvm_rubies_path" "$rvm_path/config/system" > /dev/null
if (( $? == 0 ))
then
@@ -595,7 +595,7 @@ __rvm_ruby_string()
"${rvm_ruby_revision:=}" ${rvm_gemset_separator:="@"} "${rvm_ruby_string:=}"\
${rvm_expanding_aliases:=0} ${rvm_head_flag:=0}
- if echo "$rvm_ruby_string" | \grep "${rvm_gemset_separator}" >/dev/null 2>&1
+ if echo "$rvm_ruby_string" | GREP_OPTIONS="" \grep "${rvm_gemset_separator}" >/dev/null 2>&1
then
rvm_gemset_name="${rvm_ruby_string/*${rvm_gemset_separator}/}"
rvm_ruby_string="${rvm_ruby_string/${rvm_gemset_separator}*/}"
@@ -616,7 +616,7 @@ __rvm_ruby_string()
fi
fi
- if echo "$rvm_ruby_string" | \grep "${rvm_gemset_separator}" >/dev/null 2>&1 ; then
+ if echo "$rvm_ruby_string" | GREP_OPTIONS="" \grep "${rvm_gemset_separator}" >/dev/null 2>&1 ; then
rvm_gemset_name="${rvm_ruby_string/*${rvm_gemset_separator}/}"
rvm_ruby_string="${rvm_ruby_string/${rvm_gemset_separator}*/}"
fi
@@ -644,7 +644,7 @@ __rvm_ruby_string()
if (( ${#strings[@]} == 0 ))
then
- if echo "${GEM_HOME:-}" | grep "${rvm_path}" >/dev/null 2>&1
+ if echo "${GEM_HOME:-}" | GREP_OPTIONS="" \grep "${rvm_path}" >/dev/null 2>&1
then
# Current Ruby
strings="${GEM_HOME##*\/}"
View
4 scripts/snapshot
@@ -103,8 +103,8 @@ snapshot_save()
__rvm_rm_rf "$snapshot_ruby_name_file"
__rvm_rm_rf "$snapshot_alias_name_file"
- snapshot_primary_ruby="$(\grep '^\(ree\|ruby-1.8.7\)' < "$snapshot_installable_file" | \grep -v '-head$' | sort -r | head -n1)"
- snapshot_ruby_order="$snapshot_primary_ruby $(\grep -v "$snapshot_primary_ruby" < "$snapshot_installable_file")"
+ snapshot_primary_ruby="$(GREP_OPTIONS="" \grep '^\(ree\|ruby-1.8.7\)' < "$snapshot_installable_file" | \grep -v '-head$' | sort -r | head -n1)"
+ snapshot_ruby_order="$snapshot_primary_ruby $(GREP_OPTIONS="" \grep -v "$snapshot_primary_ruby" < "$snapshot_installable_file")"
for snapshot_ruby_name in $snapshot_ruby_order
do
View
6 scripts/tools
@@ -62,10 +62,10 @@ tools_user_setup()
name="rvm_${2}_path"
# detect name in config
- if [[ -f "${target}/.rvmrc" ]] && grep "^export ${name}=" "${target}/.rvmrc" > /dev/null
+ if [[ -f "${target}/.rvmrc" ]] && GREP_OPTIONS="" \grep "^export ${name}=" "${target}/.rvmrc" > /dev/null
then
# if defined read path
- path="$( grep "^export ${name}=" "${target}/.rvmrc" | sed "s/^export ${name}=//" )"
+ path="$( GREP_OPTIONS="" \grep "^export ${name}=" "${target}/.rvmrc" | sed "s/^export ${name}=//" )"
else
# if not defined - define it
path="\${HOME}/.rvm/${2}"
@@ -177,7 +177,7 @@ tools_mirror()
for n in 1.0 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0
do
- if grep "^ruby_${n}_url=" "$file" >/dev/null
+ if GREP_OPTIONS="" \grep "^ruby_${n}_url=" "$file" >/dev/null
then
if (( ${rvm_force_flag:-0} == 1 ))
then
View
2 scripts/update
@@ -62,7 +62,7 @@ do
set -o xtrace
export rvm_trace_flag=1
echo "$@"
- env | grep '^rvm_'
+ env | GREP_OPTIONS="" \grep '^rvm_'
export PS4="+ \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
;;
(--help)
View
10 scripts/upgrade
@@ -39,7 +39,7 @@ confirm()
if [[ -n "$confirmation_response" ]]
then
- echo $confirmation_response | \grep -i '^y\|^Y' >/dev/null 2>&1
+ echo $confirmation_response | GREP_OPTIONS="" \grep -i '^y\|^Y' >/dev/null 2>&1
fi
}
@@ -57,18 +57,18 @@ expand_ruby_name()
existing_ruby_patch()
{
- if "$rvm_scripts_path/list" strings | grep "^$1$" >/dev/null
+ if "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^$1$" >/dev/null
then
echo "$1"
else
(
rvm_ruby_string="$1"
__rvm_ruby_string
- if "$rvm_scripts_path/list" strings | grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-" >/dev/null
+ if "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-" >/dev/null
then
- "$rvm_scripts_path/list" strings | grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-" | sort | tail -n 1
+ "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^${rvm_ruby_interpreter}-${rvm_ruby_version}-" | sort | tail -n 1
else
- "$rvm_scripts_path/list" strings | grep "^${rvm_ruby_interpreter}-" | sort | tail -n 1
+ "$rvm_scripts_path/list" strings | GREP_OPTIONS="" \grep "^${rvm_ruby_interpreter}-" | sort | tail -n 1
fi
)
fi
View
6 scripts/zsh/Completion/_rvm
@@ -51,7 +51,7 @@ case $state in
if (( CURRENT == 3 )); then
# See if we’ve made it to the ‘@’; eg, 1.9.2@
- if ! \grep '@' <<< "${line[CURRENT-1]}" >/dev/null ; then
+ if ! GREP_OPTIONS="" \grep '@' <<< "${line[CURRENT-1]}" >/dev/null ; then
_values -S , 'rubies' \
$(rvm list strings | sed -e 's/ruby-\([^) ]*\)-\([^) ]*\)/ruby-\1-\2 \1-\2 \1/g') \
default system $(rvm alias list | cut -d' ' -f1) && ret=0
@@ -74,8 +74,8 @@ case $state in
if (( CURRENT == 3 )); then
_values 'gemset_commands' $(rvm gemset | sed -e '/create/!d; s/^.*[{]\(.*\)[}].*$/\1/; s/,/ /g')
else
- #_values -S , 'gemsets' $(rvm gemset list | \grep -v gemset 2>/dev/null)
- _values -S , 'gemsets' $(rvm gemset list | \grep -Ev '(gemset|info)' 2>/dev/null | awk '/^[ -_[:alnum:]]+$/ {print '$1'}')
+ #_values -S , 'gemsets' $(rvm gemset list | GREP_OPTIONS="" \grep -v gemset 2>/dev/null)
+ _values -S , 'gemsets' $(rvm gemset list | GREP_OPTIONS="" \grep -Ev '(gemset|info)' 2>/dev/null | awk '/^[ -_[:alnum:]]+$/ {print '$1'}')
fi
ret=0
;;

0 comments on commit d21fac7

Please sign in to comment.