Thu Mar 19 18:54:43 2009 UTC ()
use time_t consistently rather than GTime, fixes Y2038 issues on
platforms with 64bit time_t
see gnome bugzilla #569113


(drochner)
diff -r1.53 -r1.54 pkgsrc/x11/gnome-panel/distinfo
diff -r1.6 -r1.7 pkgsrc/x11/gnome-panel/patches/patch-ab
diff -r0 -r1.9 pkgsrc/x11/gnome-panel/patches/patch-ac
diff -r0 -r1.4 pkgsrc/x11/gnome-panel/patches/patch-af

cvs diff -r1.53 -r1.54 pkgsrc/x11/gnome-panel/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/x11/gnome-panel/Attic/distinfo 2009/03/16 23:49:20 1.53
+++ pkgsrc/x11/gnome-panel/Attic/distinfo 2009/03/19 18:54:42 1.54
@@ -1,9 +1,11 @@ @@ -1,9 +1,11 @@
1$NetBSD: distinfo,v 1.53 2009/03/16 23:49:20 jmcneill Exp $ 1$NetBSD: distinfo,v 1.54 2009/03/19 18:54:42 drochner Exp $
2 2
3SHA1 (gnome-panel-2.26.0.tar.bz2) = 8b3012a1f080cb7b30c25d867ca371119fc538f4 3SHA1 (gnome-panel-2.26.0.tar.bz2) = 8b3012a1f080cb7b30c25d867ca371119fc538f4
4RMD160 (gnome-panel-2.26.0.tar.bz2) = 5c25eaeba9886d3cccf189f2304581e6a277afd6 4RMD160 (gnome-panel-2.26.0.tar.bz2) = 5c25eaeba9886d3cccf189f2304581e6a277afd6
5Size (gnome-panel-2.26.0.tar.bz2) = 3421179 bytes 5Size (gnome-panel-2.26.0.tar.bz2) = 3421179 bytes
6SHA1 (patch-aa) = e19be3cb14a38e1ea98f368a1fd1f53e1a7d6513 6SHA1 (patch-aa) = e19be3cb14a38e1ea98f368a1fd1f53e1a7d6513
7SHA1 (patch-ab) = 681079355d2f10f4ae40fa90772f457a1fc42f41 7SHA1 (patch-ab) = 5a3788a3eaf6ba4c0c7832e390e2ebe3bbf15161
 8SHA1 (patch-ac) = 5b9855e1cf0bb00635be234ed24a740dd33f5b67
8SHA1 (patch-ad) = c24a5d0a8c1c88d46edfa3e8fc3e4528637a8d31 9SHA1 (patch-ad) = c24a5d0a8c1c88d46edfa3e8fc3e4528637a8d31
9SHA1 (patch-ae) = d85575dc403c67a4fcb0818904ab9b0517f7b8e0 10SHA1 (patch-ae) = d85575dc403c67a4fcb0818904ab9b0517f7b8e0
 11SHA1 (patch-af) = 49057b4991a404a24da3e00b8b8bc64f901abf89

cvs diff -r1.6 -r1.7 pkgsrc/x11/gnome-panel/patches/Attic/patch-ab (expand / switch to unified diff)

--- pkgsrc/x11/gnome-panel/patches/Attic/patch-ab 2009/02/18 17:50:24 1.6
+++ pkgsrc/x11/gnome-panel/patches/Attic/patch-ab 2009/03/19 18:54:42 1.7
@@ -1,38 +1,230 @@ @@ -1,38 +1,230 @@
1$NetBSD: patch-ab,v 1.6 2009/02/18 17:50:24 drochner Exp $ 1$NetBSD: patch-ab,v 1.7 2009/03/19 18:54:42 drochner Exp $
2 2
3--- applets/clock/calendar-client.c.orig 2009-01-13 01:02:20.000000000 +0100 3--- applets/clock/calendar-client.c.orig 2009-01-13 01:02:20.000000000 +0100
4+++ applets/clock/calendar-client.c 4+++ applets/clock/calendar-client.c
5@@ -909,11 +909,12 @@ resolve_timezone_id (const char *tzid, 5@@ -523,7 +523,7 @@ calendar_client_new (void)
 6 *
 7 * "What?", you say, "Something useful in libc?"
 8 */
 9-static inline GTime
 10+static inline time_t
 11 make_time_for_day_begin (int day,
 12 int month,
 13 int year)
 14@@ -543,14 +543,14 @@ make_isodate_for_day_begin (int day,
 15 int month,
 16 int year)
 17 {
 18- GTime utctime;
 19+ time_t utctime;
 20
 21 utctime = make_time_for_day_begin (day, month, year);
 22
 23 return utctime != -1 ? isodate_from_time_t (utctime) : NULL;
 24 }
 25
 26-static GTime
 27+static time_t
 28 get_time_from_property (icalcomponent *ical,
 29 icalproperty_kind prop_kind,
 30 struct icaltimetype (* get_prop_func) (const icalproperty *prop),
 31@@ -624,7 +624,7 @@ get_ical_description (icalcomponent *ica
 32 return g_strdup (icalproperty_get_description (prop));
 33 }
 34
 35-static inline GTime
 36+static inline time_t
 37 get_ical_start_time (icalcomponent *ical,
 38 icaltimezone *default_zone)
 39 {
 40@@ -634,7 +634,7 @@ get_ical_start_time (icalcomponent *ical
 41 default_zone);
 42 }
 43
 44-static inline GTime
 45+static inline time_t
 46 get_ical_end_time (icalcomponent *ical,
 47 icaltimezone *default_zone)
 48 {
 49@@ -646,13 +646,12 @@ get_ical_end_time (icalcomponent *ical,
 50
 51 static gboolean
 52 get_ical_is_all_day (icalcomponent *ical,
 53- GTime start_gtime,
 54+ time_t start_time,
 55 icaltimezone *default_zone)
 56 {
 57 icalproperty *prop;
 58- time_t start_time;
 59 struct tm *start_tm;
 60- GTime end_time;
 61+ time_t end_time;
 62 struct icaldurationtype duration;
 63 struct icaltimetype start_icaltime;
 64
 65@@ -660,7 +659,6 @@ get_ical_is_all_day (icalcomponent *ical
 66 if (start_icaltime.is_date)
 67 return TRUE;
 68
 69- start_time = (time_t) start_gtime;
 70 start_tm = gmtime (&start_time);
 71 if (start_tm->tm_sec != 0 ||
 72 start_tm->tm_min != 0 ||
 73@@ -679,7 +677,7 @@ get_ical_is_all_day (icalcomponent *ical
 74 return icaldurationtype_as_int (duration) % 86400 == 0;
 75 }
 76
 77-static inline GTime
 78+static inline time_t
 79 get_ical_due_time (icalcomponent *ical,
 80 icaltimezone *default_zone)
 81 {
 82@@ -713,7 +711,7 @@ get_ical_percent_complete (icalcomponent
 83 return CLAMP (percent_complete, 0, 100);
 84 }
 85
 86-static inline GTime
 87+static inline time_t
 88 get_ical_completed_time (icalcomponent *ical,
 89 icaltimezone *default_zone)
 90 {
 91@@ -909,11 +907,12 @@ resolve_timezone_id (const char *tzid,
6  92
7 static gboolean 93 static gboolean
8 calendar_appointment_collect_occurrence (ECalComponent *component, 94 calendar_appointment_collect_occurrence (ECalComponent *component,
9- GTime occurrence_start, 95- GTime occurrence_start,
10- GTime occurrence_end, 96- GTime occurrence_end,
11- GSList **collect_loc) 97- GSList **collect_loc)
12+ time_t occurrence_start, 98+ time_t occurrence_start,
13+ time_t occurrence_end, 99+ time_t occurrence_end,
14+ gpointer data) 100+ gpointer data)
15 { 101 {
16 CalendarOccurrence *occurrence; 102 CalendarOccurrence *occurrence;
17+ GSList **collect_loc = data; 103+ GSList **collect_loc = data;
18  104
19 occurrence = g_new0 (CalendarOccurrence, 1); 105 occurrence = g_new0 (CalendarOccurrence, 1);
20 occurrence->start_time = occurrence_start; 106 occurrence->start_time = occurrence_start;
21@@ -943,7 +944,7 @@ calendar_appointment_generate_ocurrences 107@@ -928,8 +927,8 @@ static void
 108 calendar_appointment_generate_ocurrences (CalendarAppointment *appointment,
 109 icalcomponent *ical,
 110 ECal *source,
 111- GTime start,
 112- GTime end,
 113+ time_t start,
 114+ time_t end,
 115 icaltimezone *default_zone)
 116 {
 117 ECalComponent *ecal;
 118@@ -943,7 +942,7 @@ calendar_appointment_generate_ocurrences
22 e_cal_recur_generate_instances (ecal, 119 e_cal_recur_generate_instances (ecal,
23 start, 120 start,
24 end, 121 end,
25- (ECalRecurInstanceFn) calendar_appointment_collect_occurrence, 122- (ECalRecurInstanceFn) calendar_appointment_collect_occurrence,
26+ calendar_appointment_collect_occurrence, 123+ calendar_appointment_collect_occurrence,
27 &appointment->occurrences, 124 &appointment->occurrences,
28 (ECalRecurResolveTimezoneFn) resolve_timezone_id, 125 (ECalRecurResolveTimezoneFn) resolve_timezone_id,
29 source, 126 source,
30@@ -2124,7 +2125,7 @@ calendar_client_set_task_completed (Cale 127@@ -1160,8 +1159,8 @@ static void
 128 calendar_event_generate_ocurrences (CalendarEvent *event,
 129 icalcomponent *ical,
 130 ECal *source,
 131- GTime start,
 132- GTime end,
 133+ time_t start,
 134+ time_t end,
 135 icaltimezone *default_zone)
 136 {
 137 if (event->type != CALENDAR_EVENT_APPOINTMENT)
 138@@ -1332,8 +1331,8 @@ calendar_client_handle_query_result (Cal
 139 gboolean emit_signal;
 140 gboolean events_changed;
 141 GList *l;
 142- GTime month_begin;
 143- GTime month_end;
 144+ time_t month_begin;
 145+ time_t month_end;
 146
 147 client = source->client;
 148
 149@@ -1846,8 +1845,8 @@ typedef struct
 150 {
 151 CalendarClient *client;
 152 GSList *events;
 153- GTime start_time;
 154- GTime end_time;
 155+ time_t start_time;
 156+ time_t end_time;
 157 } FilterData;
 158
 159 typedef void (* CalendarEventFilterFunc) (const char *uid,
 160@@ -1870,8 +1869,8 @@ filter_appointment (const char *uid,
 161 for (l = occurrences; l; l = l->next)
 162 {
 163 CalendarOccurrence *occurrence = l->data;
 164- GTime start_time = occurrence->start_time;
 165- GTime end_time = occurrence->end_time;
 166+ time_t start_time = occurrence->start_time;
 167+ time_t end_time = occurrence->end_time;
 168
 169 if ((start_time >= filter_data->start_time &&
 170 start_time < filter_data->end_time) ||
 171@@ -1924,8 +1923,8 @@ static GSList *
 172 calendar_client_filter_events (CalendarClient *client,
 173 GSList *sources,
 174 CalendarEventFilterFunc filter_func,
 175- GTime start_time,
 176- GTime end_time)
 177+ time_t start_time,
 178+ time_t end_time)
 179 {
 180 FilterData filter_data;
 181 GSList *l;
 182@@ -1966,8 +1965,8 @@ calendar_client_get_events (CalendarClie
 183 {
 184 GSList *appointments;
 185 GSList *tasks;
 186- GTime day_begin;
 187- GTime day_end;
 188+ time_t day_begin;
 189+ time_t day_end;
 190
 191 g_return_val_if_fail (CALENDAR_IS_CLIENT (client), NULL);
 192 g_return_val_if_fail (client->priv->day != -1 &&
 193@@ -2021,8 +2020,8 @@ calendar_client_foreach_appointment_day
 194 {
 195 GSList *appointments, *l;
 196 gboolean marked_days [32] = { FALSE, };
 197- GTime month_begin;
 198- GTime month_end;
 199+ time_t month_begin;
 200+ time_t month_end;
 201 int i;
 202
 203 g_return_if_fail (CALENDAR_IS_CLIENT (client));
 204@@ -2048,7 +2047,7 @@ calendar_client_foreach_appointment_day
 205
 206 if (appointment->start_time)
 207 {
 208- GTime day_time = appointment->start_time;
 209+ time_t day_time = appointment->start_time;
 210
 211 if (day_time >= month_begin)
 212 marked_days [day_from_time_t (day_time)] = TRUE;
 213@@ -2060,7 +2059,7 @@ calendar_client_foreach_appointment_day
 214 /* mark the days for the appointment, no need to add an extra one when duration is a multiple of 86400 */
 215 for (day_offset = 1; day_offset <= duration / 86400 && duration != day_offset * 86400; day_offset++)
 216 {
 217- GTime day_tm = appointment->start_time + day_offset * 86400;
 218+ time_t day_tm = appointment->start_time + day_offset * 86400;
 219
 220 if (day_tm > month_end)
 221 break;
 222@@ -2124,7 +2123,7 @@ calendar_client_set_task_completed (Cale
31 { 223 {
32 struct icaltimetype completed_time; 224 struct icaltimetype completed_time;
33  225
34- completed_time = icaltime_current_time_with_zone (client->priv->zone); 226- completed_time = icaltime_current_time_with_zone (client->priv->zone);
35+ completed_time = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ()); 227+ completed_time = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
36 if (!prop) 228 if (!prop)
37 { 229 {
38 icalcomponent_add_property (ical, 230 icalcomponent_add_property (ical,

File Added: pkgsrc/x11/gnome-panel/patches/Attic/patch-ac
$NetBSD: patch-ac,v 1.9 2009/03/19 18:54:42 drochner Exp $

--- applets/clock/calendar-client.h.orig	2009-03-04 09:49:20.000000000 +0100
+++ applets/clock/calendar-client.h
@@ -65,8 +65,8 @@ struct _CalendarClientClass
 
 typedef struct
 {
-  GTime start_time;
-  GTime end_time;
+  time_t start_time;
+  time_t end_time;
 } CalendarOccurrence;
 
 typedef struct
@@ -77,8 +77,8 @@ typedef struct
   char   *summary;
   char   *description;
   char   *color_string;
-  GTime   start_time;
-  GTime   end_time;
+  time_t  start_time;
+  time_t  end_time;
   guint   is_all_day : 1;
 
   /* Only used internally */
@@ -92,10 +92,10 @@ typedef struct
   char  *description;
   char  *color_string;
   char  *url;
-  GTime  start_time;
-  GTime  due_time;
+  time_t start_time;
+  time_t due_time;
   guint  percent_complete;
-  GTime  completed_time;
+  time_t completed_time;
   int    priority;
 } CalendarTask;
 

File Added: pkgsrc/x11/gnome-panel/patches/Attic/patch-af
$NetBSD: patch-af,v 1.4 2009/03/19 18:54:42 drochner Exp $

--- applets/clock/calendar-window.c.orig	2009-03-04 09:59:24.000000000 +0100
+++ applets/clock/calendar-window.c
@@ -280,12 +280,12 @@ handle_tasks_changed (CalendarWindow *ca
                                     TASK_COLUMN_UID,                   task->uid,
                                     TASK_COLUMN_SUMMARY,               task->summary,
                                     TASK_COLUMN_DESCRIPTION,           task->description,
-                                    TASK_COLUMN_START_TIME,            task->start_time,
-                                    TASK_COLUMN_DUE_TIME,              task->due_time,
+                                    TASK_COLUMN_START_TIME,            (gint64)task->start_time,
+                                    TASK_COLUMN_DUE_TIME,              (gint64)task->due_time,
                                     TASK_COLUMN_PERCENT_COMPLETE,      task->percent_complete,
                                     TASK_COLUMN_PERCENT_COMPLETE_TEXT, percent_complete_text,
                                     TASK_COLUMN_COMPLETED,             task->percent_complete == 100,
-                                    TASK_COLUMN_COMPLETED_TIME,        task->completed_time,
+                                    TASK_COLUMN_COMPLETED_TIME,        (gint64)task->completed_time,
                                     TASK_COLUMN_COLOR,                 task->color_string,
                                     TASK_COLUMN_PRIORITY,              task->priority,
                                     -1);
@@ -425,15 +425,19 @@ filter_out_tasks (GtkTreeModel   *model,
                   GtkTreeIter    *iter,
                   CalendarWindow *calwin)
 {
-        GTime    start_time;
-        GTime    completed_time;
-        GTime    one_day_ago;
+        gint64   start_time64;
+        gint64   completed_time64;
+        time_t   start_time;
+        time_t   completed_time;
+        time_t   one_day_ago;
         gboolean visible;
 
         gtk_tree_model_get (model, iter,
-                            TASK_COLUMN_START_TIME,     &start_time,
-                            TASK_COLUMN_COMPLETED_TIME, &completed_time,
+                            TASK_COLUMN_START_TIME,     &start_time64,
+                            TASK_COLUMN_COMPLETED_TIME, &completed_time64,
                             -1);
+	start_time = start_time64;
+	completed_time = completed_time64;
 
         one_day_ago = *(calwin->priv->current_time) - (24 * 60 * 60);
 
@@ -451,7 +455,8 @@ modify_task_text_attributes (GtkTreeMode
                              gint            column,
                              CalendarWindow *calwin)
 {
-        GTime           due_time;
+        gint64          due_time64;
+        time_t          due_time;
         PangoAttrList  *attr_list;
         PangoAttribute *attr;
         GtkTreeIter     child_iter;
@@ -469,8 +474,9 @@ modify_task_text_attributes (GtkTreeMode
         }
 
         gtk_tree_model_get (GTK_TREE_MODEL (calwin->priv->tasks_model),
-			    &child_iter, TASK_COLUMN_DUE_TIME, &due_time,
+			    &child_iter, TASK_COLUMN_DUE_TIME, &due_time64,
                             -1);
+	due_time = due_time64;
         if (due_time && due_time > *(calwin->priv->current_time))
                 return;
 
@@ -702,12 +708,15 @@ compare_tasks  (GtkTreeModel *model,
 	else if (priority_a > priority_b)
 		return 1;
 	else {
-                GTime due_time_a, due_time_b;
+                gint64 due_time_a64, due_time_b64;
+                time_t due_time_a, due_time_b;
 
                 gtk_tree_model_get (model, a,
-				    TASK_COLUMN_DUE_TIME, &due_time_a, -1);
+				    TASK_COLUMN_DUE_TIME, &due_time_a64, -1);
                 gtk_tree_model_get (model, b,
-				    TASK_COLUMN_DUE_TIME, &due_time_b, -1);
+				    TASK_COLUMN_DUE_TIME, &due_time_b64, -1);
+		due_time_a = due_time_a64;
+		due_time_b = due_time_b64;
 
                 if (due_time_a < due_time_b)
                         return -1;
@@ -906,9 +915,9 @@ handle_appointments_changed (CalendarWin
                                     APPOINTMENT_COLUMN_URI,         appointment->uri,
                                     APPOINTMENT_COLUMN_SUMMARY,     appointment->summary,
                                     APPOINTMENT_COLUMN_DESCRIPTION, appointment->description,
-                                    APPOINTMENT_COLUMN_START_TIME,  appointment->start_time,
+                                    APPOINTMENT_COLUMN_START_TIME,  (gint64)appointment->start_time,
                                     APPOINTMENT_COLUMN_START_TEXT,  start_text,
-                                    APPOINTMENT_COLUMN_END_TIME,    appointment->end_time,
+                                    APPOINTMENT_COLUMN_END_TIME,    (gint64)appointment->end_time,
                                     APPOINTMENT_COLUMN_ALL_DAY,     appointment->is_all_day,
                                     APPOINTMENT_COLUMN_PIXBUF,      appointment->color_string,
                                     -1);
@@ -1098,12 +1107,12 @@ calendar_window_create_tasks_model (Cale
 		G_TYPE_STRING,         /* uid                     */
 		G_TYPE_STRING,         /* summary                 */
 		G_TYPE_STRING,         /* description             */
-		G_TYPE_LONG,           /* start time              */
-		G_TYPE_LONG,           /* due time                */
+		G_TYPE_INT64,          /* start time              */
+		G_TYPE_INT64,          /* due time                */
 		G_TYPE_UINT,           /* percent complete        */
 		G_TYPE_STRING,         /* percent complete text   */
 		G_TYPE_BOOLEAN,        /* completed               */
-		G_TYPE_LONG,           /* completed time          */
+		G_TYPE_INT64,          /* completed time          */
 		PANGO_TYPE_ATTR_LIST,  /* summary text attributes */
 		G_TYPE_STRING,         /* color                   */
 		G_TYPE_INT             /* priority                */
@@ -1147,9 +1156,9 @@ calendar_window_create_appointments_mode
 				    G_TYPE_STRING,   /* uri              */
 				    G_TYPE_STRING,   /* summary          */
 				    G_TYPE_STRING,   /* description      */
-				    G_TYPE_LONG,     /* start time       */
+				    G_TYPE_INT64,    /* start time       */
 				    G_TYPE_STRING,   /* start time text  */
-				    G_TYPE_LONG,     /* end time         */
+				    G_TYPE_INT64,    /* end time         */
 				    G_TYPE_BOOLEAN,  /* all day          */
 				    G_TYPE_STRING);  /* color            */