pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/glib2 From FreeBSD ports: gio/gunixmounts.c: pol...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c313e91dc5fa
branches:  trunk
changeset: 550807:c313e91dc5fa
user:      jmcneill <jmcneill%pkgsrc.org@localhost>
date:      Sat Nov 29 19:09:04 2008 +0000

description:
>From FreeBSD ports: gio/gunixmounts.c: poll the list of mounted filesystems
since we can't rely on checking for mtab updates like other systems. Bump
PKGREVISION.

diffstat:

 devel/glib2/Makefile         |    3 +-
 devel/glib2/distinfo         |    4 +-
 devel/glib2/patches/patch-ba |  154 +++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 154 insertions(+), 7 deletions(-)

diffs (204 lines):

diff -r 3adaac46aab8 -r c313e91dc5fa devel/glib2/Makefile
--- a/devel/glib2/Makefile      Sat Nov 29 18:52:22 2008 +0000
+++ b/devel/glib2/Makefile      Sat Nov 29 19:09:04 2008 +0000
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile,v 1.148 2008/11/24 14:27:44 wiz Exp $
+# $NetBSD: Makefile,v 1.149 2008/11/29 19:09:04 jmcneill Exp $
 
 # When updating glib2, please apply patch-ak to configure.in
 # Then run a matching version of autoconf to regen patch-aa.
 DISTNAME=              glib-2.18.3
+PKGREVISION=           1
 PKGNAME=               ${DISTNAME:S/glib/glib2/}
 CATEGORIES=            devel
 MASTER_SITES=          ftp://ftp.gtk.org/pub/glib/2.18/ \
diff -r 3adaac46aab8 -r c313e91dc5fa devel/glib2/distinfo
--- a/devel/glib2/distinfo      Sat Nov 29 18:52:22 2008 +0000
+++ b/devel/glib2/distinfo      Sat Nov 29 19:09:04 2008 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.104 2008/11/24 14:27:44 wiz Exp $
+$NetBSD: distinfo,v 1.105 2008/11/29 19:09:04 jmcneill Exp $
 
 SHA1 (glib-2.18.3.tar.bz2) = 293f639fb85ea47347eb34e122327c60ef7606e4
 RMD160 (glib-2.18.3.tar.bz2) = cf43fbba04250becaabdb7b7f55bcdec584f019e
@@ -14,5 +14,5 @@
 SHA1 (patch-aj) = a8c4e79113828e6dadf0b158777bb860aa44de3e
 SHA1 (patch-ak) = f382189966f073b3b6e6de89ea7709571241a9a0
 SHA1 (patch-al) = de5135c328027b3c4543bb09994d31b6ffedeafa
-SHA1 (patch-ba) = 739f407f6e19bb9c5e7a0e15a3b5cb5ea0431f9a
+SHA1 (patch-ba) = a343571ca14f7b20339d627782206baa7016f3fa
 SHA1 (patch-cb) = 0f084c33fb67fbb8e12448034450699da26289ff
diff -r 3adaac46aab8 -r c313e91dc5fa devel/glib2/patches/patch-ba
--- a/devel/glib2/patches/patch-ba      Sat Nov 29 18:52:22 2008 +0000
+++ b/devel/glib2/patches/patch-ba      Sat Nov 29 19:09:04 2008 +0000
@@ -1,8 +1,64 @@
-$NetBSD: patch-ba,v 1.3 2008/09/06 11:07:20 obache Exp $
+$NetBSD: patch-ba,v 1.4 2008/11/29 19:09:04 jmcneill Exp $
 
---- gio/gunixmounts.c.orig     2008-09-02 15:09:19.000000000 +0000
+--- gio/gunixmounts.c.orig     2008-11-29 13:52:51.000000000 -0500
 +++ gio/gunixmounts.c
