summaryrefslogtreecommitdiff
path: root/recipes/libmimedir/files/mimedir-update.patch
blob: f3be39eb53e117142c5fb24c9d3e3d7cbb017557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
diff -Nur libmimedir_orig/Makefile.am libmimedir/Makefile.am
--- libmimedir_orig/Makefile.am	2002-08-15 15:36:01.000000000 +0200
+++ libmimedir/Makefile.am	2006-08-04 15:51:06.000000000 +0200
@@ -5,7 +5,22 @@
 	mimedir-1.0.pc.in	\
 	intltool-extract.in	\
 	intltool-merge.in	\
-	intltool-update.in
+	intltool-update.in \
+	debian/changelog \
+	debian/copyright \
+	debian/control \
+	debian/compat \
+	debian/rules \
+	debian/libmimedir0.files \
+	debian/libmimedir-dev.files
+	
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = mimedir-1.0.pc
+
+deb: dist
+	-mkdir $(top_builddir)/debian-build
+	cd $(top_builddir)/debian-build && tar zxf ../$(top_builddir)/$(PACKAGE)-$(VERSION).tar.gz
+	cd $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -S -D -rfakeroot
+	cd $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION) && dpkg-buildpackage -D -rfakeroot
+	-rm -rf $(top_builddir)/debian-build/$(PACKAGE)-$(VERSION)
diff -Nur libmimedir_orig/configure.in libmimedir/configure.in
--- libmimedir_orig/configure.in	2006-02-09 13:30:13.000000000 +0100
+++ libmimedir/configure.in	2006-08-04 15:51:06.000000000 +0200
@@ -3,7 +3,7 @@
 AC_INIT(MIME Directory Library, 0.4.0, mailto:srittau@jroger.in-berlin.de, libmimedir)
 AC_PREREQ(2.53)
 AC_CONFIG_SRCDIR(mimedir/mimedir-attribute.c)
-AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+AM_INIT_AUTOMAKE(libmimedir, AC_PACKAGE_VERSION)
 AC_PROG_INTLTOOL
 AM_CONFIG_HEADER(config.h)
 
diff -Nur libmimedir_orig/mimedir/Makefile.am libmimedir/mimedir/Makefile.am
--- libmimedir_orig/mimedir/Makefile.am	2002-12-19 16:21:27.000000000 +0100
+++ libmimedir/mimedir/Makefile.am	2006-08-04 15:56:36.000000000 +0200
@@ -26,6 +26,7 @@
 	mimedir-period.c		\
 	mimedir-profile.c		\
 	mimedir-recurrence.c		\
+	mimedir-recurrence-rule.c       \
 	mimedir-utils.c			\
 	mimedir-utils.h			\
 	mimedir-valarm.c		\
@@ -52,6 +53,7 @@
 	mimedir-period.h		\
 	mimedir-profile.h		\
 	mimedir-recurrence.h		\
+	mimedir-recurrence-rule.h       \
 	mimedir-valarm.h		\
 	mimedir-vcal.h			\
 	mimedir-vcard.h			\
diff -Nur libmimedir_orig/mimedir/mimedir-attribute.c libmimedir/mimedir/mimedir-attribute.c
--- libmimedir_orig/mimedir/mimedir-attribute.c	2006-01-01 04:38:29.000000000 +0100
+++ libmimedir/mimedir/mimedir-attribute.c	2006-08-04 15:51:06.000000000 +0200
@@ -1417,7 +1417,7 @@
 	g_return_val_if_fail (parameter != NULL, FALSE);
 
 	p = mimedir_attribute_get_parameter (attribute, parameter);
-	if (p)
+	if (p && p->values)
 		return (gchar *) p->values->data;
 	else
 		return NULL;
