Skip to content

Instantly share code, notes, and snippets.

@Ch00k
Created August 24, 2013 19:21
Show Gist options
  • Select an option

  • Save Ch00k/6329937 to your computer and use it in GitHub Desktop.

Select an option

Save Ch00k/6329937 to your computer and use it in GitHub Desktop.
diff --git a/binscripts/rvm-installer b/binscripts/rvm-installer
index 652c524..c3b1552 100755
--- a/binscripts/rvm-installer
+++ b/binscripts/rvm-installer
@@ -43,6 +43,26 @@ else
(Darwin|FreeBSD|DragonFly) # it's not possible to autodetect on OSX, the help/man does not mention all flags
rvm_tar_command=tar
;;
+ (SunOS)
+ case "$(uname -r)" in
+ (5.10)
+ log "Trying to install GNU version of tar, might require sudo password"
+ if (( UID ))
+ then
+ [[ -x /opt/csw/bin/pkgutil && -f /etc/opt/csw/pkgutil.conf ]] ||
+ sudo pkgadd -a $rvm_path/config/solaris/noask -d http://get.opencsw.org/now 'CSWpkgutil'
+ sudo /opt/csw/bin/pkgutil -iy CSWgtar -t http://mirror.opencsw.org/opencsw/unstable
+ else
+ [[ -x /opt/csw/bin/pkgutil && -f /etc/opt/csw/pkgutil.conf ]] ||
+ pkgadd -a $rvm_path/config/solaris/noask -d http://get.opencsw.org/now 'CSWpkgutil'
+ /opt/csw/bin/pkgutil -iy CSWgtar -t http://mirror.opencsw.org/opencsw/unstable
+ fi
+ rvm_tar_command=gtar
+ ;;
+ (*)
+ rvm_tar_command=tar
+ ;;
+ esac
esac
builtin command -v ${rvm_tar_command:-gtar} >/dev/null ||
fail "Could not find GNU compatible version of 'tar' command, make sure it's available first before continuing installation."
diff --git a/scripts/base b/scripts/base
index d22b191..a8b0243 100755
--- a/scripts/base
+++ b/scripts/base
@@ -28,7 +28,7 @@ then
if [[ -z "${ZSH_VERSION:-}" ]]
then
export PS4
- PS4="+ \$(date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
+ PS4="+ \$(__rvm_date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
fi
fi
diff --git a/scripts/cli b/scripts/cli
index e2630d8..a155771 100755
--- a/scripts/cli
+++ b/scripts/cli
@@ -716,7 +716,7 @@ __rvm_parse_args()
[[ -n "${ZSH_VERSION:-""}" ]] ||
{
set -o errtrace
- export PS4="+ \$(date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
+ export PS4="+ \$(__rvm_date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
}
;;
@@ -932,7 +932,7 @@ Please do one of the following:
export PS4
if [[ -n "$ZSH_VERSION" ]]
then PS4="%F{red}%x:%I %F{green}%N:%i%F{white} %_"
- else PS4="+ \$(date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
+ else PS4="+ \$(__rvm_date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
fi
set -x
}
diff --git a/scripts/functions/checksum b/scripts/functions/checksum
index aec6313..e82e68b 100755
--- a/scripts/functions/checksum
+++ b/scripts/functions/checksum
@@ -15,8 +15,14 @@ __rvm_md5_calculate()
_sum=$(md5sum "$@")
echo ${_sum%% *}
return 0
+ elif
+ builtin command -v md5deep > /dev/null 2>&1
+ then
+ _sum=$(md5deep "$@")
+ echo ${_sum%% *}
+ return 0
else
- for _path in /usr/gnu/bin /sbin /bin /usr/bin /usr/sbin
+ for _path in /usr/gnu/bin /opt/csw/bin /sbin /bin /usr/bin /usr/sbin
do
if
[[ -x "${_path}/md5" ]]
@@ -30,11 +36,17 @@ __rvm_md5_calculate()
_sum=$(${_path}/md5sum "$@")
echo ${_sum%% *}
return 0
+ elif
+ [[ -x "${_path}/md5deep" ]]
+ then
+ _sum=$(${_path}/md5deep "$@")
+ echo ${_sum%% *}
+ return 0
fi
done
fi
- rvm_error "Neither md5sum nor md5 found in the PATH"
+ rvm_error "Neither md5sum, md5 nor md5deep found in the PATH"
return 1
}
diff --git a/scripts/functions/installer b/scripts/functions/installer
index 054646d..f831368 100644
--- a/scripts/functions/installer
+++ b/scripts/functions/installer
@@ -134,8 +134,8 @@ load_installer()
install_source_path="${install_source_path%/scripts}" # install -> scripts/install
source "$install_source_path/scripts/functions/cleanup"
- source "$install_source_path/scripts/functions/support"
source "$install_source_path/scripts/functions/logging"
+ source "$install_source_path/scripts/functions/support"
source "$install_source_path/scripts/version"
if [[ "$install_source_path/scripts" != "." && "$install_source_path/scripts" != "$PWD" ]]
@@ -1336,7 +1336,7 @@ configure_autolibs()
record_installation_time()
{
- date +%s > $rvm_path/installed.at
+ __rvm_date +%s > $rvm_path/installed.at
[[ -s "$rvm_path/RELEASE" ]] || echo "manual" > "$rvm_path/RELEASE"
touch "$rvm_path/config/displayed-notes.txt"
return 0
diff --git a/scripts/functions/manage/base b/scripts/functions/manage/base
index 40d5e6b..d69d6c6 100644
--- a/scripts/functions/manage/base
+++ b/scripts/functions/manage/base
@@ -210,6 +210,12 @@ __rvm_install_source()
__rvm_array_prepend_or_ignore rvm_configure_env CFLAGS= " " "-O3"
__rvm_array_prepend_or_ignore rvm_configure_env CCFLAGS= " " "-O3"
__rvm_array_prepend_or_ignore rvm_configure_env CXXFLAGS= " " "-O3"
+ if
+ [[ "$(uname)" == "SunOS" && "$(uname -r)" == "5.10" ]]
+ then
+ __rvm_update_configure_env AR="/opt/csw/bin/gar"
+ __rvm_update_configure_env MAKE="/opt/csw/bin/gmake"
+ fi
__rvm_log_command "configure" "$rvm_ruby_string - #configuring" \
"${rvm_configure_env[@]}" ./configure "${rvm_configure_flags[@]}" ||
{
@@ -228,7 +234,7 @@ __rvm_install_source()
__rvm_post_configure_${rvm_ruby_interpreter}
fi
- if __rvm_log_command "make" "$rvm_ruby_string - #compiling" ${rvm_ruby_make:-make} "${rvm_make_flags[@]}"
+ if __rvm_log_command "make" "$rvm_ruby_string - #compiling" ${rvm_ruby_make:-__rvm_make} "${rvm_make_flags[@]}"
then true
else
result=$?
@@ -238,7 +244,7 @@ __rvm_install_source()
__rvm_rm_rf "$PWD/.ext/rdoc" # WTF?
- rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
+ rvm_ruby_make_install=${rvm_ruby_make_install:-"__rvm_make install"}
if __rvm_run "install" "$rvm_ruby_make_install" "$rvm_ruby_string - #installing"
then true
@@ -701,8 +707,8 @@ __rvm_manage_rubies()
then
# minified https://github.com/mpapis/home_dotfiles/blob/master/bin/git-summary#L5-L50
case "$(uname)" in
- (Darwin) _older_then="$( date -j -v6m +%F )" ;;
- (*) _older_then="$( date --date="-6months" +%F )" ;;
+ (Darwin) _older_then="$( __rvm_date -j -v6m +%F )" ;;
+ (*) _older_then="$( __rvm_date --date="-6months" +%F )" ;;
esac
fi
__rvm_read_lines rubies < <(
diff --git a/scripts/functions/manage/goruby b/scripts/functions/manage/goruby
index 2ce3574..2c3484f 100644
--- a/scripts/functions/manage/goruby
+++ b/scripts/functions/manage/goruby
@@ -80,7 +80,7 @@ goruby_install()
exit $result
fi
- rvm_ruby_make_install=${rvm_ruby_make_install:-"make install"}
+ rvm_ruby_make_install=${rvm_ruby_make_install:-"__rvm_make install"}
__rvm_run "install" "$rvm_ruby_make_install" "Installing $rvm_ruby_string"
result=$?
diff --git a/scripts/functions/manage/mruby b/scripts/functions/manage/mruby
index 91e6377..350e6e1 100644
--- a/scripts/functions/manage/mruby
+++ b/scripts/functions/manage/mruby
@@ -55,7 +55,7 @@ mruby_install()
return $result
fi
- if __rvm_log_command "make" "$rvm_ruby_string - #compiling" ${rvm_ruby_make:-make} "${rvm_make_flags[@]}"
+ if __rvm_log_command "make" "$rvm_ruby_string - #compiling" ${rvm_ruby_make:-__rvm_make} "${rvm_make_flags[@]}"
then true
else
result=$?
diff --git a/scripts/functions/requirements/solaris b/scripts/functions/requirements/solaris
old mode 100755
new mode 100644
index 8596cab..c9e6d18
--- a/scripts/functions/requirements/solaris
+++ b/scripts/functions/requirements/solaris
@@ -1,13 +1,26 @@
#!/usr/bin/env bash
+requirements_solaris_define()
+{
+ is_a_function requirements_solaris_${_system_version}_define
+ if
+ is_a_function requirements_solaris_${_system_version}_define
+ then
+ requirements_solaris_${_system_version}_define "$@" || return $?
+ else
+ rvm_error "Solaris ${_system_version} is not supported"
+ return 40
+ fi
+}
+
requirements_solaris_lib_installed()
{
- pkg info "$1" >/dev/null 2>&1 || return $?
+ pkg info "$1" > /dev/null 2>&1 || return $?
}
requirements_solaris_custom_lib_installed()
{
- pkginfo | __rvm_grep "${1/_dev/-dev}" >/dev/null || return $?
+ pkginfo -q "$1" || return $?
}
requirements_solaris_libs_install()
@@ -17,35 +30,85 @@ requirements_solaris_libs_install()
requirements_solaris_update_system()
{
- __rvm_try_sudo pkg refresh && __rvm_try_sudo pkg update ||
- {
- typeset ret=$?
- case $ret in
- (4) return 0 ;; # means nothing to install
- esac
- return $ret
- }
+ case "${_system_version}" in
+ (10)
+ return 0
+ ;;
+ (*)
+ __rvm_try_sudo pkg refresh && __rvm_try_sudo pkg update ||
+ {
+ typeset ret=$?
+ case $ret in
+ (4) return 0 ;; # means nothing to install
+ esac
+ return $ret
+ }
+ ;;
+ esac
}
-requirements_solaris_install_libyaml_dev()
+requirements_solaris_check_custom()
{
- requirements_solaris_custom_lib_installed libyaml_dev ||
- {
- # Install OpenCSW repo
- [[ -x /opt/csw/bin/pkgutil && -f /etc/opt/csw/pkgutil.conf ]] ||
- __rvm_try_sudo pkgadd -a $rvm_path/config/solaris/noask -d http://get.opencsw.org/now 'CSWpkgutil' > /dev/null 2>&1 || return $?
- # Install libyaml from unstable branch
- __rvm_try_sudo /opt/csw/bin/pkgutil -i -y libyaml_dev -t http://mirror.opencsw.org/opencsw/unstable > /dev/null 2>&1 || return $?
- }
+ for lib in "$@"
+ do
+ [[ " ${packages_custom[*]} " =~ " $lib " ]] ||
+ requirements_solaris_custom_lib_installed "$lib" || packages_custom+=( "$lib" )
+ done
+ unset lib
}
-requirements_solaris_check_custom()
+requirements_solaris_check_opencsw_enabled()
{
- [[ " ${packages_custom[*]} " =~ " $1 " ]] ||
- requirements_solaris_custom_lib_installed "$1" || packages_custom+=( "$1" )
+ requirements_solaris_custom_lib_installed CSWpkgutil || return $?
}
-requirements_solaris_define()
+requirements_solaris_enable_opencsw()
+{
+ __rvm_try_sudo pkgadd -a $rvm_path/config/solaris/noask -d http://get.opencsw.org/now CSWpkgutil > /dev/null 2>&1 || return $?
+}
+
+requirements_solaris_install_opencsw_libs()
+{
+ requirements_solaris_check_opencsw_enabled || requirements_solaris_enable_opencsw
+ __rvm_try_sudo /opt/csw/bin/pkgutil -iy "$@" -t http://mirror.opencsw.org/opencsw/unstable || return $?
+}
+
+requirements_solaris_install_custom()
+{
+ case "$#" in (0) return 0 ;; esac
+ __rvm_log_command opencsw_install "Installing OpenCSW packages: $*.\nThis may take a while depending on your connection...\n" requirements_solaris_install_opencsw_libs $@
+}
+
+requirements_solaris_10_define()
+{
+ case "$1" in
+ (rvm)
+ requirements_solaris_check_custom CSWbash CSWgit CSWgpatch CSWmd5deep CSWwhich
+ ;;
+ (jruby-head*)
+ requirements_solaris_10_check_custom jdk apache-ant git
+ ;;
+ (jruby*)
+ requirements_solaris_10_check_custom jdk
+ ;;
+ (ir*)
+ requirements_solaris_10_check_custom mono
+ ;;
+ (opal)
+ requirements_solaris_10_check_custom node-devel
+ ;;
+ (*-head)
+ requirements_solaris_check_custom CSWlibyaml-dev CSWlibreadline-dev CSWlibncurses-dev
+ __rvm_update_configure_opt_dir "$1" "/opt/csw"
+ ;;
+ (*)
+ requirements_solaris_check_custom CSWgpatch CSWgcc4core CSWcoreutils CSWpkgconfig CSWlibyaml-dev CSWlibreadline-dev CSWlibncurses-dev
+ __rvm_update_configure_opt_dir "$1" "/opt/csw"
+ ;;
+ esac
+}
+
+requirements_solaris_11_define()
{
case "$1" in
(rvm)
@@ -65,13 +128,13 @@ requirements_solaris_define()
;;
(*-head)
requirements_check text/gnu-patch developer/gcc-45 system/header system/library/math/header-math file/gnu-coreutils git
- requirements_solaris_check_custom libyaml_dev
+ requirements_solaris_check_custom CSWlibyaml-dev
__rvm_update_configure_opt_dir "$1" "/opt/csw"
;;
(*)
requirements_check text/gnu-patch developer/gcc-45 system/header system/library/math file/gnu-coreutils
- requirements_solaris_check_custom libyaml_dev
+ requirements_solaris_check_custom CSWlibyaml-dev
__rvm_update_configure_opt_dir "$1" "/opt/csw"
;;
esac
-}
+}
\ No newline at end of file
diff --git a/scripts/functions/rvmrc_set b/scripts/functions/rvmrc_set
index a6636ca..7cc9454 100644
--- a/scripts/functions/rvmrc_set
+++ b/scripts/functions/rvmrc_set
@@ -6,7 +6,7 @@ __rvm_set_versions_conf()
if [[ -s .versions.conf ]]
then
- \mv .versions.conf .versions.conf.$(date +%m.%d.%Y-%H:%M:%S)
+ \mv .versions.conf .versions.conf.$(__rvm_date +%m.%d.%Y-%H:%M:%S)
rvm_warn ".version.conf is not empty, moving aside to preserve."
fi
@@ -34,7 +34,7 @@ __rvm_set_ruby_version()
if
[[ -s .ruby-version ]]
then
- \mv .ruby-version .ruby-version.$(date +%m.%d.%Y-%H:%M:%S)
+ \mv .ruby-version .ruby-version.$(__rvm_date +%m.%d.%Y-%H:%M:%S)
rvm_warn ".ruby-version is not empty, moving aside to preserve."
fi
typeset __version="$(__rvm_env_string)"
@@ -43,7 +43,7 @@ __rvm_set_ruby_version()
if
[[ -s .ruby-gemset ]]
then
- \mv .ruby-gemset .ruby-gemset.$(date +%m.%d.%Y-%H:%M:%S)
+ \mv .ruby-gemset .ruby-gemset.$(__rvm_date +%m.%d.%Y-%H:%M:%S)
rvm_warn ".ruby-gemset is not empty, moving aside to preserve."
fi
echo "${__version##*@}" > .ruby-gemset
@@ -52,7 +52,7 @@ __rvm_set_ruby_version()
if
[[ -s .ruby-gemset ]]
then
- \mv .ruby-gemset .ruby-gemset.$(date +%m.%d.%Y-%H:%M:%S)
+ \mv .ruby-gemset .ruby-gemset.$(__rvm_date +%m.%d.%Y-%H:%M:%S)
rvm_warn ".ruby-gemset not needed, moving aside to preserve."
fi
;;
@@ -74,7 +74,7 @@ __rvm_set_rvmrc()
if [[ -s .rvmrc ]]
then
- \mv .rvmrc .rvmrc.$(date +%m.%d.%Y-%H:%M:%S)
+ \mv .rvmrc .rvmrc.$(__rvm_date +%m.%d.%Y-%H:%M:%S)
rvm_warn ".rvmrc is not empty, moving aside to preserve."
fi
diff --git a/scripts/functions/support b/scripts/functions/support
index 0236f5c..ccef50a 100644
--- a/scripts/functions/support
+++ b/scripts/functions/support
@@ -172,38 +172,57 @@ __rvm_cd()
return $ret
}
-# Drop in replacement for which compatible with OSX / Zsh
-__rvm_which()
-{
- if command which --skip-alias --skip-functions which >/dev/null 2>&1
- then command which --skip-alias --skip-functions "$@"
- elif command whence whence >/dev/null 2>&1
- then command whence -p "$@"
- elif command which which >/dev/null 2>&1
- then command which "$@"
- elif which which >/dev/null 2>&1
- then which "$@"
- else return 1
- fi
-}
-
-gnu_utils=( awk find sed make tail )
+gnu_utils=( awk find sed make tail date)
case "$(uname)" in
(SunOS)
case "$(uname -v)" in
- (*joyent*) gnu_tools_path=/opt/local/bin ;;
- (*) gnu_tools_path=/usr/gnu/bin ;;
+ (*joyent*)
+ gnu_tools_path=/opt/local/bin
+ gnu_prefix=""
+ ;;
+ (*)
+ case "$(uname -r)" in
+ (5.10)
+ gnu_tools_path=/opt/csw/bin
+ gnu_prefix="g"
+ ;;
+ (5.11)
+ gnu_tools_path=/usr/gnu/bin
+ gnu_prefix=""
+ ;;
+ esac
+ ;;
esac
- [[ -x $gnu_tools_path/grep ]] ||
- rvm_error "ERROR: Missing GNU grep. Make sure it is installed in $gnu_tools_path/grep before using RVM!"
- eval "__rvm_grep() { GREP_OPTIONS=\"\" $gnu_tools_path/grep \"\$@\" || return \$?; }"
+
+ if
+ [[ -x $gnu_tools_path/${gnu_prefix}grep ]]
+ then
+ eval "__rvm_grep() { GREP_OPTIONS=\"\" $gnu_tools_path/${gnu_prefix}grep \"\$@\" || return \$?; }"
+ else
+ rvm_error "ERROR: Missing GNU grep. Make sure it is installed in $gnu_tools_path/${gnu_prefix}grep before using RVM!"
+ exit 1
+ fi
+
+ if
+ [[ -x $gnu_tools_path/${gnu_prefix}which ]]
+ then
+ eval "__rvm_which() { $gnu_tools_path/${gnu_prefix}which \"\$@\" || return \$?; }"
+ else
+ rvm_error "ERROR: Missing GNU which. Make sure it is installed in $gnu_tools_path/${gnu_prefix}grep before using RVM!"
+ exit 1
+ fi
for gnu_util in "${gnu_utils[@]}"
do
- [[ -x $gnu_tools_path/$gnu_util ]] ||
- rvm_error "ERROR: Missing GNU $gnu_util. Make sure it is installed in $gnu_tools_path/$gnu_util before using RVM!"
- eval "__rvm_$gnu_util() { $gnu_tools_path/$gnu_util \"\$@\" || return \$?; }"
+ if
+ [[ -x $gnu_tools_path/$gnu_prefix$gnu_util ]]
+ then
+ eval "__rvm_$gnu_util() { $gnu_tools_path/$gnu_prefix$gnu_util \"\$@\" || return \$?; }"
+ else
+ rvm_error "ERROR: Missing GNU $gnu_util. Make sure it is installed in $gnu_tools_path/$gnu_prefix$gnu_util before using RVM!"
+ exit 1
+ fi
done
;;
(*)
@@ -212,6 +231,20 @@ case "$(uname)" in
GREP_OPTIONS="" \grep "$@" || return $?
}
+ __rvm_which()
+ {
+ if command which --skip-alias --skip-functions which >/dev/null 2>&1
+ then command which --skip-alias --skip-functions "$@"
+ elif command whence whence >/dev/null 2>&1
+ then command whence -p "$@"
+ elif command which which >/dev/null 2>&1
+ then command which "$@"
+ elif which which >/dev/null 2>&1
+ then which "$@"
+ else return 1
+ fi
+ }
+
for gnu_util in "${gnu_utils[@]}"
do
eval "__rvm_$gnu_util() { \\$gnu_util \"\$@\" || return \$?; }"
@@ -219,7 +252,28 @@ case "$(uname)" in
;;
esac
-unset gnu_tools_path gnu_util gnu_utils
+unset gnu_tools_path gnu_prefix gnu_util gnu_utils
+
+# Drop in replacement to support Solaris 10
+# (/sbin and /usr/sbin are not in PATH be default)
+__rvm_mount()
+{
+ case "$(uname)" in
+ (SunOS)
+ case "$(uname -r)" in
+ (5.10)
+ /sbin/mount
+ ;;
+ (*)
+ mount
+ ;;
+ esac
+ ;;
+ (*)
+ mount
+ ;;
+ esac
+}
## duplication marker 32fosjfjsznkjneuera48jae
__rvm_curl_output_control()
diff --git a/scripts/functions/utility_logging b/scripts/functions/utility_logging
index 0096fa5..8ad6ae4 100644
--- a/scripts/functions/utility_logging
+++ b/scripts/functions/utility_logging
@@ -15,14 +15,14 @@ __rvm_run()
__rvm_log_command_caclulate_log_timestamp()
{
- export rvm_log_timestamp="$(date "+%s")"
+ export rvm_log_timestamp="$(__rvm_date "+%s")"
rvm_debug "Log prefix: ${rvm_log_path}/${rvm_log_timestamp}${rvm_ruby_string:+_}${rvm_ruby_string:-}/"
}
__rvm_log_command_caclulate_log_filesystem()
{
export rvm_log_filesystem="$(
- mount | __rvm_awk -v rvm_path=$rvm_path '
+ __rvm_mount | __rvm_awk -v rvm_path=$rvm_path '
BEGIN{longest=""; fstype=""}
{if (index(rvm_path,$3)==1 && length($3)>length(longest)){longest=$3; fstype=$5}}
END{print fstype}
@@ -78,7 +78,7 @@ __rvm_log_command()
[[ -d "${_log%\/*}" ]] || \mkdir -p "${_log%\/*}"
[[ -f "${_log}" ]] || \rm -f "${_log}"
{
- printf "%b" "[$(date +'%Y-%m-%d %H:%M:%S')] ${_command_name}\n"
+ printf "%b" "[$(__rvm_date +'%Y-%m-%d %H:%M:%S')] ${_command_name}\n"
if is_a_function "${_command_name}"
then typeset -f "${_command_name}"
fi
diff --git a/scripts/functions/utility_system b/scripts/functions/utility_system
index 35337f2..2e0aa45 100644
--- a/scripts/functions/utility_system
+++ b/scripts/functions/utility_system
@@ -115,6 +115,8 @@ __rvm_detect_system()
then
_system_name="openindiana"
_system_version="${_system_version#* }"
+ else
+ _system_version="$(uname -r | awk -F'.' '{print $2}')"
fi
;;
(OpenBSD)
diff --git a/scripts/info b/scripts/info
index 6e0f8ad..ea6a23d 100755
--- a/scripts/info
+++ b/scripts/info
@@ -55,7 +55,7 @@ info_rvm()
if
[[ -n "${installed_at:-}" ]] && (( installed_at ))
then
- seconds="$(( $(date +%s) - installed_at ))"
+ seconds="$(( $(__rvm_date +%s) - installed_at ))"
if
(( seconds ))
then
diff --git a/scripts/initialize b/scripts/initialize
index 0fb5667..f6fe5d4 100755
--- a/scripts/initialize
+++ b/scripts/initialize
@@ -8,7 +8,7 @@ then
if [[ -z "${ZSH_VERSION:-}" ]]
then
export PS4
- PS4="+ \$(date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
+ PS4="+ \$(__rvm_date \"+%s.%N\") \${BASH_SOURCE##\${rvm_path:-}} : \${FUNCNAME[0]:+\${FUNCNAME[0]}()} \${LINENO} > "
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment