[PC-BSD Commits] r3358 - pbibuild/modules/firefox3/overlay-dir/bin

svn at pcbsd.org svn at pcbsd.org
Wed Jan 28 12:40:58 PST 2009


Author: kris
Date: 2009-01-28 12:40:58 -0800 (Wed, 28 Jan 2009)
New Revision: 3358

Modified:
   pbibuild/modules/firefox3/overlay-dir/bin/defaultemail
Log:

Updated the defaultemail shell helper for firefox3 to be a bit more robust



Modified: pbibuild/modules/firefox3/overlay-dir/bin/defaultemail
===================================================================
--- pbibuild/modules/firefox3/overlay-dir/bin/defaultemail	2009-01-28 19:34:37 UTC (rev 3357)
+++ pbibuild/modules/firefox3/overlay-dir/bin/defaultemail	2009-01-28 20:40:58 UTC (rev 3358)
@@ -2,27 +2,35 @@
 # Script which acts as the default browser handler for PC-BSD/KDE
 #############################################################################
 
+LD_LIBRARY_PATH=""
+
 USER="`whoami`"
-if [ "$USER" != "root" ]
+HOMEDIR="`cat /etc/passwd | grep ^${USER}: | cut -d ":" -f 6`"
+
+# Check for the right KDE path
+if [ -e "${HOMEDIR}/.kde4/share/config/emaildefaults" -a -z "$EMAIL" ]
 then
-  HOMEDIR="/home/${USER}"
-else
-  HOMEDIR="/root"
+  EMAIL="`cat ${HOMEDIR}/.kde4/share/config/emaildefaults | grep '^EmailClient' | cut -d '=' -f 2`"
 fi
 
-if [ -e "${HOMEDIR}/.kde/share/config/emaildefaults" ]
+# Check for the older kde
+if [ -e "${HOMEDIR}/.kde/share/config/emaildefaults" -a -z "$EMAIL" ]
 then
-  EMAIL="`cat ${HOMEDIR}/.kde/share/config/emaildefaults | grep '^EmailClient=' | cut -d '=' -f 2`"
+  EMAIL="`cat ${HOMEDIR}/.kde4/share/config/emaildefaults | grep '^EmailClient' | cut -d '=' -f 2`"
+fi
 
-  if [ -e "$EMAIL" ]
+if [ ! -z "$EMAIL" ]
+then
+  which $EMAIL >/dev/null 2>/dev/null
+  if [ "$?" = "0" ]
   then
-    ( $EMAIL "$@" ) &
+    $EMAIL "$@"
     exit 0
   else
-    ( /usr/local/bin/kmail "$@" ) &
+    kmail $@  2>>/tmp/mailout
     exit 0
   fi
 else
-  ( /usr/local/bin/kmail "$@" ) &
+  kmail "$@"
   exit 0
 fi



More information about the Commits mailing list