[arch-commits] Commit in consolekit/trunk (5 files)

Jan de Groot jgc at archlinux.org
Thu Oct 21 09:36:41 UTC 2010


    Date: Thursday, October 21, 2010 @ 05:36:40
  Author: jgc
Revision: 96454

upgpkg: consolekit 0.4.2-1
Update to 0.4.2

Added:
  consolekit/trunk/check-for-VT_WAITEVENT-ioctl-during-runtime.patch
Modified:
  consolekit/trunk/PKGBUILD
Deleted:
  consolekit/trunk/add_since_option.patch
  consolekit/trunk/nodaemon.patch
  consolekit/trunk/reorder-initialization.patch

---------------------------------------------------+
 PKGBUILD                                          |   24 --
 add_since_option.patch                            |  220 --------------------
 check-for-VT_WAITEVENT-ioctl-during-runtime.patch |  138 ++++++++++++
 nodaemon.patch                                    |    9 
 reorder-initialization.patch                      |   40 ---
 5 files changed, 147 insertions(+), 284 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-10-21 09:30:19 UTC (rev 96453)
+++ PKGBUILD	2010-10-21 09:36:40 UTC (rev 96454)
@@ -3,33 +3,27 @@
 # Contributor: onestep_ua <onestep at ukr.net>
 
 pkgname=consolekit
-pkgver=0.4.1
-pkgrel=4
+pkgver=0.4.2
+pkgrel=1
 pkgdesc="A framework for defining and tracking users, login sessions, and seats"
 arch=('i686' 'x86_64')
 url="http://www.freedesktop.org/wiki/Software/ConsoleKit"
 license=('GPL')
