summaryrefslogtreecommitdiffstats
path: root/meta-moblin/packages/tracker/tracker-0.6.95/30-gmime-2.4.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-moblin/packages/tracker/tracker-0.6.95/30-gmime-2.4.patch')
-rw-r--r--meta-moblin/packages/tracker/tracker-0.6.95/30-gmime-2.4.patch435
1 files changed, 0 insertions, 435 deletions
diff --git a/meta-moblin/packages/tracker/tracker-0.6.95/30-gmime-2.4.patch b/meta-moblin/packages/tracker/tracker-0.6.95/30-gmime-2.4.patch
deleted file mode 100644
index 9068e9636a..0000000000
--- a/meta-moblin/packages/tracker/tracker-0.6.95/30-gmime-2.4.patch
+++ /dev/null
@@ -1,435 +0,0 @@
1# Patch pulled from http://cvs.fedoraproject.org/viewvc/rpms/tracker/devel/
2# based on the patch in https://bugzilla.gnome.org/show_bug.cgi?id=564640
3Index: tracker/configure.ac
4===================================================================
5--- tracker.orig/configure.ac 2009-06-09 23:42:44.000000000 +0200
6+++ tracker/configure.ac 2009-09-30 22:53:51.000000000 +0200
7@@ -132,7 +132,7 @@
8 GTK_REQUIRED=2.16.0
9 GLADE_REQUIRED=2.5
10 QDBM_REQUIRED=1.8
11-GMIME_REQUIRED=2.1.0
12+GMIME_REQUIRED=2.4.0
13 LIBXML2_REQUIRED=0.6
14 LIBNOTIFY_REQUIRED=0.4.3
15 HAL_REQUIRED=0.5
16@@ -182,7 +182,7 @@
17 AC_SUBST(PANGO_LIBS)
18
19 # Check for GMime
20-PKG_CHECK_MODULES(GMIME, [gmime-2.0 >= $GMIME_REQUIRED])
21+PKG_CHECK_MODULES(GMIME, [gmime-2.4 >= $GMIME_REQUIRED])
22 AC_SUBST(GMIME_CFLAGS)
23 AC_SUBST(GMIME_LIBS)
24
25Index: tracker/src/tracker-indexer/modules/evolution-common.c
26===================================================================
27--- tracker.orig/src/tracker-indexer/modules/evolution-common.c 2009-05-22 23:31:58.000000000 +0200
28+++ tracker/src/tracker-indexer/modules/evolution-common.c 2009-09-30 22:53:51.000000000 +0200
29@@ -89,41 +89,3 @@
30 return metadata;
31 }
32
33-gchar *
34-evolution_common_get_object_encoding (GMimeObject *object)
35-{
36- const gchar *start_encoding, *end_encoding;
37- const gchar *content_type = NULL;
38-
39- if (GMIME_IS_MESSAGE (object)) {
40- content_type = g_mime_message_get_header (GMIME_MESSAGE (object), "Content-Type");
41- } else if (GMIME_IS_PART (object)) {
42- content_type = g_mime_part_get_content_header (GMIME_PART (object), "Content-Type");
43- }
44-
45- if (!content_type) {
46- return NULL;
47- }
48-
49- start_encoding = strstr (content_type, "charset=");
50-
51- if (!start_encoding) {
52- return NULL;
53- }
54-
55- start_encoding += strlen ("charset=");
56-
57- if (start_encoding[0] == '"') {
58- /* encoding is quoted */
59- start_encoding++;
60- end_encoding = strstr (start_encoding, "\"");
61- } else {
62- end_encoding = strstr (start_encoding, ";");
63- }
64-
65- if (end_encoding) {
66- return g_strndup (start_encoding, end_encoding - start_encoding);
67- } else {
68- return g_strdup (start_encoding);
69- }
70-}
71Index: tracker/src/tracker-indexer/modules/evolution-common.h
72===================================================================
73--- tracker.orig/src/tracker-indexer/modules/evolution-common.h 2009-05-22 23:31:58.000000000 +0200
74+++ tracker/src/tracker-indexer/modules/evolution-common.h 2009-09-30 22:53:51.000000000 +0200
75@@ -55,7 +55,6 @@
76 gint flags,
77 off_t start);
78 TrackerModuleMetadata * evolution_common_get_wrapper_metadata (GMimeDataWrapper *wrapper);
79-gchar * evolution_common_get_object_encoding (GMimeObject *object);
80
81 G_END_DECLS
82
83Index: tracker/src/tracker-indexer/modules/evolution-imap.c
84===================================================================
85--- tracker.orig/src/tracker-indexer/modules/evolution-imap.c 2009-06-09 23:42:49.000000000 +0200
86+++ tracker/src/tracker-indexer/modules/evolution-imap.c 2009-09-30 22:53:51.000000000 +0200
87@@ -557,7 +557,7 @@
88 static gboolean
89 get_attachment_info (const gchar *mime_file,
90 gchar **name,
91- GMimePartEncodingType *encoding)
92+ GMimeContentEncoding *encoding)
93 {
94 GMimeContentType *mime;
95 gchar *tmp, *mime_content;
96@@ -568,7 +568,7 @@
97 }
98
99 if (encoding) {
100- *encoding = GMIME_PART_ENCODING_DEFAULT;
101+ *encoding = GMIME_CONTENT_ENCODING_DEFAULT;
102 }
103
104 if (!g_file_get_contents (mime_file, &tmp, NULL, NULL)) {
105@@ -615,7 +615,7 @@
106 *name = g_strdup (g_mime_content_type_get_parameter (mime, "name"));
107 }
108
109- g_mime_content_type_destroy (mime);
110+ g_object_unref (mime);
111 }
112
113 if (name && !*name) {
114@@ -637,17 +637,17 @@
115 gchar *encoding_str = g_strndup (pos_encoding, pos_end_encoding - pos_encoding);
116
117 if (strcmp (encoding_str, "7bit") == 0) {
118- *encoding = GMIME_PART_ENCODING_7BIT;
119+ *encoding = GMIME_CONTENT_ENCODING_7BIT;
120 } else if (strcmp (encoding_str, "8bit") == 0) {
121- *encoding = GMIME_PART_ENCODING_7BIT;
122+ *encoding = GMIME_CONTENT_ENCODING_8BIT;
123 } else if (strcmp (encoding_str, "binary") == 0) {
124- *encoding = GMIME_PART_ENCODING_BINARY;
125+ *encoding = GMIME_CONTENT_ENCODING_BINARY;
126 } else if (strcmp (encoding_str, "base64") == 0) {
127- *encoding = GMIME_PART_ENCODING_BASE64;
128+ *encoding = GMIME_CONTENT_ENCODING_BASE64;
129 } else if (strcmp (encoding_str, "quoted-printable") == 0) {
130- *encoding = GMIME_PART_ENCODING_QUOTEDPRINTABLE;
131+ *encoding = GMIME_CONTENT_ENCODING_QUOTEDPRINTABLE;
132 } else if (strcmp (encoding_str, "x-uuencode") == 0) {
133- *encoding = GMIME_PART_ENCODING_UUENCODE;
134+ *encoding = GMIME_CONTENT_ENCODING_UUENCODE;
135 }
136
137 g_free (encoding_str);
138@@ -734,14 +734,17 @@
139 }
140
141 static void
142-extract_message_text (GMimeObject *object,
143+extract_message_text (GMimeObject *parent,
144+ GMimeObject *object,
145 gpointer user_data)
146 {
147 GString *body = (GString *) user_data;
148- GMimePartEncodingType part_encoding;
149+ GMimeContentEncoding part_encoding;
150 GMimePart *part;
151- const gchar *content, *disposition, *filename;
152- gchar *encoding, *part_body;
153+ GMimeStream *stream;
154+ GMimeDataWrapper *data;
155+ const gchar *disposition, *filename, *encoding;
156+ gchar *part_body, buffer[1024];
157 gsize len;
158
159 if (GMIME_IS_MESSAGE_PART (object)) {
160@@ -750,7 +753,7 @@
161 message = g_mime_message_part_get_message (GMIME_MESSAGE_PART (object));
162
163 if (message) {
164- g_mime_message_foreach_part (message, extract_message_text, user_data);
165+ g_mime_message_foreach (message, extract_message_text, user_data);
166 g_object_unref (message);
167 }
168
169@@ -762,12 +765,12 @@
170
171 part = GMIME_PART (object);
172 filename = g_mime_part_get_filename (part);
173- disposition = g_mime_part_get_content_disposition (part);
174- part_encoding = g_mime_part_get_encoding (part);
175+ disposition = g_mime_object_get_disposition (GMIME_OBJECT (part));
176+ part_encoding = g_mime_part_get_content_encoding (part);
177
178- if (part_encoding == GMIME_PART_ENCODING_BINARY ||
179- part_encoding == GMIME_PART_ENCODING_BASE64 ||
180- part_encoding == GMIME_PART_ENCODING_UUENCODE) {
181+ if (part_encoding == GMIME_CONTENT_ENCODING_BINARY ||
182+ part_encoding == GMIME_CONTENT_ENCODING_BASE64 ||
183+ part_encoding == GMIME_CONTENT_ENCODING_UUENCODE) {
184 return;
185 }
186
187@@ -782,31 +785,34 @@
188 return;
189 }
190
191- content = g_mime_part_get_content (GMIME_PART (object), &len);
192+ data = g_mime_part_get_content_object (GMIME_PART (object));
193
194- if (!content) {
195- return;
196- }
197+ if (!data)
198+ return;
199
200- if (g_utf8_validate (content, len, NULL)) {
201- g_string_append_len (body, content, (gssize) len);
202- return;
203- }
204+ stream = g_mime_data_wrapper_get_stream (data);
205
206- encoding = evolution_common_get_object_encoding (object);
207+ if (!stream) {
208+ g_object_unref (data);
209+ return;
210+ }
211
212- if (!encoding) {
213- /* FIXME: This will break for non-utf8 text without
214- * the proper content type set
215- */
216- g_string_append_len (body, content, (gssize) len);
217- } else {
218- part_body = g_convert (content, (gssize) len, "utf8", encoding, NULL, NULL, NULL);
219- g_string_append (body, part_body);
220+ encoding = g_mime_object_get_content_disposition_parameter (GMIME_OBJECT (part), "charset");
221
222- g_free (part_body);
223- g_free (encoding);
224- }
225+ while (!g_mime_stream_eos (stream)) {
226+ len = g_mime_stream_read (stream, buffer, 1024);
227+ if (len > 0 && g_utf8_validate (buffer, len, NULL)) {
228+ if (!encoding)
229+ g_string_append_len (body, buffer, (gssize) len);
230+ else {
231+ part_body = g_convert (buffer, (gssize) len, "utf8", encoding, NULL, NULL, NULL);
232+ g_string_append (body, part_body);
233+ g_free (part_body);
234+ }
235+ }
236+ }
237+
238+ g_object_unref (stream);
239 }
240
241 static gchar *
242@@ -846,7 +852,7 @@
243
244 if (message) {
245 body = g_string_new (NULL);
246- g_mime_message_foreach_part (message, extract_message_text, body);
247+ g_mime_message_foreach (message, extract_message_text, body);
248 g_object_unref (message);
249 }
250
251@@ -1030,7 +1036,7 @@
252 TrackerModuleMetadata *metadata;
253 GMimeStream *stream;
254 GMimeDataWrapper *wrapper;
255- GMimePartEncodingType encoding;
256+ GMimeContentEncoding encoding;
257 gchar *path, *name;
258
259 if (!get_attachment_info (mime_file, &name, &encoding)) {
260Index: tracker/src/tracker-indexer/modules/evolution-pop.c
261===================================================================
262--- tracker.orig/src/tracker-indexer/modules/evolution-pop.c 2009-05-22 23:31:58.000000000 +0200
263+++ tracker/src/tracker-indexer/modules/evolution-pop.c 2009-09-30 22:53:51.000000000 +0200
264@@ -175,7 +175,7 @@
265 gchar *number;
266 gint id;
267
268- header = g_mime_message_get_header (message, "X-Evolution");
269+ header = g_mime_object_get_header (GMIME_OBJECT (message), "X-Evolution");
270
271 if (!header) {
272 return -1;
273@@ -253,8 +253,12 @@
274 tracker_evolution_pop_file_get_text (TrackerModuleFile *file)
275 {
276 TrackerEvolutionPopFile *self;
277- gchar *text, *encoding, *utf8_text;
278- gboolean is_html;
279+ const gchar *encoding;
280+ gchar buffer[1024];
281+ guint len;
282+ GString *body;
283+ GMimeStream *stream;
284+ GMimeDataWrapper *data;
285
286 self = TRACKER_EVOLUTION_POP_FILE (file);
287
288@@ -263,27 +267,38 @@
289 return NULL;
290 }
291
292- text = g_mime_message_get_body (self->message, TRUE, &is_html);
293+ data = g_mime_part_get_content_object (GMIME_PART (self->message));
294
295- if (!text) {
296- return NULL;
297- }
298+ if (!data)
299+ return NULL;
300
301- encoding = evolution_common_get_object_encoding (GMIME_OBJECT (self->message));
302+ stream = g_mime_data_wrapper_get_stream (data);
303
304- if (!encoding) {
305- /* FIXME: could still puke on non-utf8
306- * messages without proper content type
307- */
308- return text;
309- }
310+ if (!stream) {
311+ g_object_unref (data);
312+ return NULL;
313+ }
314
315- utf8_text = g_convert (text, -1, "utf8", encoding, NULL, NULL, NULL);
316+ body = g_string_new ("");
317
318- g_free (encoding);
319- g_free (text);
320+ encoding = g_mime_object_get_content_disposition_parameter (GMIME_OBJECT (self->message), "charset");
321
322- return utf8_text;
323+ while (!g_mime_stream_eos (stream)) {
324+ len = g_mime_stream_read (stream, buffer, 1024);
325+ if (len > 0 && g_utf8_validate (buffer, len, NULL)) {
326+ if (!encoding)
327+ g_string_append_len (body, buffer, (gssize) len);
328+ else {
329+ gchar *part_body = g_convert (buffer, (gssize) len, "utf8", encoding, NULL, NULL, NULL);
330+ g_string_append (body, part_body);
331+ g_free (part_body);
332+ }
333+ }
334+ }
335+
336+ g_object_unref (stream);
337+
338+ return g_string_free (body, FALSE);
339 }
340
341 static guint
342@@ -291,7 +306,7 @@
343 {
344 const gchar *header, *pos;
345
346- header = g_mime_message_get_header (message, "X-Evolution");
347+ header = g_mime_object_get_header (GMIME_OBJECT (message), "X-Evolution");
348
349 if (!header) {
350 return 0;
351@@ -304,34 +319,24 @@
352
353 static GList *
354 get_message_recipients (GMimeMessage *message,
355- const gchar *type)
356+ GMimeRecipientType type)
357 {
358 GList *list = NULL;
359- const InternetAddressList *addresses;
360+ InternetAddressList *addresses;
361+ guint len, i;
362
363 addresses = g_mime_message_get_recipients (message, type);
364
365- while (addresses) {
366+ len = internet_address_list_length (addresses);
367+
368+ while (i < len) {
369 InternetAddress *address;
370- gchar *str;
371
372- address = addresses->address;
373+ address = internet_address_list_get_address (addresses, i);
374
375- if (address->name && address->value.addr) {
376- str = g_strdup_printf ("%s %s", address->name, address->value.addr);
377- } else if (address->value.addr) {
378- str = g_strdup (address->value.addr);
379- } else if (address->name) {
380- str = g_strdup (address->name);
381- } else {
382- str = NULL;
383- }
384-
385- if (str) {
386- list = g_list_prepend (list, str);
387- }
388+ list = g_list_prepend (list, internet_address_to_string (address, TRUE));
389
390- addresses = addresses->next;
391+ i++;
392 }
393
394 return g_list_reverse (list);
395@@ -427,7 +432,8 @@
396 }
397
398 static void
399-extract_mime_parts (GMimeObject *object,
400+extract_mime_parts (GMimeObject *parent,
401+ GMimeObject *object,
402 gpointer user_data)
403 {
404 GList **list = (GList **) user_data;
405@@ -440,7 +446,7 @@
406 message = g_mime_message_part_get_message (GMIME_MESSAGE_PART (object));
407
408 if (message) {
409- g_mime_message_foreach_part (message, extract_mime_parts, user_data);
410+ g_mime_message_foreach (message, extract_mime_parts, user_data);
411 g_object_unref (message);
412 }
413
414@@ -451,7 +457,7 @@
415 }
416
417 part = GMIME_PART (object);
418- disposition = g_mime_part_get_content_disposition (part);
419+ disposition = g_mime_object_get_disposition (GMIME_OBJECT (part));
420
421 if (!disposition ||
422 (strcmp (disposition, GMIME_DISPOSITION_ATTACHMENT) != 0 &&
423@@ -484,9 +490,9 @@
424 if (self->message) {
425 /* Iterate through mime parts, if any */
426 if (!self->mime_parts) {
427- g_mime_message_foreach_part (self->message,
428- extract_mime_parts,
429- &self->mime_parts);
430+ g_mime_message_foreach (self->message,
431+ extract_mime_parts,
432+ &self->mime_parts);
433 self->current_mime_part = self->mime_parts;
434 } else {
435 self->current_mime_part = self->current_mime_part->next;