summaryrefslogtreecommitdiffstats
path: root/rescue
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-08-07 16:00:48 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-08-07 16:00:48 +0000
commit634c3ecb50569dc28a45cdd9a15c9fdf6d2ac370 (patch)
treee301b233842be1e7efdf7a5807e8ff3347fab4f1 /rescue
parent5670368a7a14ff4512eacace0b05deb78aab014f (diff)
downloaddrakx-634c3ecb50569dc28a45cdd9a15c9fdf6d2ac370.tar
drakx-634c3ecb50569dc28a45cdd9a15c9fdf6d2ac370.tar.gz
drakx-634c3ecb50569dc28a45cdd9a15c9fdf6d2ac370.tar.bz2
drakx-634c3ecb50569dc28a45cdd9a15c9fdf6d2ac370.tar.xz
drakx-634c3ecb50569dc28a45cdd9a15c9fdf6d2ac370.zip
keep firefox and thunderbird user data when upgrading Flash
Diffstat (limited to 'rescue')
-rwxr-xr-xrescue/Flash/scripts/upgrade53
1 files changed, 53 insertions, 0 deletions
diff --git a/rescue/Flash/scripts/upgrade b/rescue/Flash/scripts/upgrade
index 3a15e7212..7b395c4c3 100755
--- a/rescue/Flash/scripts/upgrade
+++ b/rescue/Flash/scripts/upgrade
@@ -23,6 +23,19 @@ config_files="etc/sysconfig/* $config_files_users $config_files_time \
config_files_to_remove="etc/sysconfig/harddrake2"
+mozilla_files=".apps/FirefoxPortable/Data/profile/*.sqlite \
+ .apps/FirefoxPortable/Data/profile/prefs.js \
+ .apps/FirefoxPortable/Data/profile/key3.db \
+ .apps/FirefoxPortable/Data/profile/signons*.txt \
+ .apps/FirefoxPortable/Data/profile/Bookmarks.html \
+ .apps/FirefoxPortable/Data/profile/Cookies.txt \
+ .apps/FirefoxPortable/Data/profile/Downloads.rdf \
+ .apps/FirefoxPortable/Data/profile/History.dat \
+ .apps/ThunderbirdPortable/Data/profile/prefs.js \
+ .apps/ThunderbirdPortable/Data/profile/abook.mab \
+ .apps/ThunderbirdPortable/Data/profile/Mail \
+ .apps/ThunderbirdPortable/Data/profile/ImapMail"
+
function prepare() {
echo "Mounting Mandriva Flash key..."
@@ -137,6 +150,42 @@ function remove_non_user_nor_config_files() {
return 0
}
+function backup_portable_apps_user_data() {
+ echo "Backing up Firefox and Thunderbird user data..."
+ echo
+
+ cd $rootdir
+
+ if [ -e ..keep ]; then
+ mv ..keep ..keep.bak
+ fi
+
+ if [ -e ..keep ]; then
+ echo "remove_non_user_nor_config_files can't work with existing temp dir"
+ return 1
+ fi
+
+ mkdir ..keep
+
+ move_files $mozilla_files
+
+ cd - > /dev/null
+
+ return 0
+}
+
+function restore_portable_apps_user_data() {
+ echo "Restoring Firefox and Thunderbird user data..."
+ echo
+
+ cd $rootdir/..keep || return 1
+ tar c -C $rootdir/..keep . | tar x -C $rootdir
+ rm -rf $rootdir/..keep
+ cd - > /dev/null
+
+ return 0
+}
+
function copy_new_version() {
echo "Copying new Mandriva Flash system..."
@@ -198,8 +247,12 @@ function doit() {
remove_non_user_nor_config_files || return 1
+ backup_portable_apps_user_data || return 1
+
copy_new_version || return 1
+ restore_portable_apps_user_data || return 1
+
merge_config_files || return 1
return 0