diff --git a/.gitignore b/.gitignore index d1dec799e3..0a87d14ee7 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,12 @@ pkg/ .rvmrc .DS_Store .idea +aclocal.m4 +autom4te.cache/ +config.status +configure +install-sh +Makefile +depcomp +missing +.deps/ diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000000..e69de29bb2 diff --git a/VERSION b/VERSION index 4ad1e55ea4..a92834b0ea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.24 +1.6.25 diff --git a/config/db b/config/db index 16c6ba1267..a5b76b2e16 100644 --- a/config/db +++ b/config/db @@ -54,7 +54,7 @@ macruby_nightly_version=0.11 macruby_url=http://www.macruby.org/files macruby_repo_url=git://github.com/MacRuby/MacRuby.git macruby_nightly_url=http://www.macruby.org/files/nightlies/macruby_nightly-latest.pkg -maglev_version=26063 +maglev_version=26197 maglev_url=http://glass-downloads.gemstone.com/maglev maglev_repo_url=git://github.com/MagLev/maglev.git ironruby_version=1.0 diff --git a/config/known b/config/known index a3c35a99a2..26444a813e 100644 --- a/config/known +++ b/config/known @@ -41,7 +41,7 @@ ree-1.8.7-head kiji # MagLev -maglev[-26063] +maglev[-26197] maglev-head # Mac OS X Snow Leopard Only diff --git a/config/md5 b/config/md5 index 52fb7beabd..4130c0f888 100644 --- a/config/md5 +++ b/config/md5 @@ -158,9 +158,9 @@ rubygems-1.6.1.tgz=a77c64896aaa10d64aaf34f5c1488173 rubygems-1.6.2.tgz=0c95a9869914ba1a45bf71d3b8048420 zlib-1.2.3.tar.gz=debc62758716a169df9f62e6ab2bc634 zlib-1.2.5.tar.gz=c735eab2d659a96e5a594c9e8541ad63 -GemStone-26063.Darwin-i386.tar.gz=652246ddf376ab9a9d862e7906db7e7c -GemStone-26063.Linux-x86_64.tar.gz=5e924283dd242571b3a3b654585d8ef5 -GemStone-26063.SunOS-i86pc.tar.gz=d28c508fe5f170a9b4cc0e588e1a0603 -MagLev-26063.Darwin-i386.tar.gz=5c54f50d56b075eeb4d930eb68ea2ccd -MagLev-26063.Linux-x86_64.tar.gz=eed972c51e7d17f142a8c74ab34e8aa2 -MagLev-26063.SunOS-i86pc.tar.gz=70d5e3c79e1d40625b24e9c578e3adea +GemStone-26197.Darwin-i386.tar.gz=af38715e9b6a7a325eb5b094340d4637 +GemStone-26197.Linux-x86_64.tar.gz=80788b6b4c7e99e6903a0ac5ba2c3c34 +GemStone-26197.SunOS-i86pc.tar.gz=080648734bc87f85fcfa2344e804f34a +MagLev-26197.Darwin-i386.tar.gz=15b330a9206f38f50451bdbc18f12509 +MagLev-26197.Linux-x86_64.tar.gz=4410849b6bfb0da488a62a4428c5ddcc +MagLev-26197.SunOS-i86pc.tar.gz=ac6bb478f4b795472422b4250a996362 diff --git a/hooks/after_use b/hooks/after_use new file mode 100644 index 0000000000..d218414eee --- /dev/null +++ b/hooks/after_use @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +after_use_hooks=($( + find "${rvm_path:-"$HOME/.rvm"}/hooks" -iname 'after_use_*' -type f +)) + +for after_use_hook in "${after_use_hooks[@]}" +do + if [[ -x "${after_use_hook}" ]] + then + . "${after_use_hook}" + fi +done + diff --git a/hooks/after_use_jruby b/hooks/after_use_jruby new file mode 100644 index 0000000000..c34f8ce53a --- /dev/null +++ b/hooks/after_use_jruby @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +if [[ "${rvm_ruby_string}" =~ "jruby" ]] +then + . "${rvm_path}/scripts/functions/hooks/jruby" + + if ! jruby_ngserver_is_running + then + (JRUBY_OPTS='' jruby --ng-server 2>&1 1>/dev/null)& + fi +else + for function in jruby_ngserver_is_running jruby ruby + do + if declare -f ${function} | \grep -q "${function} ()" + then + unset -f $function + fi + done +fi diff --git a/lib/rvm.rb b/lib/rvm.rb index a99f146fa3..55d2cb7e6b 100644 --- a/lib/rvm.rb +++ b/lib/rvm.rb @@ -54,7 +54,7 @@ # RVM::Environment.new, versus RVM.environment # module RVM - VERSION = "1.6.24" + VERSION = "1.6.25" require "rvm/errors" diff --git a/meta/gentoo/rvm-1.6.25.ebuild b/meta/gentoo/rvm-1.6.25.ebuild new file mode 100644 index 0000000000..80c6b1dca4 --- /dev/null +++ b/meta/gentoo/rvm-1.6.25.ebuild @@ -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="b83b808" + +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 ~amd64" +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_user_install=1 + + ./install || die "Installation failed." + + # Set variables for actual operation in a default rvmrc + echo "rvm_user_install=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" +} diff --git a/rubygems/jruby/version b/rubygems/jruby/version new file mode 100644 index 0000000000..e69de29bb2 diff --git a/rubygems/rbx/version b/rubygems/rbx/version new file mode 100644 index 0000000000..e69de29bb2 diff --git a/rubygems/ree/version b/rubygems/ree/version new file mode 100644 index 0000000000..e69de29bb2 diff --git a/rubygems/ruby/version b/rubygems/ruby/version new file mode 100644 index 0000000000..e69de29bb2 diff --git a/scripts/cli b/scripts/cli index 2e3c401410..18bea9d8bb 100644 --- a/scripts/cli +++ b/scripts/cli @@ -138,10 +138,12 @@ __rvm_parse_args() fi ;; - package) + pkg) rvm_action="$rvm_token" - if [[ "$next_token" = "--only-path" ]]; then - shift; rvm_only_path_flag=1 + if [[ "$next_token" = "--only-path" ]] + then + shift + rvm_only_path_flag=1 fi rvm_ruby_args="$next_token $*" rvm_parse_break=1 @@ -818,6 +820,7 @@ rvm() source "$rvm_scripts_path/functions/implode" __rvm_implode ;; + get) if (( $# > 0 )) then @@ -837,7 +840,7 @@ rvm() \rm -f $tmpdir/$$ ;; - help|rtfm|env|current|info|list|gemdir|gemhome|gempath|monitor|notes|package) + help|rtfm|env|current|info|list|gemdir|gemhome|gempath|monitor|notes|package|extract|pkg) if (( $# > 0 )) then @@ -847,10 +850,11 @@ rvm() next_token="" fi - if [[ "$next_token" = "${rvm_action}" ]] + if [[ "$next_token" == "${rvm_action}" ]] then shift fi + "$rvm_scripts_path/${rvm_action}" ${rvm_ruby_args:-} ;; diff --git a/scripts/disk-usage b/scripts/disk-usage index 80d5413496..69f27b5d46 100755 --- a/scripts/disk-usage +++ b/scripts/disk-usage @@ -6,7 +6,7 @@ source "$rvm_scripts_path/base" usage() { - printf "Usage: 'rvm disk-usage {all,archives,repos,sources,logs,packages,rubies,gemsets}'\n" + printf "Usage: 'rvm disk-usage {all,archives,repos,sources,logs,pkg,rubies,gemsets}'\n" printf " Lists the space rvm uses for a given item.\n" exit 1 } @@ -31,7 +31,7 @@ all_disk_usage() repos_disk_usage sources_disk_usage logs_disk_usage - packages_disk_usage + pkg_disk_usage rubies_disk_usage gemsets_disk_usage total_disk_usage @@ -46,7 +46,7 @@ archives_disk_usage() { disk_usage "Downloaded Archives" "archives"; } repos_disk_usage() { disk_usage "Repositories" "repos"; } sources_disk_usage() { disk_usage "Extracted Source Code" "src"; } logs_disk_usage() { disk_usage "Log Files" "log"; } -packages_disk_usage() { disk_usage "Packages" "usr"; } +pkg_disk_usage() { disk_usage "Packages" "usr"; } rubies_disk_usage() { disk_usage "Rubies" "rubies"; } gemsets_disk_usage() { disk_usage "Gemsets" "gems"; } @@ -55,6 +55,6 @@ gemsets_disk_usage() { disk_usage "Gemsets" "gems"; } [[ -z "$1" ]] && usage case "$1" in - all|archives|repos|sources|logs|total|packages|rubies|gemsets) eval "$1_disk_usage" ;; + all|archives|repos|sources|logs|total|pkg|rubies|gemsets) eval "$1_disk_usage" ;; *) usage ;; esac diff --git a/scripts/extract b/scripts/extract new file mode 100644 index 0000000000..5e7f9abc99 --- /dev/null +++ b/scripts/extract @@ -0,0 +1 @@ +#/usr/bin/env bash diff --git a/scripts/functions/env b/scripts/functions/env index 4687ec6e57..b852ab2042 100644 --- a/scripts/functions/env +++ b/scripts/functions/env @@ -69,6 +69,11 @@ __rvm_load_environment() # source the environment file \. "$rvm_environments_path/$string" + + if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] + then + \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" + fi # clear the PATH cache builtin hash -r diff --git a/scripts/functions/environment b/scripts/functions/environment index c51e22f115..35c94d2fb7 100644 --- a/scripts/functions/environment +++ b/scripts/functions/environment @@ -262,7 +262,10 @@ __rvm_setup() } __rvm_teardown() { - [[ ! -d "${rvm_tmp_path}/$$" ]] || __rvm_rm_rf "${rvm_tmp_path}/$$" + if [[ -d "${rvm_tmp_path}/$$" ]] + then + __rvm_rm_rf "${rvm_tmp_path}/$$" + fi if [[ -n "${ZSH_VERSION:-""}" ]] then diff --git a/scripts/functions/hooks/jruby b/scripts/functions/hooks/jruby new file mode 100644 index 0000000000..6868176c78 --- /dev/null +++ b/scripts/functions/hooks/jruby @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +jruby_ngserver_is_running() +{ + ps auxww | grep -q '[s]un.java.command=com.martiansoftware.nailgun.NGServer' +} + +jruby() +{ + if jruby_ngserver_is_running + then + command jruby --ng "$@" + else + command jruby "$@" + fi +} + +ruby() +{ + jruby "$@" +} + diff --git a/scripts/functions/installer b/scripts/functions/installer old mode 100644 new mode 100755 index b6cf89dd9c..4416cd323d --- a/scripts/functions/installer +++ b/scripts/functions/installer @@ -190,6 +190,12 @@ Upgrade Notes * If you see the following error message: Unknown alias name: 'default' re-set your default ruby, this is due to a change in how default works. + + * after_use hook now supports multiple files with after_use_* + the custom hooks can be easily turned on/off by: + chmod +x $rvm_path/hooks/after_use_[hook_name] + chmod -x $rvm_path/hooks/after_use_[hook_name] + " } @@ -368,7 +374,7 @@ install_rvm_files() cp -f "$source_path/${file}" "$rvm_path/${file}" done - directories=(config contrib scripts examples lib hooks help patches) + directories=(config contrib scripts examples lib help patches) for directory in ${directories[@]} do @@ -400,6 +406,51 @@ install_rvm_files() return 0 } +install_rvm_hooks() +{ + for entry in $(find hooks 2>/dev/null) + do + if [[ -f "$source_path/$entry" ]] + then + # Target is supposed to be a file, remove if it is a directory. + if [[ -d "$rvm_path/$entry" ]] + then + __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 -Eq '^hooks/[a-Z]+_[a-Z]+$' && + [[ -f "$rvm_path/$entry" ]] && + ! grep -q "$(basename ${entry})_\*" "$rvm_path/$entry" + then + mv -f "$rvm_path/$entry" "$rvm_path/${entry}_custom" + fi + cp -f "$source_path/$entry" "$rvm_path/$entry" + elif [[ -d "$source_path/$entry" ]] + then + # Target is supposed to be a directory, remove if it is a file. + if [[ -f "$rvm_path/$entry" ]] + then + rm -f "$rvm_path/$entry" + fi + if [[ ! -d "$rvm_path/$entry" ]] + then + mkdir -p "$rvm_path/$entry" + fi + fi + done + + #fix broken copy of after_use to after_use_custom + if [[ -f "$rvm_path/hooks/after_use_custom" ]] && + grep -q "after_use_\*" "$rvm_path/hooks/after_use_custom" + then + rm -f "$rvm_path/hooks/after_use_custom" + fi + + chmod +x "$rvm_path/hooks/after_use_jruby" + + return 0 +} + setup_configuration_files() { pushd "$rvm_path" >/dev/null @@ -450,35 +501,27 @@ install_binscripts() { files=(rvm-prompt rvm-installer rvm rvmsudo rvm-shell rvm-exec rvm-auto-ruby) - if [[ ! -d "${rvm_bin_path:="${rvm_path}/bin"}" ]] + if [[ ! -d "${rvm_bin_path}" ]] then mkdir -p "${rvm_bin_path}" fi - if [[ ! -d "${rvm_path}/bin" ]] - then - mkdir -p "${rvm_path}/bin" - fi - for file in "${files[@]}" do # Ensure binscripts are always available in rvm_path/bin first. if [[ -f "${rvm_bin_path}/${file}" ]] then rm -f "${rvm_bin_path}/${file}" - rm -f "${rvm_path}/bin/${file}" fi cp -f "${source_path}/binscripts/${file}" "${rvm_bin_path}/${file}" - cp -f "${source_path}/binscripts/${file}" "${rvm_path}/bin/${file}" - chmod +x "${rvm_bin_path}/${file}" "${rvm_path}/bin/${file}" + chmod +x "${rvm_bin_path}/${file}" if [[ "${source_path}/binscripts" != "${rvm_bin_path}" ]] then cp -f "${source_path}/binscripts/${file}" "${rvm_bin_path}/${file}" fi - cp -f "${source_path}/binscripts/${file}" "${rvm_path}/bin/${file}" done return 0 @@ -492,7 +535,7 @@ automatic_profile_setup() printf "Checking rc files... ($rvm_rc_files)" if (( rvm_loaded_flag == 0 )) then - for rcfile in $(printf $rvm_rc_files) + for rcfile in "${rvm_rc_files[@]}" do if [[ ! -f $rcfile ]] then @@ -601,7 +644,8 @@ cleanse_old_environments() if (( ${#environments[@]} > 0 )) then - for file in "${environments[@]}" ; do + for file in "${environments[@]}" + do if grep 'BUNDLE_PATH' "$file" > /dev/null 2>&1 then grep -v 'BUNDLE_PATH' "$file" > "$file.new" @@ -884,7 +928,7 @@ if [ -n \"\${BASH_VERSION:-}\" -o -n \"\${ZSH_VERSION:-}\" ] ; then source \"\$HOME/.rvm/scripts/rvm\" elif [[ -s \"/usr/local/rvm/scripts/rvm\" ]] ; then - true \${rvm_path:=\"/usr/local/rvm/scripts/rvm\"} + true \${rvm_path:=\"/usr/local/rvm\"} source \"/usr/local/rvm/scripts/rvm\" fi diff --git a/scripts/functions/packages b/scripts/functions/pkg similarity index 100% rename from scripts/functions/packages rename to scripts/functions/pkg diff --git a/scripts/functions/rvmrc b/scripts/functions/rvmrc index d3c8dc0b61..5a2593e524 100644 --- a/scripts/functions/rvmrc +++ b/scripts/functions/rvmrc @@ -16,9 +16,11 @@ __rvm_md5_for() __rvm_md5_for_contents() { - if command -v md5 > /dev/null; then + if command -v md5 > /dev/null + then echo "$1" | cat - "$1" | md5 - elif command -v md5sum > /dev/null ; then + elif command -v md5sum > /dev/null + then echo "$1" | cat - "$1" | md5sum | awk '{print $1}' else rvm_error "Neither md5 nor md5sum were found in the PATH" @@ -70,7 +72,10 @@ __rvm_rvmrc_tools() local rvmrc_action="$1" - [[ $# -gt 0 ]] && shift + if (( $# )) + then + shift + fi local rvmrc_path="$(builtin cd "${1:-$PWD}" >/dev/null 2>&1; pwd)/.rvmrc" @@ -97,14 +102,18 @@ __rvm_rvmrc_tools() trusted) - if [[ -f "$rvmrc_path" ]] ; then + if [[ -f "$rvmrc_path" ]] + then local trusted_value="$(__rvm_rvmrc_stored_trust "$rvmrc_path")" - if [[ "$trusted_value" = "$(__rvm_md5_for_contents "$rvmrc_path")" ]]; then + if [[ "$trusted_value" = "$(__rvm_md5_for_contents "$rvmrc_path")" ]] + then echo "The rvmrc at '$rvmrc_path' is currently trusted." - elif [[ "$trusted_value" = "0" ]]; then + elif [[ "$trusted_value" = "0" ]] + then echo "The rvmrc at '$rvmrc_path' is currently untrusted." - elif [[ -n "$trusted_value" ]]; then - echo "The rvmrc at '$rvmrc_path' contains unreviewed changes." + elif [[ -n "$trusted_value" ]] + then + echo "The rvmrc at '$rvmrc_path' contains unreviewed changes." else echo "The trustiworthiness of '$rvmrc_path' is currently unknown." fi @@ -135,12 +144,13 @@ __rvm_check_rvmrc_trustworthiness() export escape_flag=1 # Trust when they have the flag... of doom! - if [[ -n "$1" && ${rvm_trust_rvmrcs_flag:-0} -eq 0 ]] ; then - + if [[ -n "$1" && ${rvm_trust_rvmrcs_flag:-0} -eq 0 ]] + then value="$(__rvm_rvmrc_stored_trust "$1")" md5_for_contents="$(__rvm_md5_for_contents "$1")" - if [[ -z "$value" ]] || [[ "$value" != "$md5_for_contents" ]] ; then + if [[ -z "$value" ]] || [[ "$value" != "$md5_for_contents" ]] + then __rvm_ask_to_trust "$1" else [[ "$md5_for_contents" = "$md5_for_contents" ]] @@ -184,8 +194,6 @@ __rvm_ask_to_trust() = Note: You will be re-prompted each time the .rvmrc file = = changes, and may change the trust setting manually at any = = time. = - = = - = Press 'q' to exit the reader when finished reading the file = =============================================================== (press enter to review the .rvmrc file) @@ -198,7 +206,7 @@ command cat -v "${_rvmrc}" printf " - Examination of "${_rvmrc}" is now complete. + Examination of %s is now complete. ================================================================ = Trusting an .rvmrc file means that whenever you cd into this = @@ -213,26 +221,26 @@ command cat -v "${_rvmrc}" = wish to trust this particular .rvmrc? = ================================================================ - (yes or no)" +" "$_rvmrc" - # TODO: Eliminate infinite loop possibility. - trusted="" - while [[ -z "$trusted" ]] + trusted=0 + while (( ! trusted )) do - printf " > " - - read -r response - - value="$(echo "$response" | tr '[[:upper:]]' '[[:lower:]]' | __rvm_strip)" - - case "$response" in - y|yes) trusted=1 ;; - n|no) trusted=0 ;; - *) printf " (yes or no)" ;; + printf "%s" ' Yes or No: [y/N]? ' + read response + value="$(echo -n "${response}" | tr '[[:upper:]]' '[[:lower:]]' | __rvm_strip)" + + case "${value:-n}" in + y|yes) + trusted=1 + ;; + n|no) + break + ;; esac done - if (( ${trusted:-0} > 0 )) + if (( trusted )) then __rvm_trust_rvmrc "$1" return 0 @@ -302,19 +310,19 @@ __rvm_project_rvmrc() __rvm_set_rvmrc() { local flags + true ${rvm_verbose_flag:=0} - if [[ "$HOME" != "$PWD" ]] ; then - - if [[ ${rvm_verbose_flag:-0} -gt 0 ]] ; then + if [[ "$HOME" != "$PWD" ]] + then + if (( rvm_verbose_flag )) + then flags="use " fi - if [[ -s .rvmrc ]] ; then - + if [[ -s .rvmrc ]] + then mv .rvmrc .rvmrc.$(date +%m.%d.%Y-%H:%M:%S) - rvm_warn ".rvmrc is not empty, moving aside to preserve." - fi local identifier=$(__rvm_environment_identifier) @@ -338,15 +346,15 @@ if [[ -d \"\${rvm_path:-\$HOME/.rvm}/environments\" \\ then \\. \"\${rvm_path:-\$HOME/.rvm}/environments/\$environment_id\" - if [[ -s \".rvm/hooks/after_use\" ]] + if [[ -s \"\${rvm_path:-\$HOME/.rvm}/hooks/after_use\" ]] then - . \".rvm/hooks/after_use\" + . \"\${rvm_path:-\$HOME/.rvm}/hooks/after_use\" fi else # If the environment file has not yet been created, use the RVM CLI to select. if ! rvm --create $flags \"\$environment_id\" then - echo \"Failed to create RVM environment '${environment_id}'.\" + echo \"Failed to create RVM environment '\${environment_id}'.\" fi fi diff --git a/scripts/hook b/scripts/hook index b3935ee7b0..3d6b856c57 100755 --- a/scripts/hook +++ b/scripts/hook @@ -1,6 +1,6 @@ #!/usr/bin/env bash -declare rvm_verbose_flag rvm_debug_flag rvm_hook +declare rvm_verbose_flag rvm_debug_flag true ${rvm_verbose_flag:=0} ${rvm_debug_flag:=0} "${rvm_hook:=}" diff --git a/scripts/initialize b/scripts/initialize index 8c8cc31912..7d4486cd84 100644 --- a/scripts/initialize +++ b/scripts/initialize @@ -31,24 +31,19 @@ then if (( UID == 0 )) || [[ -n "${rvm_prefix:-}" && "${rvm_prefix:-}" != "${HOME}" ]] then + true "${rvm_bin_path:="${rvm_prefix}/bin"}" + true "${rvm_man_path:="${rvm_prefix}/share/man"}" + true "${rvm_rc_files:=("/etc/profile" "/etc/zshenv")}" rvm_user_install_flag=0 else rvm_user_install_flag=1 fi fi -if (( ${rvm_user_install_flag:=0} == 0 )) -then - true "${rvm_bin_path:="${rvm_prefix}/bin"}" - true "${rvm_man_path:="${rvm_prefix}/share/man"}" - true "${rvm_rc_files:="/etc/profile /etc/zshenv"}" -else - true "${rvm_bin_path:="$rvm_path/bin"}" - true "${rvm_man_path:="$rvm_path/man"}" - true "${rvm_rc_files:="$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}" -fi - : \ + ${rvm_rc_files:=("$HOME/.bash_profile" "$HOME/.bashrc" "$HOME/.zshenv")} \ + ${rvm_bin_path:="$rvm_path/bin"} \ + ${rvm_man_path:="$rvm_path/man"} \ ${rvm_archives_path:="$rvm_path/archives"} \ ${rvm_config_path:="$rvm_path/config"} \ ${rvm_docs_path:="$rvm_path/docs"} \ diff --git a/scripts/install b/scripts/install index d8a190e706..5eb68ce7b8 100755 --- a/scripts/install +++ b/scripts/install @@ -96,6 +96,8 @@ cleanse_old_entities install_rvm_files +install_rvm_hooks + ensure_scripts_are_executable setup_configuration_files diff --git a/scripts/manage b/scripts/manage index 7321ed11f2..94725a0c85 100755 --- a/scripts/manage +++ b/scripts/manage @@ -13,7 +13,7 @@ original_ruby_string=${rvm_ruby_string:-""} source "$rvm_scripts_path/base" source "$rvm_scripts_path/patches" source "$rvm_scripts_path/functions/build" -source "$rvm_scripts_path/functions/packages" +source "$rvm_scripts_path/functions/pkg" source "$rvm_scripts_path/functions/irbrc" source "$rvm_scripts_path/functions/db" source "$rvm_scripts_path/functions/manage/base" diff --git a/scripts/notes b/scripts/notes index 08847a66fc..248c6af186 100755 --- a/scripts/notes +++ b/scripts/notes @@ -98,7 +98,7 @@ dependencies: printf " dependencies: # For RVM - rvm: yum install -y bash curl git # NOTE: For git you need the EPEL repository enabled + rvm: yum install -y bash curl git libxslt # NOTE: For git you need the EPEL repository enabled # For Ruby (MRI & Ree) you should install the following OS dependencies: ruby: yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel libyaml-devel libffi-devel openssl-devel ; diff --git a/scripts/package b/scripts/package old mode 100755 new mode 100644 index 06110457a5..5e7f9abc99 --- a/scripts/package +++ b/scripts/package @@ -1,50 +1 @@ -#!/usr/bin/env bash - -if (( ${rvm_trace_flag:=0} == 2 )) -then - set -x - export rvm_trace_flag -fi - -rvm_base_except="selector" - -source "$rvm_scripts_path/base" -source "$rvm_scripts_path/functions/build" -source "$rvm_scripts_path/functions/db" -source "$rvm_scripts_path/functions/packages" - -__rvm_setup_compile_environment - -set +o errexit - -# Tools to make managing ruby dependencies inside of rvm easier. -args=($*) -action="${args[0]:-""}" -library="${args[1]:-""}" -args="$(echo ${args[@]:2})" - -if [[ -n "$library" ]] ; then - - case $library in - readline|iconv|curl|openssl|zlib|autoconf|ncurses|pkgconfig|gettext|glib|mono|llvm|libxml2|libyaml) - ${library} - ;; - ree_dependencies) - for i in zlib ncurses readline openssl iconv; do - ${i} - reset - done - ;; - *) - rvm_error "Package '${library}' is unknown." - ;; - esac - - exit $? - -else - rvm_log "\nUsage:\n 'rvm package {install,uninstall} {readline,iconv,curl,openssl,zlib,autoconf,ncurses,pkgconfig,gettext,glib,mono,llvm,libxml2,libxslt,libyaml}'\n - 'ree_dependencies' installs zlib, ncurses, readline, openssl and iconv in this order.\n - still need to add ' --with-readline-dir=\$rvm_usr_path --with-iconv-dir=\$rvm_usr_path --with-zlib-dir=\$rvm_usr_path --with-openssl-dir=\$rvm_usr_path' to 'rvm install ree'\n" - exit 1 -fi +#/usr/bin/env bash diff --git a/scripts/pkg b/scripts/pkg new file mode 100755 index 0000000000..7c91dac5e8 --- /dev/null +++ b/scripts/pkg @@ -0,0 +1,50 @@ +#!/usr/bin/env bash + +if (( ${rvm_trace_flag:=0} == 2 )) +then + set -x + export rvm_trace_flag +fi + +rvm_base_except="selector" + +source "$rvm_scripts_path/base" +source "$rvm_scripts_path/functions/build" +source "$rvm_scripts_path/functions/db" +source "$rvm_scripts_path/functions/pkg" + +__rvm_setup_compile_environment + +set +o errexit + +# Tools to make managing ruby dependencies inside of rvm easier. +args=($*) +action="${args[0]:-""}" +library="${args[1]:-""}" +args="$(echo ${args[@]:2})" + +if [[ -n "$library" ]] +then + case $library in + readline|iconv|curl|openssl|zlib|autoconf|ncurses|pkgconfig|gettext|glib|mono|llvm|libxml2|libyaml) + ${library} + ;; + ree_dependencies) + for i in zlib ncurses readline openssl iconv; do + ${i} + reset + done + ;; + *) + rvm_error "Package '${library}' is unknown." + ;; + esac + + exit $? + +else + rvm_log "\nUsage:\n 'rvm package {install,uninstall} {readline,iconv,curl,openssl,zlib,autoconf,ncurses,pkgconfig,gettext,glib,mono,llvm,libxml2,libxslt,libyaml}'\n + 'ree_dependencies' installs zlib, ncurses, readline, openssl and iconv in this order.\n + still need to add ' --with-readline-dir=\$rvm_usr_path --with-iconv-dir=\$rvm_usr_path --with-zlib-dir=\$rvm_usr_path --with-openssl-dir=\$rvm_usr_path' to 'rvm install ree'\n" + exit 1 +fi diff --git a/scripts/snapshot b/scripts/snapshot index 7a3727e88c..5f7d4f67cd 100755 --- a/scripts/snapshot +++ b/scripts/snapshot @@ -57,7 +57,7 @@ snapshot_save() cp "$rvm_user_path/db" "$snapshot_temp_path/" rvm_log "Backing up your installed packages" - sed -e 's/-//' -e 's/^lib//' < "$rvm_config_path/packages" | awk -F= '{print $1}' | sort | uniq > "$snapshot_temp_path/packages" + sed -e 's/-//' -e 's/^lib//' < "$rvm_config_path/pkg" | awk -F= '{print $1}' | sort | uniq > "$snapshot_temp_path/pkg" rvm_log "Backing up all of your gemsets" mkdir -p "$snapshot_temp_path/gems" @@ -181,7 +181,7 @@ snapshot_load() \cp -f "$snapshot_temp_path/db" "$rvm_user_path/db" rvm_log "Installing rvm-managed packages" - for snapshot_package in $(cat "$snapshot_temp_path/packages"); do + for snapshot_package in $(cat "$snapshot_temp_path/pkg"); do "$rvm_scripts_path/package" install "$snapshot_package" result="$?" __error_on_result "$result" "Error installing package '$snapshot_package'" && return "$result"