-@@ -563,7 +563,11 @@ get_mtab_monitor_file (void)
+@@ -129,6 +129,9 @@ struct _GUnixMountMonitor {
+ 
+   GFileMonitor *fstab_monitor;
+   GFileMonitor *mtab_monitor;
++
++  guint mount_poller_source;
++  GList *mount_poller_mounts;
+ };
+ 
+ struct _GUnixMountMonitorClass {
+@@ -140,6 +143,8 @@ static GUnixMountMonitor *the_mount_moni
+ static GList *_g_get_unix_mounts (void);
+ static GList *_g_get_unix_mount_points (void);
+ 
++static guint64 mount_poller_time = 0;
++
+ G_DEFINE_TYPE (GUnixMountMonitor, g_unix_mount_monitor, G_TYPE_OBJECT);
+ 
+ #define MOUNT_POLL_INTERVAL 4000
+@@ -166,6 +171,7 @@ G_DEFINE_TYPE (GUnixMountMonitor, g_unix
+ #endif
+ 
+ #if defined(HAVE_GETMNTINFO) && defined(HAVE_FSTAB_H) && defined(HAVE_SYS_MOUNT_H)
++#include <sys/param.h>
+ #include <sys/ucred.h>
+ #include <sys/mount.h>
+ #include <fstab.h>
+@@ -216,20 +222,28 @@ g_unix_is_mount_path_system_internal (co
+     "/",              /* we already have "Filesystem root" in Nautilus */ 
+     "/bin",
+     "/boot",
++    "/compat/linux/proc",
++    "/compat/linux/sys",
+     "/dev",
+     "/etc",
+     "/home",
+     "/lib",
+     "/lib64",
++    "/libexec",
+     "/media",
+     "/mnt",
+     "/opt",
++    "/rescue",
+     "/root",
+     "/sbin",
+     "/srv",
+     "/tmp",
+     "/usr",
++    "/usr/X11R6",
+     "/usr/local",
++    "/usr/obj",
++    "/usr/ports",
++    "/usr/src",
+     "/var",
+     "/var/log/audit", /* https://bugzilla.redhat.com/show_bug.cgi?id=333041 */
+     "/var/tmp",       /* https://bugzilla.redhat.com/show_bug.cgi?id=335241 */
+@@ -563,7 +577,11 @@ get_mtab_monitor_file (void)
  static GList *
  _g_get_unix_mounts (void)
  {
@@ -14,7 +70,7 @@
    int num_mounts, i;
    GUnixMountEntry *mount_entry;
    GList *return_list;
-@@ -580,8 +584,18 @@ _g_get_unix_mounts (void)
+@@ -580,8 +598,18 @@ _g_get_unix_mounts (void)
        
        mount_entry->mount_path = g_strdup (mntent[i].f_mntonname);
        mount_entry->device_path = g_strdup (mntent[i].f_mntfromname);
@@ -33,3 +89,93 @@
        mount_entry->is_read_only = TRUE;
  
        mount_entry->is_system_internal =
+@@ -990,6 +1018,10 @@ get_mounts_timestamp (void)
+       if (stat (monitor_file, &buf) == 0)
+       return (guint64)buf.st_mtime;
+     }
++  else
++    {
++      return mount_poller_time;
++    }
+   return 0;
+ }
+ 
+@@ -1131,6 +1163,13 @@ g_unix_mount_monitor_finalize (GObject *
+       g_object_unref (monitor->mtab_monitor);
+     }
+ 
++  if (monitor->mount_poller_source > 0)
++    {
++      g_source_remove (monitor->mount_poller_source);
++      g_list_foreach (monitor->mount_poller_mounts, (GFunc)g_unix_mount_free, NULL);
++      g_list_free (monitor->mount_poller_mounts);
++    }
++
+   the_mount_monitor = NULL;
+ 
+   G_OBJECT_CLASS (g_unix_mount_monitor_parent_class)->finalize (object);
+@@ -1209,6 +1248,51 @@ mtab_file_changed (GFileMonitor      *mo
+   g_signal_emit (mount_monitor, signals[MOUNTS_CHANGED], 0);
+ }
+ 
++static gboolean
++mount_change_poller (gpointer user_data)
++{
++  GUnixMountMonitor *mount_monitor;
++  GList *current_mounts;
++  gboolean has_changed = FALSE;
++
++  mount_monitor = user_data;
++  current_mounts = _g_get_unix_mounts ();
++
++  if (g_list_length (current_mounts) != g_list_length (mount_monitor->mount_poller_mounts))
++    {
++      g_list_foreach (mount_monitor->mount_poller_mounts, (GFunc)g_unix_mount_free, NULL);
++      has_changed = TRUE;
++    }
++  else
++    {
++      int i;
++
++      for (i = 0; i < g_list_length (current_mounts); i++)
++        {
++          GUnixMountEntry *m1;
++        GUnixMountEntry *m2;
++
++        m1 = (GUnixMountEntry *)g_list_nth_data (current_mounts, i);
++        m2 = (GUnixMountEntry *)g_list_nth_data (mount_monitor->mount_poller_mounts, i);
++          if (! has_changed && g_unix_mount_compare (m1, m2) != 0)
++            has_changed = TRUE;
++
++        g_unix_mount_free (m2);
++      }
++    }
++
++  g_list_free (mount_monitor->mount_poller_mounts);
++  mount_monitor->mount_poller_mounts = current_mounts;
++
++  if (has_changed)
++    {
++      mount_poller_time = (guint64)time (NULL);
++      g_signal_emit (mount_monitor, signals[MOUNTS_CHANGED], 0);
++    }
++
++  return TRUE;
++}
++
+ static void
+ g_unix_mount_monitor_init (GUnixMountMonitor *monitor)
+ {
+@@ -1231,6 +1315,12 @@ g_unix_mount_monitor_init (GUnixMountMon
+       
+       g_signal_connect (monitor->mtab_monitor, "changed", (GCallback)mtab_file_changed, monitor);
+     }
++  else
++    {
++      monitor->mount_poller_mounts = _g_get_unix_mounts ();
++      mount_poller_time = (guint64)time (NULL);
++      monitor->mount_poller_source = g_timeout_add_seconds (3, (GSourceFunc)mount_change_poller, monitor);
++    }
+ }
+ 
+ /**



Home | Main Index | Thread Index | Old Index