[PC-BSD Commits] r3196 - pbibuild/modules/firefox3/overlay-dir
svn at pcbsd.org
svn at pcbsd.org
Wed Jan 7 13:23:19 PST 2009
Author: kris
Date: 2009-01-07 13:23:19 -0800 (Wed, 07 Jan 2009)
New Revision: 3196
Modified:
pbibuild/modules/firefox3/overlay-dir/PBI.RemoveScript.sh
pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh
Log:
Updated the FF3 PBI to work with users homedirs which exist out of /home and root, also work with text mode installs
Modified: pbibuild/modules/firefox3/overlay-dir/PBI.RemoveScript.sh
===================================================================
--- pbibuild/modules/firefox3/overlay-dir/PBI.RemoveScript.sh 2009-01-07 18:30:43 UTC (rev 3195)
+++ pbibuild/modules/firefox3/overlay-dir/PBI.RemoveScript.sh 2009-01-07 21:23:19 UTC (rev 3196)
@@ -16,12 +16,17 @@
kdialog --yesno "Do you want to remove all Firefox user profiles? (This will remove all bookmarks, extensions, themes and settings!)" --title "Remove user profiles"
if [ "$?" = "0" ]
then
- cd /home
- for i in `ls`
+ # Get list of users
+ ULIST="`cut -d ':' -f 1 /etc/passwd | grep -v '^#'`"
+ for i in `${ULIST}`
do
- if [ -e "/home/${i}/.mozilla/firefox" ]
+ # Find the homedir for this user
+ HOMEDIR="`cat /etc/passwd | grep ^${i}: | cut -d ":" -f 6`"
+
+ # Check if we have a mozilla firefox profile and remove it
+ if [ -e "${HOMEDIR}/.mozilla/firefox" ]
then
- rm -rf /home/${i}/.mozilla/firefox
+ rm -rf ${HOMEDIR}/.mozilla/firefox
fi
done
fi
Modified: pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh
===================================================================
--- pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh 2009-01-07 18:30:43 UTC (rev 3195)
+++ pbibuild/modules/firefox3/overlay-dir/PBI.SetupScript.sh 2009-01-07 21:23:19 UTC (rev 3196)
@@ -25,16 +25,12 @@
ln -s /usr/local/etc/fonts /Programs/${PROGDIR}/etc/fonts
fi
-if [ ! -z "$DISPLAY" ]
+if [ "$INSTALLMODE" = "GUI" ]
then
+# Get the users homedir
USER="$USERNAME"
-if [ "$USER" != "root" ]
-then
- HOMEDIR="/home/${USER}"
-else
- HOMEDIR="/root"
-fi
+HOMEDIR="`cat /etc/passwd | grep ^${USERNAME}: | cut -d ":" -f 6`"
if [ -e "${HOMEDIR}/.kde4" ]
then
@@ -76,12 +72,12 @@
else
- # We are installing via text mode, lets set ff3 as the default in KDE
- cd /home
- for i in `ls`
+ # We are installing via text mode, lets set ff3 as the default for kde users
+ USERS="`cut -d ':' -f 1 /etc/passwd | grep -v '^#'`"
+ for i in ${USERS}
do
- HOMEDIR="${i}"
+ HOMEDIR="`cat /etc/passwd | grep ^${i}: | cut -d ":" -f 6`"
if [ -e "${i}/.kde4" ]
then
More information about the Commits
mailing list