lanfuchao / zsh-templates-osx

Automatically exported from code.google.com/p/zsh-templates-osx
GNU General Public License v2.0
0 stars 0 forks source link

Unsupported Platform: FreeBSD #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install on FreeBSD with linux instructions
2. ls
3. man ls

What is the expected output? What do you see instead?
ls:
<directory listing>

conditionals for alias for ls should reflect non-gnu ls on freebsd
this should work:
Index: /etc/zsh/init/zsh/aliases
===================================================================
--- /etc/zsh/init/zsh/aliases   (revision 48)
+++ /etc/zsh/init/zsh/aliases   (working copy)
@@ -11,7 +11,7 @@

-if [[ -x $SWPREFIX/bin/ls ||   $(uname) != Darwin ]]; then  
+if [[ ( -x $SWPREFIX/bin/ls || $(uname) != Darwin) && $(uname) != FreeBSD
]]; then  
   alias ls='ls --color=auto'
 fi

man ls:
<man page for ls>

If the manpath is going to be defined, it should at least have the basic
FreeBSD prepopulations in it first:
Index: zsh/environment
===================================================================
--- zsh/environment (revision 48)
+++ zsh/environment (working copy)
@@ -128,6 +128,10 @@
 #    Add man pages to $MANPATH            #
 ###########################################

+if [[  $(uname) == FreeBSD ]]; then
+   MANPATH=`/usr/bin/manpath`
+fi
+
 # Add /usr/local manpages

    if [[ -d /usr/local/share/man ]];then

Also, the zshrc & zshenv should reflect the different platform, could do
this (or could be made more compact):
Index: zshrc
===================================================================
--- zshrc   (revision 48)
+++ zshrc   (working copy)
@@ -30,7 +30,9 @@
        print "\e[1m WARNING!! /etc/zshenv file DOES NOT EXIST \e[0m"
    elif [[ ! -f /etc/zsh/zshenv && $(uname) == Linux ]]; then
        print "\e[1m WARNING!! /etc/zsh/zshenv file DOES NOT EXIST \e[0m"
-   fi
+   elif [[ ! -f /etc/zsh/zshenv && $(uname) == FreeBSD ]]; then
+                print "\e[1m WARNING!! /etc/zsh/zshenv file DOES NOT EXIST
\e[0m"
+        fi
    if [[ ! -f $HOME/.zshenv ]]; then
        print "\e[1m WARNING!! $HOME/.zshenv file DOES NOT EXIST \e[0m"     
    fi
Index: zshenv
===================================================================
--- zshenv  (revision 48)
+++ zshenv  (working copy)
@@ -65,6 +65,9 @@
 elif [[ $(uname) == Linux ]];then
    ZDOT='/etc/zsh/init/zsh'    
    ZDOT_USER='~/.zsh'
+elif [[ $(uname) == FreeBSD ]];then
+        ZDOT='/etc/zsh/init/zsh'
+        ZDOT_USER='~/.zsh'
 fi

What version of the product are you using? On what operating system?
SVN r48

FreeBSD 7.0

Please provide any additional information below.
Otherwise, so far, works just fine.  I like having some of the
customizations on FreeBSD (especially the auto-sudo for vi/vim).  The
patches above resolve the issues I was having out of the box.  There are
probably more related to differing flags for differing platforms or
differing paths.

Original issue reported on code.google.com by jbsny...@gmail.com on 26 Apr 2008 at 10:34

GoogleCodeExporter commented 8 years ago
Thanks.  I'll incorporate these changes.  Just saw this today for the first 
time.  Feel free to shoot me an email if 
anything else comes up.

Original comment by wgsco...@mac.com on 15 Sep 2008 at 5:04

GoogleCodeExporter commented 8 years ago
Hopefully fixed in revision 59.

Original comment by wgsco...@mac.com on 15 Sep 2008 at 5:31