[evolution/f18] Add upstream patch to properly restore DConf settings from a backup

Milan Crha mcrha at fedoraproject.org
Thu Mar 7 12:30:03 UTC 2013


commit 9d34d390fe2310a023a836f300de9ccab164a25c
Author: Milan Crha <mcrha at redhat.com>
Date:   Thu Mar 7 13:29:51 2013 +0100

    Add upstream patch to properly restore DConf settings from a backup

 evolution-3.6.4-restore-dconf.patch |   92 +++++++++++++++++++++++++++++++++++
 evolution.spec                      |    8 +++-
 2 files changed, 99 insertions(+), 1 deletions(-)
---
diff --git a/evolution-3.6.4-restore-dconf.patch b/evolution-3.6.4-restore-dconf.patch
new file mode 100644
index 0000000..521ea13
--- /dev/null
+++ b/evolution-3.6.4-restore-dconf.patch
@@ -0,0 +1,92 @@
+diff --git a/modules/backup-restore/evolution-backup-tool.c b/modules/backup-restore/evolution-backup-tool.c
+index 7c8fc72..10522c5 100644
+--- a/modules/backup-restore/evolution-backup-tool.c
++++ b/modules/backup-restore/evolution-backup-tool.c
+@@ -156,7 +156,8 @@ strip_home_dir (const gchar *dir)
+ }
+ 
+ static GString *
+-replace_variables (const gchar *str)
++replace_variables (const gchar *str,
++		   gboolean remove_dir_sep)
+ {
+ 	GString *res = NULL, *use;
+ 	const gchar *strip_datadir, *strip_configdir;
+@@ -185,9 +186,11 @@ replace_variables (const gchar *str)
+ 
+ 	g_return_val_if_fail (res != NULL, NULL);
+ 
+-	/* remove trailing dir separator */
+-	while (res->len > 0 && res->str[res->len - 1] == G_DIR_SEPARATOR) {
+-		g_string_truncate (res, res->len - 1);
++	if (remove_dir_sep) {
++		/* remove trailing dir separator */
++		while (res->len > 0 && res->str[res->len - 1] == G_DIR_SEPARATOR) {
++			g_string_truncate (res, res->len - 1);
++		}
+ 	}
+ 
+ 	return res;
+@@ -208,7 +211,7 @@ replace_in_file (const gchar *filename,
+ 	g_return_if_fail (replace != NULL);
+ 
+ 	if (strstr (filename, "$")) {
+-		filenamestr = replace_variables (filename);
++		filenamestr = replace_variables (filename, TRUE);
+ 
+ 		if (!filenamestr) {
+ 			g_warning (
+@@ -258,7 +261,7 @@ run_cmd (const gchar *cmd)
+ 
+ 	if (strstr (cmd, "$") != NULL) {
+ 		/* read the doc for g_get_home_dir to know why replacing it here */
+-		GString *str = replace_variables (cmd);
++		GString *str = replace_variables (cmd, FALSE);
+ 
+ 		if (str) {
+ 			print_and_run (str->str);
+@@ -280,14 +283,15 @@ write_dir_file (void)
+ 	GString *content, *filename;
+ 	GError *error = NULL;
+ 
+-	filename = replace_variables ("$HOME/" EVOLUTION_DIR_FILE);
++	filename = replace_variables ("$HOME/" EVOLUTION_DIR_FILE, TRUE);
+ 	g_return_if_fail (filename != NULL);
+ 
+ 	content = replace_variables (
+ 		"[" KEY_FILE_GROUP "]\n"
+ 		"Version=" VERSION "\n"
+ 		"UserDataDir=$STRIPDATADIR\n"
+-		"UserConfigDir=$STRIPCONFIGDIR\n");
++		"UserConfigDir=$STRIPCONFIGDIR\n"
++		, TRUE);
+ 	g_return_if_fail (content != NULL);
+ 
+ 	g_file_set_contents (filename->str, content->str, content->len, &error);
+@@ -453,7 +457,7 @@ get_source_manager_reload_command (void)
+ 	GString *tmp;
+ 	gchar *command;
+ 
+-	tmp = replace_variables (DBUS_SOURCE_REGISTRY_SERVICE_FILE);
++	tmp = replace_variables (DBUS_SOURCE_REGISTRY_SERVICE_FILE, TRUE);
+ 	if (tmp) {
+ 		GKeyFile *key_file;
+ 		gchar *str = NULL;
+@@ -535,7 +539,7 @@ restore (const gchar *filename,
+ 		run_cmd (command);
+ 		g_free (command);
+ 
+-		dir_fn = replace_variables ("$TMP" G_DIR_SEPARATOR_S EVOLUTION_DIR_FILE);
++		dir_fn = replace_variables ("$TMP" G_DIR_SEPARATOR_S EVOLUTION_DIR_FILE, TRUE);
+ 		if (!dir_fn) {
+ 			g_warning ("Failed to create evolution's dir filename");
+ 			goto end;
+@@ -607,7 +611,7 @@ restore (const gchar *filename,
+ 
+ 	if (is_new_format) {
+ 		/* new format has it in DATADIR... */
+-		GString *file = replace_variables (EVOLUTION_DIR ANCIENT_GCONF_DUMP_FILE);
++		GString *file = replace_variables (EVOLUTION_DIR ANCIENT_GCONF_DUMP_FILE, TRUE);
+ 		if (file && g_file_test (file->str, G_FILE_TEST_EXISTS)) {
+ 			/* ancient backup */
+ 			replace_in_file (
diff --git a/evolution.spec b/evolution.spec
index 5d340d2..4ab0d4a 100644
--- a/evolution.spec
+++ b/evolution.spec
@@ -29,7 +29,7 @@
 
 Name: evolution
 Version: 3.6.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: Applications/Productivity
 Summary: Mail and calendar client for GNOME
 License: GPLv2+ and GFDL
@@ -49,6 +49,8 @@ Patch01: evolution-1.4.4-ldap-x86_64-hack.patch
 # RH bug #589555
 Patch02: evolution-2.30.1-help-contents.patch
 
+Patch03: evolution-3.6.4-restore-dconf.patch
+
 ## Dependencies ###
 
 Requires: gnome-icon-theme >= %{gnome_icon_theme_version}
@@ -190,6 +192,7 @@ This package contains the plugin to import Microsoft Personal Storage Table
 %setup -q -n evolution-%{version}
 %patch01 -p1 -b .ldaphack
 %patch02 -p1 -b .help-contents
+%patch03 -p1 -b .restore-dconf
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -528,6 +531,9 @@ rm -rf $RPM_BUILD_ROOT
 %endif
 
 %changelog
+* Thu Mar 07 2013 Milan Crha <mcrha at redhat.com> - 3.6.4-2
+- Add upstream patch to properly restore DConf settings from a backup
+
 * Thu Mar 07 2013 Milan Crha <mcrha at redhat.com> - 3.6.4-1
 - Update to 3.6.4
 - Remove patch for Red Hat bug #475117 (fixed upstream)


More information about the scm-commits mailing list