diff -Nur libmimedir_orig/mimedir/mimedir-recurrence-rule.c libmimedir/mimedir/mimedir-recurrence-rule.c
--- libmimedir_orig/mimedir/mimedir-recurrence-rule.c	1970-01-01 01:00:00.000000000 +0100
+++ libmimedir/mimedir/mimedir-recurrence-rule.c	2006-08-04 15:52:39.000000000 +0200
@@ -0,0 +1,171 @@
+/* RFC 2445 iCal Recurrence Rule Object
+ * Copyright (C) 2004 Phil Blundell <pb@nexus.co.uk>
+ *
+ * $Id: mimedir-recurrence.h,v 1.1 2002/08/28 04:57:12 srittau Exp $
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "mimedir-recurrence-rule.h"
+
+
+#ifndef _
+#define _(x) (dgettext(GETTEXT_PACKAGE, (x)))
+#endif
+
+
+static void	 mimedir_recurrence_rule_class_init	(MIMEDirRecurrenceRuleClass	*klass);
+static void	 mimedir_recurrence_rule_init		(MIMEDirRecurrenceRule		*recurrence);
+static void	 mimedir_recurrence_rule_dispose	(GObject			*object);
+
+
+struct _MIMEDirRecurrenceRulePriv {
+	MIMEDirRecurrenceFrequency frequency;
+	int interval;
+};
+
+static GObjectClass *parent_class = NULL;
+
+/*
+ * Class and Object Management
+ */
+
+GType
+mimedir_recurrence_rule_get_type (void)
+{
+	static GType mimedir_recurrence_rule_type = 0;
+
+	if (!mimedir_recurrence_rule_type) {
+		static const GTypeInfo mimedir_recurrence_rule_info = {
+			sizeof (MIMEDirRecurrenceRuleClass),
+			NULL, /* base_init */
+			NULL, /* base_finalize */
+			(GClassInitFunc) mimedir_recurrence_rule_class_init,
+			NULL, /* class_finalize */
+			NULL, /* class_data */
+			sizeof (MIMEDirRecurrenceRule),
+			1,    /* n_preallocs */
+			(GInstanceInitFunc) mimedir_recurrence_rule_init,
+		};
+
+		mimedir_recurrence_rule_type = g_type_register_static (G_TYPE_OBJECT,
+								       "MIMEDirRecurrenceRule",
+								       &mimedir_recurrence_rule_info,
+								       0);
+	}
+
+	return mimedir_recurrence_rule_type;
+}
+
+
+static void
+mimedir_recurrence_rule_class_init (MIMEDirRecurrenceRuleClass *klass)
+{
+	GObjectClass *gobject_class;
+
+	g_return_if_fail (klass != NULL);
+	g_return_if_fail (MIMEDIR_IS_RECURRENCE_RULE_CLASS (klass));
+
+	gobject_class = G_OBJECT_CLASS (klass);
+
+	gobject_class->dispose      = mimedir_recurrence_rule_dispose;
+
+	parent_class = g_type_class_peek_parent (klass);
+}
+
+
+static void
+mimedir_recurrence_rule_init (MIMEDirRecurrenceRule *rule)
+{
+	MIMEDirRecurrenceRulePriv *priv;
+
+	g_return_if_fail (rule != NULL);
+	g_return_if_fail (MIMEDIR_IS_RECURRENCE_RULE (rule));
+
+	priv = g_new0 (MIMEDirRecurrenceRulePriv, 1);
+	rule->priv = priv;
+}
+
+
+static void
+mimedir_recurrence_rule_dispose (GObject *object)
+{
+	MIMEDirRecurrenceRule *rule;
+
+	g_return_if_fail (object != NULL);
+	g_return_if_fail (MIMEDIR_IS_RECURRENCE_RULE (object));
+
+	rule = MIMEDIR_RECURRENCE_RULE (object);
+
+	g_free (rule->priv);
+	rule->priv = NULL;
+
+	G_OBJECT_CLASS (parent_class)->dispose (object);
+}
+
+/*
+ * Public Methods
+ */
+
+/**
+ * mimedir_recurrence_rule_new:
+ *
+ * Creates a new iCal recurrence object.
+ *
+ * Return value: a new recurrence object
+ **/
+MIMEDirRecurrenceRule *
+mimedir_recurrence_rule_new (void)
+{
+	MIMEDirRecurrenceRule *rule;
+
+	rule = g_object_new (MIMEDIR_TYPE_RECURRENCE_RULE, NULL);
+
+	return rule;
+}
+
+/**
+ * mimedir_recurrence_rule_get_frequency:
+ *
+ * Retrieves the base frequency for the corresponding recurrence object.
+ *
+ * Return value: a #MIMEDirRecurrenceFrequency
+ **/
+MIMEDirRecurrenceFrequency
+mimedir_recurrence_rule_get_frequency (MIMEDirRecurrenceRule *rule)
+{
+	g_return_val_if_fail (MIMEDIR_IS_RECURRENCE_RULE (rule), 0);
+
+	return rule->priv->frequency;
+}
+
+/**
+ * mimedir_recurrence_rule_get_interval:
+ *
+ * Retrieves the interval for the corresponding recurrence object.
+ *
+ * Return value: an #int
+ **/
+int
+mimedir_recurrence_rule_get_interval (MIMEDirRecurrenceRule *rule)
+{
+	g_return_val_if_fail (MIMEDIR_IS_RECURRENCE_RULE (rule), 0);
+
+	return rule->priv->interval;
+}
diff -Nur libmimedir_orig/mimedir/mimedir-recurrence-rule.h libmimedir/mimedir/mimedir-recurrence-rule.h
--- libmimedir_orig/mimedir/mimedir-recurrence-rule.h	1970-01-01 01:00:00.000000000 +0100
+++ libmimedir/mimedir/mimedir-recurrence-rule.h	2006-08-04 15:52:39.000000000 +0200
@@ -0,0 +1,74 @@
+/* RFC 2445 iCal Recurrence Rule Object
+ * Copyright (C) 2004 Phil Blundell <pb@nexus.co.uk>
+ *
+ * $Id: mimedir-recurrence.h,v 1.1 2002/08/28 04:57:12 srittau Exp $
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
+ */
+
+#ifndef __MIMEDIR_RECURRENCE_RULE_H__
+#define __MIMEDIR_RECURRENCE_RULE_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "mimedir/mimedir-datetime.h"
+
+#define MIMEDIR_TYPE_RECURRENCE_RULE		(mimedir_recurrence_get_type())
+#define MIMEDIR_RECURRENCE_RULE(obj)		(G_TYPE_CHECK_INSTANCE_CAST ((obj), MIMEDIR_TYPE_RECURRENCE_RULE, MIMEDirRecurrenceRule))
+#define MIMEDIR_RECURRENCE_RULE_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass), MIMEDIR_TYPE_RECURRENCE_RULE, MIMEDirRecurrenceRuleClass))
+#define MIMEDIR_IS_RECURRENCE_RULE(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), MIMEDIR_TYPE_RECURRENCE_RULE))
+#define MIMEDIR_IS_RECURRENCE_RULE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass), MIMEDIR_TYPE_RECURRENCE_RULE))
+
+typedef struct _MIMEDirRecurrenceRule		MIMEDirRecurrenceRule;
+typedef struct _MIMEDirRecurrenceRulePriv	MIMEDirRecurrenceRulePriv;
+typedef struct _MIMEDirRecurrenceRuleClass	MIMEDirRecurrenceRuleClass;
+
+typedef enum {
+	MIMEDIR_RECURRENCE_RULE_SECONDLY,
+	MIMEDIR_RECURRENCE_RULE_MINUTELY,
+	MIMEDIR_RECURRENCE_RULE_HOURLY,
+	MIMEDIR_RECURRENCE_RULE_DAILY,
+	MIMEDIR_RECURRENCE_RULE_WEEKLY,
+	MIMEDIR_RECURRENCE_RULE_MONTHLY,
+	MIMEDIR_RECURRENCE_RULE_YEARLY,
+} MIMEDirRecurrenceFrequency;
+
+struct _MIMEDirRecurrenceRule
+{
+	GObject parent;
+
+	MIMEDirRecurrenceRulePriv *priv;
+};
+
+struct _MIMEDirRecurrenceRuleClass
+{
+	GObjectClass parent_class;
+};
+
+MIMEDirRecurrenceFrequency	mimedir_recurrence_rule_get_frequency (MIMEDirRecurrenceRule *);
+int				mimedir_recurrence_rule_get_interval (MIMEDirRecurrenceRule *);
+int				mimedir_recurrence_rule_get_count (MIMEDirRecurrenceRule *);
+MIMEDirDateTime		       *mimedir_recurrence_rule_get_end_date (MIMEDirRecurrenceRule *);
+
+void				mimedir_recurrence_rule_set (MIMEDirRecurrenceRule *,
+							     MIMEDirRecurrenceFrequency freq,
+							     int interval);
+
+GType				mimedir_recurrence_rule_get_type		(void);
+MIMEDirRecurrenceRule	       *mimedir_recurrence_rule_new			(void);
+
+#endif
+
diff -Nur libmimedir_orig/mimedir/mimedir-vcomponent.c libmimedir/mimedir/mimedir-vcomponent.c
--- libmimedir_orig/mimedir/mimedir-vcomponent.c	2005-11-26 16:40:20.000000000 +0100
+++ libmimedir/mimedir/mimedir-vcomponent.c	2006-08-04 15:51:06.000000000 +0200
@@ -951,52 +951,33 @@
 
 		s++;
 
