[evolution/f16] Add patch for RH bug #814663 (broken result of Save as mbox)
Milan Crha
mcrha at fedoraproject.org
Mon Apr 23 07:22:32 UTC 2012
commit 2475cc60ebfe5eaf36e5aa7adb137a4cb5cb6001
Author: Milan Crha <mcrha at redhat.com>
Date: Mon Apr 23 09:22:09 2012 +0200
Add patch for RH bug #814663 (broken result of Save as mbox)
evolution-3.2.3-save-as-mbox.patch | 67 ++++++++++++++++++++++++++++++++++++
evolution.spec | 9 ++++-
2 files changed, 75 insertions(+), 1 deletions(-)
---
diff --git a/evolution-3.2.3-save-as-mbox.patch b/evolution-3.2.3-save-as-mbox.patch
new file mode 100644
index 0000000..77706a3
--- /dev/null
+++ b/evolution-3.2.3-save-as-mbox.patch
@@ -0,0 +1,67 @@
+diff -up evolution-3.2.3/mail/e-mail-folder-utils.c.save-as-mbox evolution-3.2.3/mail/e-mail-folder-utils.c
+--- evolution-3.2.3/mail/e-mail-folder-utils.c.save-as-mbox 2011-09-28 02:22:16.000000000 +0200
++++ evolution-3.2.3/mail/e-mail-folder-utils.c 2012-04-23 09:20:46.594366070 +0200
+@@ -1178,8 +1178,8 @@ e_mail_folder_save_messages_sync (CamelF
+ GError **error)
+ {
+ GFileOutputStream *file_output_stream;
++ CamelStream *base_stream = NULL;
+ GByteArray *byte_array;
+- CamelStream *base_stream;
+ gboolean success = TRUE;
+ guint ii;
+
+@@ -1208,9 +1208,7 @@ e_mail_folder_save_messages_sync (CamelF
+ return FALSE;
+ }
+
+- /* CamelStreamMem takes ownership of the GByteArray. */
+ byte_array = g_byte_array_new ();
+- base_stream = camel_stream_mem_new_with_byte_array (byte_array);
+
+ for (ii = 0; ii < message_uids->len; ii++) {
+ CamelMimeMessage *message;
+@@ -1221,6 +1219,17 @@ e_mail_folder_save_messages_sync (CamelF
+ gint percent;
+ gint retval;
+
++ if (base_stream != NULL)
++ g_object_unref (base_stream);
++
++ /* CamelStreamMem does NOT take ownership of the byte
++ * array when set with camel_stream_mem_set_byte_array().
++ * This allows us to reuse the same memory slab for each
++ * message, which is slightly more efficient. */
++ base_stream = camel_stream_mem_new ();
++ camel_stream_mem_set_byte_array (
++ CAMEL_STREAM_MEM (base_stream), byte_array);
++
+ uid = g_ptr_array_index (message_uids, ii);
+
+ message = camel_folder_get_message_sync (
+@@ -1278,18 +1287,19 @@ e_mail_folder_save_messages_sync (CamelF
+ percent = ((ii + 1) * 100) / message_uids->len;
+ camel_operation_progress (cancellable, percent);
+
+- /* Flush the buffer for the next message.
+- * For memory streams this never fails. */
+- g_seekable_seek (
+- G_SEEKABLE (base_stream),
+- 0, G_SEEK_SET, NULL, NULL);
++ /* Reset the byte array for the next message. */
++ g_byte_array_set_size (byte_array, 0);
+
+ g_object_unref (message);
+ }
+
+ exit:
++ if (base_stream != NULL)
++ g_object_unref (base_stream);
++
++ g_byte_array_free (byte_array, TRUE);
++
+ g_object_unref (file_output_stream);
+- g_object_unref (base_stream);
+
+ camel_operation_pop_message (cancellable);
+
diff --git a/evolution.spec b/evolution.spec
index c105343..9dac51c 100644
--- a/evolution.spec
+++ b/evolution.spec
@@ -28,7 +28,7 @@
Name: evolution
Version: 3.2.3
-Release: 2%{?dist}
+Release: 3%{?dist}
Group: Applications/Productivity
Summary: Mail and calendar client for GNOME
License: GPLv2+ and GFDL
@@ -53,6 +53,9 @@ Patch12: evolution-3.2.3-libpst-0.6.54.patch
# Gnome bug #617557/RH bug #799489
Patch13: evolution-3.2.3-composer-dirty.patch
+# RH bug #814663
+Patch14: evolution-3.2.3-save-as-mbox.patch
+
## Dependencies ###
Requires(pre): GConf2
@@ -211,6 +214,7 @@ This package contains the plugin to import Microsoft Personal Storage Table
%patch11 -p1 -b .help-contents
%patch12 -p1 -b .libpst-0.6.54
%patch13 -p1 -b .composer-dirty
+%patch14 -p1 -b .save-as-mbox
mkdir -p krb5-fakeprefix/include
mkdir -p krb5-fakeprefix/lib
@@ -656,6 +660,9 @@ rm -rf $RPM_BUILD_ROOT
%endif
%changelog
+* Mon Apr 23 2012 Milan Crha <mcrha at redhat.com> - 3.2.3-3
+- Add patch for RH bug #814663 (broken result of Save as mbox)
+
* Wed Mar 07 2012 Milan Crha <mcrha at redhat.com> - 3.2.3-2
- Add patch for RH bug #799489 (set composer dirty on failed send)
More information about the scm-commits
mailing list