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

svn at pcbsd.org svn at pcbsd.org
Tue Jan 6 08:30:05 PST 2009


Author: kris
Date: 2009-01-06 08:30:05 -0800 (Tue, 06 Jan 2009)
New Revision: 3183

Modified:
   pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh
Log:

Updated FF3 install script to set FF3 as the default browser when installed in text mode without user interaction



Modified: pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh
===================================================================
--- pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh	2009-01-06 16:18:37 UTC (rev 3182)
+++ pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh	2009-01-06 16:30:05 UTC (rev 3183)
@@ -74,6 +74,52 @@
       mv ${HOMEDIR}/.kdeglobals.new2 ${HOMEDIR}/${KDEDIR}/share/config/kdeglobals
   fi
 
+else
+
+  # We are installing via text mode, lets set ff3 as the default in KDE
+  cd /home
+  for i in `ls`
+  do
+
+    HOMEDIR="${i}"
+
+    if [ -e "${i}/.kde4" ]
+    then
+      KDEDIR=".kde4"
+    else
+      KDEDIR=".kde"
+    fi
+
+    if [ -e "${i}/${KDEDIR}/share/config/kdeglobals" ]
+    then
+      # Strip out the old BrowserApplication line to make way for the new
+      cat ${HOMEDIR}/${KDEDIR}/share/config/kdeglobals | grep -v '^BrowserApplication' > ${HOMEDIR}/.kdeglobals.new
+
+      touch ${HOMEDIR}/.kdeglobals.new2
+      while read line
+      do
+
+         if [ "$line" = "[General]" ]
+         then
+           echo "$line" >> ${HOMEDIR}/.kdeglobals.new2
+           if [ "${KDEDIR}" = ".kde4" ]
+           then
+             echo "BrowserApplication[$e]=!/usr/local/bin/firefox3" >> ${HOMEDIR}/.kdeglobals.new2
+           else
+             echo "BrowserApplication=!/usr/local/bin/firefox3" >> ${HOMEDIR}/.kdeglobals.new2
+           fi
+         else
+           echo "$line" >> ${HOMEDIR}/.kdeglobals.new2
+         fi
+      done < ${HOMEDIR}/.kdeglobals.new
+
+      # all finished, now move it back over kdeglobals
+      rm ${HOMEDIR}/.kdeglobals.new
+      chown ${i}:${i} ${HOMEDIR}/.kdeglobals.new2
+      mv ${i}/.kdeglobals.new2 ${i}/${KDEDIR}/share/config/kdeglobals
+    fi
+  done
+
 fi
 
-echo "LAUNCHCLOSE: /usr/local/bin/firefox3"
+echo "LAUNCHCLOSE: /Programs/bin/firefox3"



More information about the Commits mailing list