-depends=('polkit>=0.95' 'zlib' 'libx11>=1.2.2')
+depends=('polkit>=0.98' 'zlib' 'libx11>=1.3.5' 'dbus-glib>=0.86')
 makedepends=('pkgconfig' 'xmlto' 'docbook-xsl')
 options=(!libtool)
 source=(http://www.freedesktop.org/software/ConsoleKit/dist/ConsoleKit-${pkgver}.tar.bz2
         pam-foreground-compat.ck
-        nodaemon.patch
-        reorder-initialization.patch
-        add_since_option.patch
-        consolekit.logrotate)
-md5sums=('48eda4483cc97841d5f88e8e003eb6d7'
+        consolekit.logrotate
+        check-for-VT_WAITEVENT-ioctl-during-runtime.patch)
+md5sums=('285acb35bfcb2b8dc21c6071e6f6e116'
          'a8a4de71d9b0549b8143e5f6c2a36fc7'
-         'a5bfd56bc89411ff5bb18276a68cb212'
-         '99fa8cb1bf232050cc0c076378e216c5'
-         'bd5e72397fe2d42a933a897d28d58155'
-         '6fefa451d9fe2fc6d6269629d3529793')
+         '6fefa451d9fe2fc6d6269629d3529793'
+         'dea270ebf52ef0e1b8130f1c6da73d65')
 
 build() {
   cd "${srcdir}/ConsoleKit-${pkgver}"
-  patch -Np1 -i "${srcdir}/nodaemon.patch"
-  patch -Np1 -i "${srcdir}/reorder-initialization.patch"
-  patch -Np1 -i "${srcdir}/add_since_option.patch"
+  patch -Np1 -i "${srcdir}/check-for-VT_WAITEVENT-ioctl-during-runtime.patch"
   ./configure --prefix=/usr \
       --sysconfdir=/etc \
       --localstatedir=/var \

Deleted: add_since_option.patch
===================================================================
--- add_since_option.patch	2010-10-21 09:30:19 UTC (rev 96453)
+++ add_since_option.patch	2010-10-21 09:36:40 UTC (rev 96454)
@@ -1,220 +0,0 @@
-From c9f2292339540d4b9d8940bcef16b7485480c8d9 Mon Sep 17 00:00:00 2001
-From: William Jon McCann <jmccann at redhat.com>
-Date: Fri, 11 Jun 2010 19:53:22 +0000
-Subject: Add a --since option to show entries in a time window
-
-Doesn't load any history files it doesn't need to which should
-help performance on systems with long histories.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=25660
----
-diff --git a/tools/ck-history.c b/tools/ck-history.c
-index 606106c..d02caaa 100644
---- a/tools/ck-history.c
-+++ b/tools/ck-history.c
-@@ -62,8 +62,8 @@ typedef enum {
- 
- static GList *all_events = NULL;
- 
--static gboolean
--process_event_line (const char *line)
-+static CkLogEvent *
-+parse_event_line (const char *line)
- {
-         GString    *str;
-         CkLogEvent *event;
-@@ -72,47 +72,80 @@ process_event_line (const char *line)
-         event = ck_log_event_new_from_string (str);
-         g_string_free (str, TRUE);
- 
--        if (event != NULL) {
--                all_events = g_list_prepend (all_events, event);
--        }
--
--        return TRUE;
-+        return event;
- }
- 
- static gboolean
--process_log_gzstream (gzFile *fstream)
-+process_log_gzstream (gzFile   *fstream,
-+                      GTimeVal *since)
- {
--        char line[MAX_LINE_LEN];
-+        char     line[MAX_LINE_LEN];
-+        gboolean hit_since;
-+        GList   *events;
- 
-+        events = NULL;
-+        hit_since = FALSE;
-         while (gzgets (fstream, line, sizeof (line)) != Z_NULL) {
-+                CkLogEvent *event;
-+
-                 if (strlen (line) == sizeof (line) - 1) {
-                         g_warning ("Log line truncated");
-                 }
- 
--                process_event_line (line);
-+                event = parse_event_line (line);
-+                if (event == NULL) {
-+                        continue;
-+                }
-+
-+                if (since == NULL || event->timestamp.tv_sec >= since->tv_sec) {
-+                        events = g_list_prepend (events, event);
-+                } else {
-+                        hit_since = TRUE;
-+                }
-         }
- 
--        return TRUE;
-+        all_events = g_list_concat (all_events, events);
-+
-+        return !hit_since;
- }
- 
- static gboolean
--process_log_stream (FILE *fstream)
-+process_log_stream (FILE     *fstream,
-+                    GTimeVal *since)
- {
--        char line[MAX_LINE_LEN];
-+        char     line[MAX_LINE_LEN];
-+        gboolean hit_since;
-+        GList   *events;
- 
-+        events = NULL;
-+        hit_since = FALSE;
-         while (fgets (line, sizeof (line), fstream) != NULL) {
-+                CkLogEvent *event;
-+
-                 if (strlen (line) == sizeof (line) - 1) {
-                         g_warning ("Log line truncated");
-                 }
- 
--                process_event_line (line);
-+                event = parse_event_line (line);
-+                if (event == NULL) {
-+                        continue;
-+                }
-+
-+                if (since == NULL || event->timestamp.tv_sec >= since->tv_sec) {
-+                        events = g_list_prepend (events, event);
-+                } else {
-+                        hit_since = TRUE;
-+                }
-         }
- 
--        return TRUE;
-+        all_events = g_list_concat (all_events, events);
-+
-+        return !hit_since;
- }
- 
- static gboolean
--process_log_file (const char *filename)
-+process_log_file (const char *filename,
-+                  GTimeVal   *since)
- {
-         gboolean ret;
- 
-@@ -131,7 +164,7 @@ process_log_file (const char *filename)
-                                    errmsg);
-                         return FALSE;
-                 }
--                ret = process_log_gzstream (f);
-+                ret = process_log_gzstream (f, since);
-                 gzclose (f);
-         } else {
-                 FILE    *f;
-@@ -143,7 +176,7 @@ process_log_file (const char *filename)
-                                    g_strerror (errno));
-                         return FALSE;
-                 }
--                ret = process_log_stream (f);
-+                ret = process_log_stream (f, since);
-                 fclose (f);
-         }
- 
-@@ -180,11 +213,14 @@ get_log_file_list (void)
-                 files = g_list_prepend (files, filename);
-         };
- 
-+        /* Return the list in reverse time order, newest first */
-+        files = g_list_reverse (files);
-+
-         return files;
- }
- 
- static gboolean
--process_logs (void)
-+process_logs (GTimeVal *since)
- {
-         gboolean ret;
-         GList   *files;
-@@ -199,8 +235,7 @@ process_logs (void)
-                 char    *filename;
- 
-                 filename = l->data;
--
--                res = process_log_file (filename);
-+                res = process_log_file (filename, since);
-                 if (! res) {
-                         goto out;
-                 }
-@@ -843,6 +878,8 @@ main (int    argc,
-         GError             *error = NULL;
-         int                 report_type;
-         int                 uid;
-+        GTimeVal            timestamp;
-+        gboolean            use_since;
-         static gboolean     do_version = FALSE;
-         static gboolean     report_last_compat = FALSE;
-         static gboolean     report_last = FALSE;
-@@ -851,6 +888,7 @@ main (int    argc,
-         static char        *username = NULL;
-         static char        *seat = NULL;
-         static char        *session_type = NULL;
-+        static char        *since = NULL;
-         static GOptionEntry entries [] = {
-                 { "version", 'V', 0, G_OPTION_ARG_NONE, &do_version, N_("Version of this application"), NULL },
-                 { "frequent", 0, 0, G_OPTION_ARG_NONE, &report_frequent, N_("Show listing of frequent users"), NULL },
-@@ -860,6 +898,7 @@ main (int    argc,
-                 { "seat", 's', 0, G_OPTION_ARG_STRING, &seat, N_("Show entries for the specified seat"), N_("SEAT") },
-                 { "session-type", 't', 0, G_OPTION_ARG_STRING, &session_type, N_("Show entries for the specified session type"), N_("TYPE") },
-                 { "user", 'u', 0, G_OPTION_ARG_STRING, &username, N_("Show entries for the specified user"), N_("NAME") },
-+                { "since", 0, 0, G_OPTION_ARG_STRING, &since, N_("Show entries since the specified time (ISO 8601 format)"), N_("DATETIME") },
-                 { NULL }
-         };
- 
-@@ -880,6 +919,15 @@ main (int    argc,
-                 exit (1);
-         }
- 
-+        use_since = FALSE;
-+        if (since != NULL) {
-+                use_since = g_time_val_from_iso8601 (since, &timestamp);
-+                if (! use_since) {
-+                        g_warning ("Invalid ISO 8601 time value");
-+                        exit (1);
-+                }
-+        }
-+
-         if (report_last_compat) {
-                 report_type = REPORT_TYPE_LAST_COMPAT;
-         } else if (report_last) {
-@@ -902,7 +950,11 @@ main (int    argc,
-                 uid = -1;
-         }
- 
--        process_logs ();
-+        if (use_since) {
-+                process_logs (&timestamp);
-+        } else {
-+                process_logs (NULL);
-+        }
-         generate_report (report_type, uid, seat, session_type);
-         free_events ();
- 
---
-cgit v0.8.3-6-g21f6

Added: check-for-VT_WAITEVENT-ioctl-during-runtime.patch
===================================================================
--- check-for-VT_WAITEVENT-ioctl-during-runtime.patch	                        (rev 0)
+++ check-for-VT_WAITEVENT-ioctl-during-runtime.patch	2010-10-21 09:36:40 UTC (rev 96454)
@@ -0,0 +1,138 @@
+From 24dc214f55e7c7c17d888d0ccf94cd3625767462 Mon Sep 17 00:00:00 2001
+From: Michael Biebl <biebl at debian.org>
+Date: Sun, 19 Sep 2010 22:45:16 +0000
+Subject: linux: Check for VT_WAITEVENT ioctl during runtime
+
+Since 2782cc8d4950effbc4407455e72bd4750cef6e11 ConsoleKit fails, if it
+has been compiled on a linux kernel >= 2.6.32 but is run with an older
+kernel. Check for VT_WAITEVENT ioctl during runtime and fallback to the
+old behaviour of creating a thread for every possible vt.
+---
+diff --git a/src/ck-vt-monitor.c b/src/ck-vt-monitor.c
+index 369c63e..9310341 100644
+--- a/src/ck-vt-monitor.c
++++ b/src/ck-vt-monitor.c
+@@ -27,6 +27,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <signal.h>
++#include <sys/ioctl.h>
+ 
+ #include <glib.h>
+ #include <glib/gi18n.h>
+@@ -311,6 +312,34 @@ schedule_process_queue (CkVtMonitor *vt_monitor)
+         G_UNLOCK (schedule_lock);
+ }
+ 
++#ifdef VT_WAITEVENT
++static gboolean
++vt_waitevent_supported (int fd)
++{
++        static int supported = -1;
++        int res;
++
++        if (supported >= 0)
++                return supported;
++
++        res = ioctl(fd, VT_WAITEVENT, NULL);
++
++        if (res == ERROR) {
++                if (errno == EINVAL) {
++                        g_debug ("VT_WAITEVENT not supported on this system");
++                        supported = FALSE;
++                        return FALSE;
++                } else if (errno == EFAULT) {
++                        g_debug ("VT_WAITEVENT supported on this system");
++                        supported = TRUE;
++                        return TRUE;
++                }
++        }
++        g_debug ("Unexpected result for VT_WAITEVENT check, returning FALSE");
++        return FALSE;
++}
++#endif
++
+ static void *
+ vt_thread_start (ThreadData *data)
+ {
+@@ -322,6 +351,9 @@ vt_thread_start (ThreadData *data)
+         num = data->num;
+ 
+ #ifdef VT_WAITEVENT
++        if (!vt_waitevent_supported(vt_monitor->priv->vfd))
++                goto no_waitevent;
++
+         for (;;) {
+                 res = ck_wait_for_console_switch (vt_monitor->priv->vfd, &num);
+                 if (! res) {
+@@ -340,7 +372,10 @@ vt_thread_start (ThreadData *data)
+                         schedule_process_queue (vt_monitor);
+                 }
+         }
+-#else
++        goto out;
++#endif
++
++no_waitevent:
+         res = ck_wait_for_active_console_num (vt_monitor->priv->vfd, num);
+         if (! res) {
+                 /* FIXME: what do we do if it fails? */
+@@ -357,8 +392,8 @@ vt_thread_start (ThreadData *data)
+                 /* schedule processing of queue */
+                 schedule_process_queue (vt_monitor);
+         }
+-#endif
+ 
++out:
+         G_LOCK (hash_lock);
+         if (vt_monitor->priv->vt_thread_hash != NULL) {
+                 g_hash_table_remove (vt_monitor->priv->vt_thread_hash, GUINT_TO_POINTER (num));
+@@ -418,19 +453,24 @@ vt_add_watches (CkVtMonitor *vt_monitor)
+         sigaction (SIGPOLL, &act, NULL);
+ 
+         ioctl (vt_monitor->priv->vfd, I_SETSIG, S_MSG);
+-#elif defined (VT_WAITEVENT)
++#else
++        guint  max_consoles;
++        int    i;
++        gint32 current_num;
+         gpointer id;
+ 
++#if defined (VT_WAITEVENT)
++        if (!vt_waitevent_supported(vt_monitor->priv->vfd))
++                goto no_waitevent;
++
+         G_LOCK (hash_lock);
+         id = GINT_TO_POINTER (1);
+         if (g_hash_table_lookup (vt_monitor->priv->vt_thread_hash, id) == NULL)
+                 vt_add_watch_unlocked (vt_monitor, 1);
+-        G_UNLOCK (hash_lock);
+-#else
+-        guint  max_consoles;
+-        int    i;
+-        gint32 current_num;
++        goto out;
++#endif
+ 
++no_waitevent:
+         G_LOCK (hash_lock);
+ 
+         current_num = vt_monitor->priv->active_num;
+@@ -442,7 +482,6 @@ vt_add_watches (CkVtMonitor *vt_monitor)
+         }
+ 
+         for (i = 1; i < max_consoles; i++) {
+-                gpointer id;
+ 
+                 /* don't wait on the active vc */
+                 if (i == current_num) {
+@@ -457,6 +496,7 @@ vt_add_watches (CkVtMonitor *vt_monitor)
+                 }
+         }
+ 
++out:
+         G_UNLOCK (hash_lock);
+ #endif
+ }
+--
+cgit v0.8.3-6-g21f6

Deleted: nodaemon.patch
===================================================================
--- nodaemon.patch	2010-10-21 09:30:19 UTC (rev 96453)
+++ nodaemon.patch	2010-10-21 09:36:40 UTC (rev 96454)
@@ -1,9 +0,0 @@
-diff -up ConsoleKit-0.4.1/data/org.freedesktop.ConsoleKit.service.in.nodaemon ConsoleKit-0.4.1/data/org.freedesktop.ConsoleKit.service.in
---- ConsoleKit-0.4.1/data/org.freedesktop.ConsoleKit.service.in.nodaemon	2009-12-15 10:56:39.839818556 -0500
-+++ ConsoleKit-0.4.1/data/org.freedesktop.ConsoleKit.service.in	2009-12-15 10:56:50.177792048 -0500
-@@ -1,4 +1,4 @@
- [D-BUS Service]
- Name=org.freedesktop.ConsoleKit
--Exec=@sbindir@/console-kit-daemon
-+Exec=@sbindir@/console-kit-daemon --no-daemon
- User=root

Deleted: reorder-initialization.patch
===================================================================
--- reorder-initialization.patch	2010-10-21 09:30:19 UTC (rev 96453)
+++ reorder-initialization.patch	2010-10-21 09:36:40 UTC (rev 96454)
@@ -1,40 +0,0 @@
-diff -up ConsoleKit-0.4.1/src/main.c.reorder-initialization ConsoleKit-0.4.1/src/main.c
---- ConsoleKit-0.4.1/src/main.c.reorder-initialization	2009-12-18 14:51:38.821212946 -0500
-+++ ConsoleKit-0.4.1/src/main.c	2009-12-18 14:52:19.246211176 -0500
-@@ -294,11 +294,19 @@ main (int    argc,
- 
-         setup_debug_log (debug);
- 
-+        g_debug ("initializing console-kit-daemon %s", VERSION);
-+
-         connection = get_system_bus ();
-         if (connection == NULL) {
-                 goto out;
-         }
- 
-+        manager = ck_manager_new ();
-+
-+        if (manager == NULL) {
-+                goto out;
-+        }
-+
-         bus_proxy = get_bus_proxy (connection);
-         if (bus_proxy == NULL) {
-                 g_warning ("Could not construct bus_proxy object; bailing out");
-@@ -310,16 +318,8 @@ main (int    argc,
-                 goto out;
-         }
- 
--        g_debug ("initializing console-kit-daemon %s", VERSION);
--
-         create_pid_file ();
- 
--        manager = ck_manager_new ();
--
--        if (manager == NULL) {
--                goto out;
--        }
--
-         loop = g_main_loop_new (NULL, FALSE);
- 
-         g_signal_connect (bus_proxy,




More information about the arch-commits mailing list