Skip to content

Commit

Permalink
Merge branch 'master' of github.com:wayneeseguin/rvm
Browse files Browse the repository at this point in the history
  • Loading branch information
Sutto committed Nov 13, 2010
2 parents 315b14e + 0403d38 commit fa414aa
Show file tree
Hide file tree
Showing 17 changed files with 254 additions and 70 deletions.
2 changes: 1 addition & 1 deletion config/db
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ ree_1.8.6_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition.git
ree_1.8.7_url=http://rvm.beginrescueend.com/src/
ree_1.8.7_repo_url=git://github.com/FooBarWidget/rubyenterpriseedition187.git
ree_1.8.7_patch_level=2010.02
jruby_version=1.5.3
jruby_version=1.5.5
jruby_repo_url=git://github.com/jruby/jruby.git
jruby_url=http://jruby.org.s3.amazonaws.com/downloads
macruby_version=0.7.1
Expand Down
3 changes: 2 additions & 1 deletion config/known
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ jruby-1.3.1
jruby-1.4.0
jruby-1.5.1
jruby-1.5.2
jruby[-1.5.3]
jruby-1.5.3
jruby[-1.5.5]
jruby-head

# Rubinius
Expand Down
1 change: 1 addition & 0 deletions config/md5
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jruby-bin-1.5.0.tar.gz=ee2b4e326e8b87858e5dd0c8e94102e6
jruby-bin-1.5.1.tar.gz=0196dcfb17354f12253eaddc1166a0ee
jruby-bin-1.5.2.tar.gz=d239deb9a108a6abbfbd6cb79cf8255b
jruby-bin-1.5.3.tar.gz=ccb0b2dbc300d8dd4ad1bd4da48b8320
jruby-bin-1.5.5.tar.gz=8e00f7d40cbf221f733d6f7a15784e9a
libiconv-1.13.1.tar.gz=7ab33ebd26687c744a37264a330bbe9a
ncurses.tar.gz=cce05daf61a64501ef6cd8da1f727ec6
openssl-0.9.8k.tar.gz=e555c6d58d276aec7fdc53363e338ab3
Expand Down
2 changes: 1 addition & 1 deletion lib/VERSION.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
:major: 1
:minor: 0
:patch: 19
:patch: 21
59 changes: 59 additions & 0 deletions pkg/gentoo/rvm-1.0.20.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

inherit eutils

# This should be the first 7 characters of the tagged version's commit.
VERSION_SHORT_SHA1="ec6fbf9"

SRC_URI="http://github.com/wayneeseguin/rvm/tarball/${PV} -> ${P}.tar.gz"
S="${WORKDIR}/wayneeseguin-rvm-${VERSION_SHORT_SHA1}"

DESCRIPTION="RVM facilitates easy installation and management of multiple Ruby environments and sets of gems"
HOMEPAGE="http://rvm.beginrescueend.com/"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~x86"
IUSE="mono java"

RDEPEND="net-misc/curl
sys-devel/patch
java? (
dev-java/sun-jdk
dev-java/sun-jre-bin
)
mono? ( dev-lang/mono )"

RVM_DIR="/opt/rvm"

src_install() {
for v in `env | egrep '^rvm_' | cut -d '=' -f 1`; do
unset $v
done

# Set variables for installation (only!)
export rvm_prefix="${D}"
export rvm_path="${D}${RVM_DIR}"
export rvm_selfcontained=1

./install || die "Installation failed."

# Set variables for actual operation in a default rvmrc
echo "rvm_selfcontained=1" > "${T}"/rvmrc
echo "rvm_prefix=\"$(dirname $RVM_DIR)/\"" >> "${T}"/rvmrc
echo "rvm_path=\"${RVM_DIR}\"" >> "${T}"/rvmrc

insinto /etc
doins "${T}"/rvmrc || die "Failed to install /etc/rvmrc."
elog "A default /etc/rvmrc has been installed. Feel free to modify it."
elog

elog "Before any user (including root) can use rvm, the following line must be appended"
elog "to the end of the user's shell's loading files (.bashrc and then .bash_profile"
elog "for bash; or .zshrc for zsh), after all path/variable settings:"
elog
elog " [[ -s $RVM_DIR/scripts/rvm ]] && source $RVM_DIR/scripts/rvm"
}
59 changes: 59 additions & 0 deletions pkg/gentoo/rvm-1.0.21.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=2

