5e328e3a9c0784521ae4170f7958183c352bae83

Author
Moinak Ghosh <moinakg@gmail.com>
Committer
Moinak Ghosh <moinakg@gmail.com>
Date

Message

Solaris portability tweaks.

Diff

 1diff --git a/lib/completion.zsh b/lib/completion.zsh
 2index fa1d97f4840fbcc6b60f2c385ffe9c98baa7cd5d..faea36118d56377ec6163fa26334d156bca781a4 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 [ "$PLAT" = "SunOS" ]
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/oh-my-zsh.sh b/oh-my-zsh.sh
20index c217b91bbb57493b91263dc196e75caaec81c5a5..4683c2bc0fff689cfe45939f421296102b9b2b61 100644
21--- a/oh-my-zsh.sh
22+++ b/oh-my-zsh.sh
23@@ -1,3 +1,4 @@
24+PLAT=`uname -s`
25 # Check for updates on initial load...
26 if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
27   /usr/bin/env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
28diff --git a/plugins/colored-man/colored-man.plugin.zsh b/plugins/colored-man/colored-man.plugin.zsh
29index 56056284a57ef908b5f682be1964617e186487b5..4956f4346deae25eaabd612197415620bc5acbe0 100644
30--- a/plugins/colored-man/colored-man.plugin.zsh
31+++ b/plugins/colored-man/colored-man.plugin.zsh
32@@ -1,3 +1,21 @@
33+if [ "${PLAT}" = "SunOS" ]
34+then
35+	if [ ! -x ${HOME}/bin/nroff ]
36+	then
37+		mkdir -p ${HOME}/bin
38+		cat > ${HOME}/bin/nroff <<EOF
39+#!/bin/sh
40+if [ -n "\$_NROFF_U" -a "\$1,\$2,\$3" = "-u0,-Tlp,-man" ]; then
41+	shift
42+	exec /usr/bin/nroff -u\${_NROFF_U} "\$@"
43+fi
44+#-- Some other invocation of nroff
45+exec /usr/bin/nroff "\$@"
46+EOF
47+	chmod +x ${HOME}/bin/nroff
48+	fi
49+fi
50+
51 man() {
52       env \
53       	  LESS_TERMCAP_mb=$(printf "\e[1;31m") \
54@@ -7,5 +25,8 @@ man() {
55 	  LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
56 	  LESS_TERMCAP_ue=$(printf "\e[0m") \
57 	  LESS_TERMCAP_us=$(printf "\e[1;32m") \
58+	  PAGER=/usr/bin/less \
59+	  _NROFF_U=1 \
60+	  PATH=${HOME}/bin:${PATH} \
61 	  			   man "$@"
62 }
63diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
64index 8b8ecae035fa0f47193b57e64fff82eff01af1ea..1aba9a2727a6b7b0365d342424a975b7b57bd2f8 100644
65--- a/tools/check_for_upgrade.sh
66+++ b/tools/check_for_upgrade.sh
67@@ -1,7 +1,13 @@
68 #!/bin/sh
69 
70+PLAT=`uname -s`
71 function _current_epoch() {
72-  echo $(($(date +%s) / 60 / 60 / 24))
73+  if [ "$PLAT" = "SunOS" ]
74+  then
75+    echo $(($(perl -e 'print time') / 60 / 60 / 24))
76+  else
77+    echo $(($(date +%s) / 60 / 60 / 24))
78+  fi
79 }
80 
81 function _update_zsh_update() {