[115777] trunk/dports/gnome/gnome-online-accounts
devans at macports.org
devans at macports.org
Fri Jan 10 18:00:46 PST 2014
Revision: 115777
https://trac.macports.org/changeset/115777
Author: devans at macports.org
Date: 2014-01-10 18:00:46 -0800 (Fri, 10 Jan 2014)
Log Message:
-----------
gnome-online-accounts: update to version 3.8.5, apply current upstream patches.
Modified Paths:
--------------
trunk/dports/gnome/gnome-online-accounts/Portfile
Added Paths:
-----------
trunk/dports/gnome/gnome-online-accounts/files/
trunk/dports/gnome/gnome-online-accounts/files/patch-alarm.diff
Modified: trunk/dports/gnome/gnome-online-accounts/Portfile
===================================================================
--- trunk/dports/gnome/gnome-online-accounts/Portfile 2014-01-11 01:16:22 UTC (rev 115776)
+++ trunk/dports/gnome/gnome-online-accounts/Portfile 2014-01-11 02:00:46 UTC (rev 115777)
@@ -4,8 +4,7 @@
PortSystem 1.0
name gnome-online-accounts
-version 3.8.3
-revision 1
+version 3.8.5
license LGPL-2
set branch [join [lrange [split ${version} .] 0 1] .]
description Single sign-on framework for GNOME
@@ -19,8 +18,8 @@
use_xz yes
-checksums rmd160 6cd6b4d20eb1d1983baf3cad2b5edecb554a1b46 \
- sha256 9e5e55c5097b8d7c32c0dfb7d94448795c627723b133e8edd0b846adde63a44b
+checksums rmd160 21889d886fa262e536929ecb6905cfcd3f50a462 \
+ sha256 34d6fbc33bda4c7bba8aa52343ebe1eb8afe1033097c10a2d9979c0a99593e5d
depends_build port:pkgconfig \
port:intltool \
@@ -36,6 +35,8 @@
port:gobject-introspection \
port:gcr
+patchfiles patch-alarm.diff
+
configure.cflags-append -Wno-format-nonliteral
configure.args --enable-introspection=yes
Added: trunk/dports/gnome/gnome-online-accounts/files/patch-alarm.diff
===================================================================
--- trunk/dports/gnome/gnome-online-accounts/files/patch-alarm.diff (rev 0)
+++ trunk/dports/gnome/gnome-online-accounts/files/patch-alarm.diff 2014-01-11 02:00:46 UTC (rev 115777)
@@ -0,0 +1,539 @@
+From cd6ee762c3bfcd2d103f3ff50698032eb0fe6e91 Mon Sep 17 00:00:00 2001
+From: Debarshi Ray <debarshir at gnome.org>
+Date: Fri, 08 Nov 2013 17:33:49 +0000
+Subject: alarm: Do not clear the wrong objects when setting the time
+
+When the time is set using goa_alarm_set_time, we cancel the existing
+self->priv->cancellable and replace it with a new one. Then we take a
+reference to a new context and time. However, since when we cancelled
+the old cancellable, we triggered a chain of events which cause
+clear_scheduled_wakeups to be invoked from a idle callback. By the time
+it gets invoked, self->priv->cancellable, self->priv->context and
+self->priv->time point to the new objects that were set up in
+goa_alarm_set_time, which we don't want to clear.
+
+Actually, there is no point in clearing them in
+clear_scheduled_wakeups, because goa_alarm_set_time already clears up
+the older objects and the only other time we want to clear them is in
+dispose.
+
+Fixes: https://bugzilla.gnome.org/711696
+---
+diff --git a/src/goaidentity/goaalarm.c b/src/goaidentity/goaalarm.c
+index 5f50243..112cb00 100644
+--- src/goaidentity/goaalarm.c
++++ src/goaidentity/goaalarm.c
+@@ -151,15 +151,9 @@ clear_scheduled_wakeups (GoaAlarm *self)
+ break;
+ }
+
+- g_clear_object (&self->priv->cancellable);
+-
+- g_clear_pointer (&self->priv->context, (GDestroyNotify) g_main_context_unref);
+-
+ g_clear_pointer (&self->priv->previous_wakeup_time,
+ (GDestroyNotify) g_date_time_unref);
+
+- g_clear_pointer (&self->priv->time, (GDestroyNotify) g_date_time_unref);
+-
+ g_assert (self->priv->timeout.source == NULL);
+
+ self->priv->type = GOA_ALARM_TYPE_UNSCHEDULED;
+@@ -167,6 +161,18 @@ clear_scheduled_wakeups (GoaAlarm *self)
+ }
+
+ static void
++goa_alarm_dispose (GObject *object)
++{
++ GoaAlarm *self = GOA_ALARM (object);
++
++ g_clear_object (&self->priv->cancellable);
++ g_clear_pointer (&self->priv->context, (GDestroyNotify) g_main_context_unref);
++ g_clear_pointer (&self->priv->time, (GDestroyNotify) g_date_time_unref);
++
++ G_OBJECT_CLASS (goa_alarm_parent_class)->dispose (object);
++}
++
++static void
+ goa_alarm_finalize (GObject *object)
+ {
+ GoaAlarm *self = GOA_ALARM (object);
+@@ -223,6 +229,7 @@ goa_alarm_class_init (GoaAlarmClass *klass)
+
+ object_class = G_OBJECT_CLASS (klass);
+
++ object_class->dispose = goa_alarm_dispose;
+ object_class->finalize = goa_alarm_finalize;
+ object_class->get_property = goa_alarm_get_property;
+ object_class->set_property = goa_alarm_set_property;
+@@ -637,6 +644,7 @@ goa_alarm_set_time (GoaAlarm *self, GDateTime *time, GCancellable *cancellable)
+
+ self->priv->time = time;
+
++ g_clear_pointer (&self->priv->context, (GDestroyNotify) g_main_context_unref);
+ self->priv->context = g_main_context_ref (g_main_context_default ());
+
+ schedule_wakeups (self);
+--
+cgit v0.9.2
+From 5cbed5062f292a69fe1a514425ced1bd19589cbc Mon Sep 17 00:00:00 2001
+From: Debarshi Ray <debarshir at gnome.org>
+Date: Fri, 08 Nov 2013 17:36:46 +0000
+Subject: alarm: The global default main context is always the same
+
+Fixes: https://bugzilla.gnome.org/711696
+---
+diff --git a/src/goaidentity/goaalarm.c b/src/goaidentity/goaalarm.c
+index 112cb00..e51df73 100644
+--- src/goaidentity/goaalarm.c
++++ src/goaidentity/goaalarm.c
+@@ -644,8 +644,8 @@ goa_alarm_set_time (GoaAlarm *self, GDateTime *time, GCancellable *cancellable)
+
+ self->priv->time = time;
+
+- g_clear_pointer (&self->priv->context, (GDestroyNotify) g_main_context_unref);
+- self->priv->context = g_main_context_ref (g_main_context_default ());
++ if (self->priv->context == NULL)
++ self->priv->context = g_main_context_ref (g_main_context_default ());
+
+ schedule_wakeups (self);
+
+--
+cgit v0.9.2
+From 8d0d36ecd67f4e020965efb74373db4644008bef Mon Sep 17 00:00:00 2001
+From: Debarshi Ray <debarshir at gnome.org>
+Date: Mon, 11 Nov 2013 10:51:42 +0000
+Subject: alarm: Use the same GSource pointer for TIMER and TIMEOUT alarms
+
+Simplifies the code so that it is easier to tag the "cancelled"
+handler with the correct GSource and GInputStream (if any) that are to
+be cleaned.
+
+Fixes: https://bugzilla.gnome.org/711696
+---
+diff --git a/src/goaidentity/goaalarm.c b/src/goaidentity/goaalarm.c
+index e51df73..eccfa09 100644
+--- src/goaidentity/goaalarm.c
++++ src/goaidentity/goaalarm.c
+@@ -1,6 +1,6 @@
+ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+ /*
+- * Copyright (C) 2012 Red Hat, Inc.
++ * Copyright (C) 2012, 2013 Red Hat, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+@@ -39,17 +39,6 @@
+
+ #include "goalogging.h"
+
+-typedef struct
+-{
+- GSource *source;
+- GInputStream *stream;
+-} Timer;
+-
+-typedef struct
+-{
+- GSource *source;
+-} Timeout;
+-
+ #define MAX_TIMEOUT_INTERVAL (10 *1000)
+
+ typedef enum
+@@ -70,11 +59,8 @@ struct _GoaAlarmPrivate
+ GRecMutex lock;
+
+ GoaAlarmType type;
+- union
+- {
+- Timer timer;
+- Timeout timeout;
+- };
++ GSource *scheduled_wakeup_source;
++ GInputStream *stream; /* NULL, unless using timerfd */
+ };
+
+ enum
+@@ -110,10 +96,10 @@ clear_scheduled_timer_wakeups (GoaAlarm *self)
+ GError *error;
+ gboolean is_closed;
+
+- g_clear_pointer (&self->priv->timer.source, (GDestroyNotify) g_source_destroy);
++ g_clear_pointer (&self->priv->scheduled_wakeup_source, (GDestroyNotify) g_source_destroy);
+
+ error = NULL;
+- is_closed = g_input_stream_close (self->priv->timer.stream, NULL, &error);
++ is_closed = g_input_stream_close (self->priv->stream, NULL, &error);
+
+ if (!is_closed)
+ {
+@@ -121,14 +107,14 @@ clear_scheduled_timer_wakeups (GoaAlarm *self)
+ g_error_free (error);
+ }
+
+- g_clear_object (&self->priv->timer.stream);
++ g_clear_object (&self->priv->stream);
+ #endif
+ }
+
+ static void
+ clear_scheduled_timeout_wakeups (GoaAlarm *self)
+ {
+- g_clear_pointer (&self->priv->timeout.source, (GDestroyNotify) g_source_destroy);
++ g_clear_pointer (&self->priv->scheduled_wakeup_source, (GDestroyNotify) g_source_destroy);
+ }
+
+ static void
+@@ -154,8 +140,6 @@ clear_scheduled_wakeups (GoaAlarm *self)
+ g_clear_pointer (&self->priv->previous_wakeup_time,
+ (GDestroyNotify) g_date_time_unref);
+
+- g_assert (self->priv->timeout.source == NULL);
+-
+ self->priv->type = GOA_ALARM_TYPE_UNSCHEDULED;
+ g_rec_mutex_unlock (&self->priv->lock);
+ }
+@@ -435,7 +419,7 @@ clear_timer_source (GTask *task)
+ GoaAlarm *self;
+
+ self = g_task_get_source_object (task);
+- self->priv->timer.source = NULL;
++ self->priv->scheduled_wakeup_source = NULL;
+
+ g_object_unref (task);
+ }
+@@ -480,19 +464,19 @@ schedule_wakeups_with_timerfd (GoaAlarm *self)
+ }
+
+ self->priv->type = GOA_ALARM_TYPE_TIMER;
+- self->priv->timer.stream = g_unix_input_stream_new (fd, TRUE);
++ self->priv->stream = g_unix_input_stream_new (fd, TRUE);
+
+ task = g_task_new (self, self->priv->cancellable, NULL, NULL);
+
+ source =
+ g_pollable_input_stream_create_source (G_POLLABLE_INPUT_STREAM
+- (self->priv->timer.stream),
++ (self->priv->stream),
+ self->priv->cancellable);
+- self->priv->timer.source = source;
+- g_source_set_callback (self->priv->timer.source,
++ self->priv->scheduled_wakeup_source = source;
++ g_source_set_callback (self->priv->scheduled_wakeup_source,
+ (GSourceFunc) on_timer_source_ready, task,
+ (GDestroyNotify) clear_timer_source);
+- g_source_attach (self->priv->timer.source, self->priv->context);
++ g_source_attach (self->priv->scheduled_wakeup_source, self->priv->context);
+ g_source_unref (source);
+
+ return TRUE;
+@@ -528,7 +512,7 @@ out:
+ static void
+ clear_timeout_source_pointer (GoaAlarm *self)
+ {
+- self->priv->timeout.source = NULL;
++ self->priv->scheduled_wakeup_source = NULL;
+ }
+
+ static void
+@@ -556,13 +540,13 @@ schedule_wakeups_with_timeout_source (GoaAlarm *self)
+
+ source = g_timeout_source_new (interval);
+
+- self->priv->timeout.source = source;
+- g_source_set_callback (self->priv->timeout.source,
++ self->priv->scheduled_wakeup_source = source;
++ g_source_set_callback (self->priv->scheduled_wakeup_source,
+ (GSourceFunc)
+ on_timeout_source_ready,
+ self, (GDestroyNotify) clear_timeout_source_pointer);
+
+- g_source_attach (self->priv->timeout.source, self->priv->context);
++ g_source_attach (self->priv->scheduled_wakeup_source, self->priv->context);
+ g_source_unref (source);
+ }
+
+--
+cgit v0.9.2
+From b7deea49691d7a9c1f4b2c7acdf9b77f2d69fda4 Mon Sep 17 00:00:00 2001
+From: Debarshi Ray <debarshir at gnome.org>
+Date: Mon, 11 Nov 2013 12:11:28 +0000
+Subject: alarm: Tag the "cancelled" handler with the correct source and stream
+
+When a time is set using goa_alarm_set_time, we try to clear the older
+source and stream by cancelling self->priv->cancellable. However,
+before we have had a chance to actually clear them in an idle callback,
+a new source and stream corresponding to the new time is set. This
+causes the older source and stream to be leaked, and instead the newly
+created objects are cleared.
+
+This is wrong. To set things right, we tag the cancelled handler with
+the older source and stream before they are overwritten.
+
+Fixes: https://bugzilla.gnome.org/711696
+---
+diff --git a/src/goaidentity/goaalarm.c b/src/goaidentity/goaalarm.c
+index eccfa09..442f275 100644
+--- src/goaidentity/goaalarm.c
++++ src/goaidentity/goaalarm.c
+@@ -90,16 +90,16 @@ clear_scheduled_immediate_wakeup (GoaAlarm *self)
+ }
+
+ static void
+-clear_scheduled_timer_wakeups (GoaAlarm *self)
++clear_scheduled_timer_wakeups (GoaAlarm *self, GSource *source, GInputStream *stream)
+ {
+ #ifdef HAVE_TIMERFD
+ GError *error;
+ gboolean is_closed;
+
+- g_clear_pointer (&self->priv->scheduled_wakeup_source, (GDestroyNotify) g_source_destroy);
++ g_source_destroy (source);
+
+ error = NULL;
+- is_closed = g_input_stream_close (self->priv->stream, NULL, &error);
++ is_closed = g_input_stream_close (stream, NULL, &error);
+
+ if (!is_closed)
+ {
+@@ -107,18 +107,18 @@ clear_scheduled_timer_wakeups (GoaAlarm *self)
+ g_error_free (error);
+ }
+
+- g_clear_object (&self->priv->stream);
++ g_object_unref (stream);
+ #endif
+ }
+
+ static void
+-clear_scheduled_timeout_wakeups (GoaAlarm *self)
++clear_scheduled_timeout_wakeups (GoaAlarm *self, GSource *source)
+ {
+- g_clear_pointer (&self->priv->scheduled_wakeup_source, (GDestroyNotify) g_source_destroy);
++ g_source_destroy (source);
+ }
+
+ static void
+-clear_scheduled_wakeups (GoaAlarm *self)
++clear_scheduled_wakeups (GoaAlarm *self, GSource *source, GInputStream *stream)
+ {
+ g_rec_mutex_lock (&self->priv->lock);
+ clear_scheduled_immediate_wakeup (self);
+@@ -126,11 +126,11 @@ clear_scheduled_wakeups (GoaAlarm *self)
+ switch (self->priv->type)
+ {
+ case GOA_ALARM_TYPE_TIMER:
+- clear_scheduled_timer_wakeups (self);
++ clear_scheduled_timer_wakeups (self, source, stream);
+ break;
+
+ case GOA_ALARM_TYPE_TIMEOUT:
+- clear_scheduled_timeout_wakeups (self);
++ clear_scheduled_timeout_wakeups (self, source);
+ break;
+
+ default:
+@@ -161,7 +161,7 @@ goa_alarm_finalize (GObject *object)
+ {
+ GoaAlarm *self = GOA_ALARM (object);
+
+- clear_scheduled_wakeups (self);
++ clear_scheduled_wakeups (self, self->priv->scheduled_wakeup_source, self->priv->stream);
+
+ G_OBJECT_CLASS (goa_alarm_parent_class)->finalize (object);
+ }
+@@ -250,9 +250,18 @@ goa_alarm_init (GoaAlarm *self)
+ static gboolean
+ async_alarm_cancel_idle_cb (gpointer user_data)
+ {
+- GoaAlarm *self = user_data;
++ GoaAlarm *self;
++ GInputStream *stream;
++ GSource *source;
++ GTask *task = G_TASK (user_data);
++ gpointer task_data;
+
+- clear_scheduled_wakeups (self);
++ self = g_task_get_source_object (task);
++ source = (GSource *) g_object_get_data (G_OBJECT (task), "alarm-scheduled-wakeup-source");
++ task_data = g_object_get_data (G_OBJECT (task), "alarm-stream");
++ stream = (task_data == NULL) ? NULL : G_INPUT_STREAM (task_data);
++
++ clear_scheduled_wakeups (self, source, stream);
+ return G_SOURCE_REMOVE;
+ }
+
+@@ -261,13 +270,25 @@ on_cancelled (GCancellable *cancellable, gpointer user_data)
+ {
+ GoaAlarm *self = GOA_ALARM (user_data);
+ GSource *idle_source;
++ GTask *task;
+
++ task = g_task_new (self, NULL, NULL, NULL);
++
++ g_object_set_data_full (G_OBJECT (task),
++ "alarm-scheduled-wakeup-source",
++ g_source_ref (self->priv->scheduled_wakeup_source),
++ (GDestroyNotify) g_source_unref);
++
++ if (self->priv->stream != NULL)
++ g_object_set_data_full (G_OBJECT (task), "alarm-stream", g_object_ref (self->priv->stream), g_object_unref);
+
+ idle_source = g_idle_source_new ();
+ g_source_set_priority (idle_source, G_PRIORITY_HIGH_IDLE);
+- g_source_set_callback (idle_source, async_alarm_cancel_idle_cb, g_object_ref (self), g_object_unref);
++ g_source_set_callback (idle_source, async_alarm_cancel_idle_cb, g_object_ref (task), g_object_unref);
+ g_source_attach (idle_source, self->priv->context);
+ g_source_unref (idle_source);
++
++ g_object_unref (task);
+ }
+
+ static void
+@@ -412,17 +433,6 @@ out:
+ g_rec_mutex_unlock (&self->priv->lock);
+ return run_again;
+ }
+-
+-static void
+-clear_timer_source (GTask *task)
+-{
+- GoaAlarm *self;
+-
+- self = g_task_get_source_object (task);
+- self->priv->scheduled_wakeup_source = NULL;
+-
+- g_object_unref (task);
+-}
+ #endif
+
+ static gboolean
+@@ -475,7 +485,7 @@ schedule_wakeups_with_timerfd (GoaAlarm *self)
+ self->priv->scheduled_wakeup_source = source;
+ g_source_set_callback (self->priv->scheduled_wakeup_source,
+ (GSourceFunc) on_timer_source_ready, task,
+- (GDestroyNotify) clear_timer_source);
++ (GDestroyNotify) g_object_unref);
+ g_source_attach (self->priv->scheduled_wakeup_source, self->priv->context);
+ g_source_unref (source);
+
+--
+cgit v0.9.2
+From 72e6d277de953b24e488a7b75464883a4abb5ca1 Mon Sep 17 00:00:00 2001
+From: Debarshi Ray <debarshir at gnome.org>
+Date: Mon, 11 Nov 2013 13:49:06 +0000
+Subject: alarm: Remove redundant preprocessor conditional
+
+Reading the rest of the code, it appears to me that the preprocessor
+conditionals were meant to surpress compiler warnings and errors
+caused by the lack of timerfd support. For the rest of the logic,
+GoaAlarmType is used to separate the different kinds of timers.
+
+Fixes: https://bugzilla.gnome.org/711696
+---
+diff --git a/src/goaidentity/goaalarm.c b/src/goaidentity/goaalarm.c
+index 442f275..9e0ab64 100644
+--- src/goaidentity/goaalarm.c
++++ src/goaidentity/goaalarm.c
+@@ -92,7 +92,6 @@ clear_scheduled_immediate_wakeup (GoaAlarm *self)
+ static void
+ clear_scheduled_timer_wakeups (GoaAlarm *self, GSource *source, GInputStream *stream)
+ {
+-#ifdef HAVE_TIMERFD
+ GError *error;
+ gboolean is_closed;
+
+@@ -108,7 +107,6 @@ clear_scheduled_timer_wakeups (GoaAlarm *self, GSource *source, GInputStream *st
+ }
+
+ g_object_unref (stream);
+-#endif
+ }
+
+ static void
+--
+cgit v0.9.2
+From c4f25c45758875a430af39663b3f8b81091320f1 Mon Sep 17 00:00:00 2001
+From: Debarshi Ray <debarshir at gnome.org>
+Date: Tue, 12 Nov 2013 10:00:05 +0000
+Subject: alarm: Consolidate clear_scheduled_time*_wakeups into one function
+
+Since we are using the same GSource pointer for TIMER and TIMEOUT
+alarms, there is no reason to continue having separate functions.
+
+Fixes: https://bugzilla.gnome.org/711696
+---
+diff --git a/src/goaidentity/goaalarm.c b/src/goaidentity/goaalarm.c
+index 9e0ab64..ed805d7 100644
+--- src/goaidentity/goaalarm.c
++++ src/goaidentity/goaalarm.c
+@@ -90,49 +90,31 @@ clear_scheduled_immediate_wakeup (GoaAlarm *self)
+ }
+
+ static void
+-clear_scheduled_timer_wakeups (GoaAlarm *self, GSource *source, GInputStream *stream)
+-{
+- GError *error;
+- gboolean is_closed;
+-
+- g_source_destroy (source);
+-
+- error = NULL;
+- is_closed = g_input_stream_close (stream, NULL, &error);
+-
+- if (!is_closed)
+- {
+- goa_warning ("GoaAlarm: could not close timer stream: %s", error->message);
+- g_error_free (error);
+- }
+-
+- g_object_unref (stream);
+-}
+-
+-static void
+-clear_scheduled_timeout_wakeups (GoaAlarm *self, GSource *source)
+-{
+- g_source_destroy (source);
+-}
+-
+-static void
+ clear_scheduled_wakeups (GoaAlarm *self, GSource *source, GInputStream *stream)
+ {
+ g_rec_mutex_lock (&self->priv->lock);
+ clear_scheduled_immediate_wakeup (self);
+
+- switch (self->priv->type)
++ if (self->priv->type != GOA_ALARM_TYPE_UNSCHEDULED)
+ {
+- case GOA_ALARM_TYPE_TIMER:
+- clear_scheduled_timer_wakeups (self, source, stream);
+- break;
++ g_source_destroy (source);
+
+- case GOA_ALARM_TYPE_TIMEOUT:
+- clear_scheduled_timeout_wakeups (self, source);
+- break;
++ if (stream != NULL)
++ {
++ GError *error;
++ gboolean is_closed;
+
+- default:
+- break;
++ error = NULL;
++ is_closed = g_input_stream_close (stream, NULL, &error);
++
++ if (!is_closed)
++ {
++ goa_warning ("GoaAlarm: could not close timer stream: %s", error->message);
++ g_error_free (error);
++ }
++
++ g_object_unref (stream);
++ }
+ }
+
+ g_clear_pointer (&self->priv->previous_wakeup_time,
+--
+cgit v0.9.2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140110/1922a178/attachment.html>
More information about the macports-changes
mailing list