[PC-BSD Commits] r824 - pbibuild/modules/firefox/overlay-dir

svn at pcbsd.org svn at pcbsd.org
Mon Nov 5 06:14:05 PST 2007


Author: kris
Date: 2007-11-05 06:14:05 -0800 (Mon, 05 Nov 2007)
New Revision: 824

Modified:
   pbibuild/modules/firefox/overlay-dir/PBI.FirstRun.sh
Log:

Wrote an update to the FF script so that it asks to remove old versions of 
FF before the install, and does it for the user



Modified: pbibuild/modules/firefox/overlay-dir/PBI.FirstRun.sh
===================================================================
--- pbibuild/modules/firefox/overlay-dir/PBI.FirstRun.sh	2007-11-03 18:11:35 UTC (rev 823)
+++ pbibuild/modules/firefox/overlay-dir/PBI.FirstRun.sh	2007-11-05 14:14:05 UTC (rev 824)
@@ -18,6 +18,30 @@
 
 if [ -e "/usr/local/bin/firefox" ]
 then
-	kdialog --sorry "Firefox is already installed, it must be uninstalled before loading this PBI"
-	return 2
+    # Looks like FF is installed, ask if they want to remove the old one
+    ls -al /usr/local/bin/firefox | grep Programs 2>/dev/null
+    if [ "$?" = "0" ]
+    then
+      kdialog --yesno "Firefox is already installed, do you wish to uninstall it?" 
+      if [ "$?" = "0" ]
+      then
+        FF="`ls -al /usr/local/bin/firefox | cut -d '>' -f 2 | cut -d "/" -f 3`"
+        echo $FF | grep Firefox 2>/dev/null
+        if [ "$?" = "0" ]
+        then
+          PBIdelete --remove ${FF}
+        else
+          kdialog --sorry "Firefox could not be automatically removed... Please remove it in Add / Remove Programs and try again."
+          return 2
+        fi
+      else
+        kdialog --sorry "Firefox is already installed, it must be uninstalled before loading this PBI"
+        return 2
+      fi
+      
+    else
+      # Could not find a link to PBI folder
+      kdialog --sorry "Firefox is already installed, it must be uninstalled before loading this PBI"
+      return 2
+    fi
 fi 



More information about the Commits mailing list