inherit eutils

# This should be the first 7 characters of the tagged version's commit.
VERSION_SHORT_SHA1="b2e38b7"

SRC_URI="http://github.com/wayneeseguin/rvm/tarball/${PV} -> ${P}.tar.gz"
S="${WORKDIR}/wayneeseguin-rvm-${VERSION_SHORT_SHA1}"

DESCRIPTION="RVM facilitates easy installation and management of multiple Ruby environments and sets of gems"
HOMEPAGE="http://rvm.beginrescueend.com/"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~x86"
IUSE="mono java"

RDEPEND="net-misc/curl
sys-devel/patch
java? (
dev-java/sun-jdk
dev-java/sun-jre-bin
)
mono? ( dev-lang/mono )"

RVM_DIR="/opt/rvm"

src_install() {
for v in `env | egrep '^rvm_' | cut -d '=' -f 1`; do
unset $v
done

# Set variables for installation (only!)
export rvm_prefix="${D}"
export rvm_path="${D}${RVM_DIR}"
export rvm_selfcontained=1

./install || die "Installation failed."

# Set variables for actual operation in a default rvmrc
echo "rvm_selfcontained=1" > "${T}"/rvmrc
echo "rvm_prefix=\"$(dirname $RVM_DIR)/\"" >> "${T}"/rvmrc
echo "rvm_path=\"${RVM_DIR}\"" >> "${T}"/rvmrc

insinto /etc
doins "${T}"/rvmrc || die "Failed to install /etc/rvmrc."
elog "A default /etc/rvmrc has been installed. Feel free to modify it."
elog

elog "Before any user (including root) can use rvm, the following line must be appended"
elog "to the end of the user's shell's loading files (.bashrc and then .bash_profile"
elog "for bash; or .zshrc for zsh), after all path/variable settings:"
elog
elog " [[ -s $RVM_DIR/scripts/rvm ]] && source $RVM_DIR/scripts/rvm"
}
10 changes: 8 additions & 2 deletions scripts/cd
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,25 @@ if [[ ${rvm_project_rvmrc:-1} -ne 0 ]] ; then
# function returns that functionality.
_rvm_cd_complete ()
{
local directory current matches item index
local directory current matches item index sep
sep="${IFS}"
declare -x IFS=$'\n'
COMPREPLY=()
current="${COMP_WORDS[COMP_CWORD]}"
if [[ -n "$CDPATH" && ${current:0:1} != "/" ]] ; then
index=0
for directory in $(printf "$CDPATH" | tr -s ':' ' ') ; do
# The change to IFS above means that the tr below should replace ':'
# with a newline rather than a space. A space would be ignored, breaking
# TAB completion based on CDPATH again
for directory in $(printf "%s" "$CDPATH" | tr -s ':' '\n') ; do
for item in $( compgen -d "$directory/$current" ) ; do
COMPREPLY[index++]=${item#$directory/}
done
done
else
COMPREPLY=( $(compgen -d ${current}) )
fi
declare -x IFS="${sep}";
}
complete -o bashdefault -o default -o filenames -o dirnames -o nospace -F _rvm_cd_complete cd

Expand Down
6 changes: 4 additions & 2 deletions scripts/cli
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@ __rvm_parse_args()
if "$rvm_path/scripts/match" "$rvm_token" ".rb$" ; then # we have a specified ruby script
rvm_ruby_args="$rvm_token"
rvm_ruby_file="$rvm_token"
if [[ -z "${rvm_action:-""}" ]] ; then rvm_action="ruby" ; fi
if [[ -z "${rvm_action:-""}" || "$rvm_action" = "use" ]]; then
rvm_action="ruby"
fi
else
rvm_action="error"
rvm_error_message="Unrecognized command line argument: '$rvm_token'"
Expand Down Expand Up @@ -725,7 +727,7 @@ rvm()
rvm_ruby_gem_home="$gem_prefix"
GEM_HOME="$rvm_ruby_gem_home"
BUNDLE_PATH="$rvm_ruby_gem_home"
GEM_PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}global/bin"
GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_gem_home${rvm_gemset_separator:-"@"}global"
export rvm_ruby_gem_home GEM_HOME BUNDLE_PATH GEM_PATH
fi
unset gem_prefix
Expand Down
10 changes: 6 additions & 4 deletions scripts/gemsets
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ gemset_unpack()

