scripts/rvm-install in rvm-0.1.45 vs scripts/rvm-install in rvm-0.1.46
- old
+ new
@@ -94,12 +94,12 @@
rvm_archives_path="${rvm_archives_path:-"$rvm_path/archives"}"
rvm_src_path="${rvm_src_path:-"$rvm_path/src"}"
rvm_log_path="${rvm_log_path:-"$rvm_path/log"}"
if [[ "$rvm_selfcontained" = "0" ]] ; then
- rvm_bin_path="${rvm_bin_path:-"$rvm_prefix/bin"}"
- rvm_man_path="${rvm_man_path:-"$rvm_prefix/share/man"}"
+ rvm_bin_path="${rvm_bin_path:-"${rvm_prefix}bin"}"
+ rvm_man_path="${rvm_man_path:-"${rvm_prefix}share/man"}"
rvm_rc_files="${rvm_rc_files:-"/etc/profile /etc/zshenv"}"
else
rvm_man_path="${rvm_man_path:-"$rvm_path/man"}"
rvm_bin_path="${rvm_bin_path:-"$rvm_path/bin"}"
rvm_rc_files="${rvm_rc_files:-"$HOME/.bash_profile $HOME/.bashrc $HOME/.zshenv"}"
@@ -124,48 +124,48 @@
printf "\n\n Installing rvm to $rvm_path/"
fi
spinner
-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"
+\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"
for file in README LICENCE ; do
spinner
- cp -f "$source_path/$file" "$rvm_path/"
+ \cp -f "$source_path/$file" "$rvm_path/"
done
#
# Scripts
#
for dir_name in config scripts examples lib hooks help patches; do
spinner
- mkdir -p "$rvm_path/$dir_name"
+ \mkdir -p "$rvm_path/$dir_name"
if [[ -d "$source_path/$dir_name" ]] ; then
- cp -Rf "$source_path/$dir_name" "$rvm_path"
+ \cp -Rf "$source_path/$dir_name" "$rvm_path"
fi
done ; unset dir_name
spinner
if [[ ! -s "$rvm_config_path/user" ]] ; then
- mkdir -p "$rvm_config_path/"
+ \mkdir -p "$rvm_config_path/"
echo '# Users settings file, overrides db file settings and persists across installs.' >> $rvm_config_path/user
fi
scripts=("monitor" "match" "log" "install" "color" "db" "fetch" "log" "set" "package")
for script_name in "${scripts[@]}" ; do
spinner
- chmod +x $rvm_scripts_path/$script_name
+ chmod +x "$rvm_scripts_path/$script_name" 2>/dev/null # Hide errors.
done
#
# Bin Scripts
#
# Cleanse and purge...
for file in rvm-prompt rvm rvmsudo rvm-shell rvm-auto-ruby ; do
spinner && perl -e 'sleep 0.2'
- rm -f "$rvm_bin_path/$file"
- cp -f "$source_path/binscripts/$file" $rvm_bin_path/
+ \rm -f "$rvm_bin_path/$file"
+ \cp -f "$source_path/binscripts/$file" $rvm_bin_path/
done
spinner
chmod +x $rvm_bin_path/*
#
@@ -174,11 +174,11 @@
spinner
if [[ -n "$rvm_auto_flag" ]] ; then
printf "Checking rc files... ($rvm_rc_files)"
if [[ "$rvm_loaded_flag" != "1" ]] ; then
for rcfile in $(echo $rvm_rc_files) ; do
- if [[ ! -f $rcfile ]] ; then touch $rcfile ; fi
+ if [[ ! -f $rcfile ]] ; then \touch $rcfile ; fi
if [[ -s "$HOME/.profile" ]] ; then
if ! grep -q '.profile' "$rcfile" ; then
echo " Adding 'if [[ -s \$HOME/.profile ]] ; then source \$HOME ; fi' to $rcfile."
printf "\n# rvm-install added line:\nif [[ -s \$HOME/.profile ]] ; then source \$HOME/.profile ; fi\n" >> $rcfile
fi
@@ -194,39 +194,39 @@
#
# Initial Interpreter Gemsets.
#
spinner
if [[ -d gemsets/ ]] ; then
- mkdir -p "$rvm_gemsets_path"
+ \mkdir -p "$rvm_gemsets_path"
for gemset_file in $(cd gemsets ; find . -iname '*.gems' | sed 's/^\.\///') ; do
destination="$rvm_gemsets_path/$gemset_file"
destination_path="$(dirname "$destination")"
if [[ ! -s "$destination" ]] ; then
- mkdir -p "$destination_path"
- cp "gemsets/$gemset_file" "$destination"
+ \mkdir -p "$destination_path"
+ \cp "gemsets/$gemset_file" "$destination"
fi
done ; unset destination destination_path gemset_file
fi
spinner
if [[ -d patchsets/ ]] ; then
- mkdir -p "$rvm_patchsets_path"
+ \mkdir -p "$rvm_patchsets_path"
for patchset_file in $(cd patchsets ; find . -iname '*' | sed 's/^\.\///') ; do
destination="$rvm_patchsets_path/$patchset_file"
destination_path="$(dirname "$destination")"
if [[ ! -s "$destination" ]] ; then
- mkdir -p "$destination_path"
- cp "patchsets/$patchset_file" "$destination"
+ \mkdir -p "$destination_path"
+ \cp "patchsets/$patchset_file" "$destination"
fi
done ; unset destination destination_path patchset_file
fi
#
# Migrate ~/.rvm/ruby-X,jruby-X,... to ~/.rvm/rubies/ for 0.1.0.
#
rvm_rubies_path="${rvm_rubies_path:-"$rvm_path/rubies"}"
-mkdir -p "$rvm_rubies_path/"
+\mkdir -p "$rvm_rubies_path/"
spinner
for ruby in $rvm_path/ruby-* $rvm_path/jruby-* $rvm_path/mput-* $rvm_path/rbx-* $rvm_path/maglev-* $rvm_path/ree-* ; do
if [[ -d "$ruby" ]] ; then
mv "$ruby" "$rvm_rubies_path/"
new_path="$rvm_rubies_path/$(basename $ruby)"
@@ -278,26 +278,26 @@
original_version="$(basename "$(grep GEM_HOME "$rvm_config_path/default" | awk -F"'" '{print $2}' | sed "s#\%#${rvm_gemset_separator}#")")"
if [[ -n "$original_version" ]]; then
$rvm_scripts_path/alias create default "$original_version" &> /dev/null
fi
unset original_version
- rm -rf "$rvm_config_path/default"
+ \rm -rf "$rvm_config_path/default"
fi
#
# End of gemset migration.
#
printf "\n Correct permissions for base binaries in $rvm_bin_path..."
-mkdir -p $rvm_bin_path
+\mkdir -p $rvm_bin_path
for file in rvm rvmsudo rvm-shell rvm-auto-ruby; do
[[ -s "$rvm_bin_path/$file" ]] && chmod +x "$rvm_bin_path/$file"
done; unset file
printf "\n Copying manpages into place."
for man_file in $(\ls "$install_source_path/man"); do
- rm -rf "$rvm_man_path/$man_file"
- cp -R "$install_source_path/man/$man_file" "$rvm_man_path/"
+ \rm -rf "$rvm_man_path/$man_file"
+ \cp -R "$install_source_path/man/$man_file" "$rvm_man_path/"
done
[[ "$upgrade_flag" = 0 ]] && ./scripts/notes
name="$(awk -F= '/^[[:space:]]*name/{print $2}' ~/.gitconfig 2>/dev/null)"
@@ -317,10 +317,10 @@
printf "\n * Gemset separator is '@' and will remain unless any rubies error using it."
printf "\n$(tput sgr0)\n"
check_rubyopt_conditions
printf "\nUpgrade of RVM in $rvm_path/ is complete.\n\n"
else
- if [[ -z "$rvm_prefix" ]] && [[ "root" != "$(whoami)" ]] ; then
+ if [[ "$rvm_selfcontained" = "1" ]] ; then
printf "\n$(tput setaf 1)You must now finish the install manually:$(tput sgr0)"
printf "\n1) Place the folowing line at the end of your shell's loading files(.bashrc or .bash_profile for bash and .zshrc for zsh), after all path/variable settings:"
printf "\n [[ -s \$HOME/.rvm/scripts/rvm ]] && source \$HOME/.rvm/scripts/rvm"
printf "\n Please note that this must only occur once - so, you only need to add it the first time you install rvm."
printf "\n2) Ensure that there is no 'return' from inside the .bashrc file. (otherwise rvm will be prevented from working properly)."