57ff83db59fed432d6e802f895974265970343d6

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #2946 from moinakg/master

Solaris portability tweaks.

Diff

 1diff --git a/lib/completion.zsh b/lib/completion.zsh
 2index fa1d97f4840fbcc6b60f2c385ffe9c98baa7cd5d..83b6efb66d606b43869994741d0c897856956fd9 100644
 3--- a/lib/completion.zsh
 4+++ b/lib/completion.zsh
 5@@ -25,7 +25,12 @@ bindkey -M menuselect '^o' accept-and-infer-next-history
 6 
 7 zstyle ':completion:*:*:*:*:*' menu select
 8 zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#) ([0-9a-z-]#)*=01;34=0=01'
 9-zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
10+if [ "$OSTYPE[0,7]" = "solaris" ]
11+then
12+  zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm"
13+else
14+  zstyle ':completion:*:*:*:*:processes' command "ps -u `whoami` -o pid,user,comm -w -w"
15+fi
16 
17 # disable named-directories autocompletion
18 zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories
19diff --git a/plugins/colored-man/colored-man.plugin.zsh b/plugins/colored-man/colored-man.plugin.zsh
20index 56056284a57ef908b5f682be1964617e186487b5..5c613f49d1fee1832d81ca7d3f0c42abc9d0a1f3 100644
21--- a/plugins/colored-man/colored-man.plugin.zsh
22+++ b/plugins/colored-man/colored-man.plugin.zsh
23@@ -1,3 +1,21 @@
24+if [ "$OSTYPE[0,7]" = "solaris" ]
25+then
26+	if [ ! -x ${HOME}/bin/nroff ]
27+	then
28+		mkdir -p ${HOME}/bin
29+		cat > ${HOME}/bin/nroff <<EOF
30+#!/bin/sh
31+if [ -n "\$_NROFF_U" -a "\$1,\$2,\$3" = "-u0,-Tlp,-man" ]; then
32+	shift
33+	exec /usr/bin/nroff -u\${_NROFF_U} "\$@"
34+fi
35+#-- Some other invocation of nroff
36+exec /usr/bin/nroff "\$@"
37+EOF
38+	chmod +x ${HOME}/bin/nroff
39+	fi
40+fi
41+
42 man() {
43       env \
44       	  LESS_TERMCAP_mb=$(printf "\e[1;31m") \
45@@ -7,5 +25,8 @@ man() {
46 	  LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
47 	  LESS_TERMCAP_ue=$(printf "\e[0m") \
48 	  LESS_TERMCAP_us=$(printf "\e[1;32m") \
49+	  PAGER=/usr/bin/less \
50+	  _NROFF_U=1 \
51+	  PATH=${HOME}/bin:${PATH} \
52 	  			   man "$@"
53 }
54diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
55index 35e074297e865c8adfb82c360936a8e886c9a11b..4a0803210e85a57e1d24f13229521a2d4caa0f2c 100644
56--- a/tools/check_for_upgrade.sh
57+++ b/tools/check_for_upgrade.sh
58@@ -1,7 +1,9 @@
59-#!/bin/sh
60+#!/usr/bin/env zsh
61+
62+zmodload zsh/datetime
63 
64 function _current_epoch() {
65-  echo $(($(date +%s) / 60 / 60 / 24))
66+  echo $(( $EPOCHSECONDS / 60 / 60 / 24 ))
67 }
68 
69 function _update_zsh_update() {