if [[ -n "$rvm_ruby_gem_home" ]] ; then
export GEM_HOME="$rvm_ruby_gem_home"
export GEM_PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin"
export GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
export BUNDLE_PATH="$rvm_ruby_gem_home"
fi

Expand Down Expand Up @@ -509,7 +509,7 @@ gemset_export()

if [[ -n "$rvm_ruby_gem_home" ]] ; then
export GEM_HOME="$rvm_ruby_gem_home"
export GEM_PATH="$rvm_ruby_gem_home/bin:$rvm_ruby_global_gems_path/bin"
export GEM_PATH="$rvm_ruby_gem_home:$rvm_ruby_global_gems_path"
export BUNDLE_PATH="$rvm_ruby_gem_home"
fi

Expand Down Expand Up @@ -616,7 +616,8 @@ gemset_import()
done < <(awk '/^[^#]+/{print}' "${rvm_file_name}")

else
"$rvm_path/scripts/log" "error" "${rvm_file_name} does not exist to import from."
"$rvm_path/scripts/log" "error" \
"${rvm_file_name} does not exist to import from."
fi
}

Expand Down Expand Up @@ -748,7 +749,8 @@ gem_install()

unset -f gem

__rvm_run "gem.install" "$command" "installing ${gem_name} ${gem_version}..."
__rvm_run "gem.install" "$command" \
"installing ${gem_name} ${gem_version}..."
result=$?

if [[ $result -eq 0 ]] ; then
Expand Down
12 changes: 10 additions & 2 deletions scripts/install
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ usage()
--version : display rvm package version
"
\n"
}

check_rubyopt_conditions()
Expand Down Expand Up @@ -192,7 +192,15 @@ while [[ $# -gt 0 ]] ; do
env | grep '^rvm_'
set -o xtrace
;;
--help|*) usage ;;
--help)
usage
exit 0
;;
*)
echo "Unrecognized option: $token"
usage
exit 1
;;
esac
done

Expand Down
20 changes: 10 additions & 10 deletions scripts/log
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ if [[ ${rvm_pretty_print_flag:-0} -eq 0 ]] ; then
fi

case "$level" in
info) printf "${message#*: }\n" ;;
debug|warn) printf "$message\n" ;;
error|fail) printf "$message\n" >&2 ;;
*) printf "$message"
info) printf -- "${message#*: }\n" ;;
debug|warn) printf -- "$message\n" ;;
error|fail) printf -- "$message\n" >&2 ;;
*) printf "$message\n"
esac

else

case "$level" in
debug) printf "$(tput setaf 5)$level$(tput sgr0): $message\n" ;;
info) printf "$(tput setaf 2)$level$(tput sgr0): $message\n" ;;
warn) printf "$(tput setaf 3)$level$(tput sgr0): $message\n" ;;
error) printf "$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
fail) printf "$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
*) printf "$message"
debug) printf -- "$(tput setaf 5)$level$(tput sgr0): $message\n" ;;
info) printf -- "$(tput setaf 2)$level$(tput sgr0): $message\n" ;;
warn) printf -- "$(tput setaf 3)$level$(tput sgr0): $message\n" ;;
error) printf -- "$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
fail) printf -- "$(tput setaf 1)$level$(tput sgr0): $message\n" >&2 ;;
*) printf -- "$message\n"
esac

fi
Expand Down
23 changes: 14 additions & 9 deletions scripts/manage
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ __rvm_install_source()
__rvm_apply_patches
result="$?"

if [[ "$result" -gt 0 ]]; then
if [[ $result -gt 0 ]]; then
"$rvm_path/scripts/log" "fail" \
"There has been an error applying the specified patches. Halting the installation."
return $result
Expand All @@ -194,7 +194,7 @@ __rvm_install_source()
__rvm_run "configure" "$rvm_ruby_configure"
result=$?