-		num = mimedir_vcomponent_parse_number (name, "DURATION", &s, &err);
-		if (err) {
-			g_propagate_error (error, err);
-			return 0;
-		}
-		if (s[0] != 'H') {
-			g_set_error (error, MIMEDIR_ATTRIBUTE_ERROR, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT_STR, "DURATION", name);
-			return 0;
-		}
-		s++;
-		duration += num * SECS_PER_HOUR;
-
-		if (s[0]) {
+		while (s[0] != '\0') {
 			num = mimedir_vcomponent_parse_number (name, "DURATION", &s, &err);
 			if (err) {
 				g_propagate_error (error, err);
 				return 0;
 			}
-			if (s[0] != 'M') {
-				g_set_error (error, MIMEDIR_ATTRIBUTE_ERROR, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT_STR, "DURATION", name);
-				return 0;
-			}
-			s++;
-			duration += num * SECS_PER_MINUTE;
-		}
 
-		if (s[0]) {
-			num = mimedir_vcomponent_parse_number (name, "DURATION", &s, &err);
-			if (err) {
-				g_propagate_error (error, err);
-				return 0;
-			}
-			if (s[0] != 'S') {
+			switch (s[0]) {
+			case 'H':
+				s++;
+				duration += num * SECS_PER_HOUR;
+				break;
+			case 'M':
+				s++;
+				duration += num * SECS_PER_MINUTE;
+				break;
+			case 'S':
+				s++;
+				duration += num;
+				break;
+			default:
 				g_set_error (error, MIMEDIR_ATTRIBUTE_ERROR, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT_STR, "DURATION", name);
 				return 0;
 			}
-			s++;
-			duration += num;
 		}
 	}
 
-	if (s[0] != '\0') {
-		g_set_error (error, MIMEDIR_ATTRIBUTE_ERROR, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT, MIMEDIR_ATTRIBUTE_ERROR_INVALID_FORMAT_STR, "DURATION", name);
-		return 0;
-	}
-
 	return neg ? -duration : duration;
 }
 
@@ -2996,7 +2977,7 @@
 	g_free (priv->location);
 	g_free (priv->location_alt);
 	priv->location     = g_strdup (location);
-	priv->location_alt = g_strdup (uri);
+	priv->location_alt = uri ? g_strdup (uri) : NULL;
 }
 
 /**