if [[ "$result" -gt 0 ]] ; then
if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "error" \
"There has been an error while configuring. Halting the installation."
return $result
Expand Down Expand Up @@ -223,7 +223,7 @@ __rvm_install_source()
__rvm_run "configure" "$configure_command" "$rvm_ruby_string - #configuring "
result=$?

if [[ "$result" -gt 0 ]] ; then
if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "error" \
"There has been an error while running configure. Halting the installation."
return $result
Expand All @@ -239,7 +239,7 @@ __rvm_install_source()
__rvm_run "make" "$rvm_ruby_make ${rvm_make_flags:-""}" "$rvm_ruby_string - #compiling "
result=$?

if [[ "$result" -gt 0 ]] ; then
if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "error" \
"There has been an error while running make. Halting the installation."
return $result
Expand All @@ -254,7 +254,7 @@ __rvm_install_source()
__rvm_run "install" "$rvm_ruby_make_install" "$rvm_ruby_string - #installing "
result=$?

if [[ "$result" -gt 0 ]] ; then
if [[ $result -gt 0 ]] ; then
"$rvm_path/scripts/log" "error" \
"There has been an error while running make install. Halting the installation."
return $result
Expand Down Expand Up @@ -290,7 +290,7 @@ __rvm_install_ruby()

# Check for clang if the flag is set
__rvm_check_for_clang
result="$?"
result=$?

[[ $result -gt 0 ]] && return $result

Expand Down Expand Up @@ -1084,7 +1084,7 @@ RubyWrapper
fi
fi

if [[ -s ./Makefile ]] && [[ -z "$rvm_reconfigure_flag" ]] ; then
if [[ -s ./Makefile && -z "$rvm_reconfigure_flag" ]] ; then

if [[ ${rvm_debug_flag:-0} -gt 0 ]] ; then
"$rvm_path/scripts/log" "debug" \
Expand Down Expand Up @@ -1179,8 +1179,10 @@ RubyWrapper
"a ruby interpreter to install must be specified and not simply 'default'."
;;

*) "$rvm_path/scripts/log" "fail" \
"Ruby interpreter '$rvm_ruby_interpreter' is not known."
*)
"$rvm_path/scripts/log" "fail" \
"Either the ruby interpreter is unknown or there was an error!."
;;

esac

Expand Down Expand Up @@ -1335,6 +1337,9 @@ __rvm_fetch_ruby()
;;
esac

if [[ -d "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" ]] ; then
rm -rf "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string"
fi
mv "/tmp/rvm_src_$$/$(builtin cd /tmp/rvm_src_$$ ; ls)" "${rvm_src_path:-"$rvm_path/src"}/$rvm_ruby_string" ; rm -rf "/tmp/rvm_src_$$"

if [[ -n "${rvm_ruby_name:-""}" && -d "${rvm_src_path:-"$rvm_path/src"}/$(echo $rvm_ruby_string | sed -e 's/-n.*//')" ]] ; then
Expand Down
2 changes: 1 addition & 1 deletion scripts/package
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,6 @@ else
"$rvm_path/scripts/log" "info" \
" 'ree_dependencies' installs zlib, ncurses, readline, openssl and iconv in this order."
"$rvm_path/scripts/log" "info" \
" still need to add '-C --with-readline-dir=\$rvm_path/usr,--with-iconv-dir=\$rvm_path/usr,--with-zlib-dir=\$rvm_path/usr,--with-openssl-dir=\$rvm_path/usr' to 'rvm install ree'"
" still need to add ' --with-readline-dir=\$rvm_path/usr --with-iconv-dir=\$rvm_path/usr --with-zlib-dir=\$rvm_path/usr --with-openssl-dir=\$rvm_path/usr' to 'rvm install ree'"
exit 1
fi
2 changes: 1 addition & 1 deletion scripts/rvm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# http://rvm.beginrescueend.com
# http://github.com/wayneeseguin/rvm

grep -q '^rvm ()' < <( declare -f ) # Is RVM is a shell function?
\grep -q '^rvm ()' < <( declare -f ) # Is RVM is a shell function?

if [[ $? -gt 0 || ${rvm_reload_flag:-0} -eq 1 ]] ; then

Expand Down
Loading

0 comments on commit fa414aa

Please sign in to comment.