[arch-commits] Commit in mate-session-manager/trunk (2 files)
Balló György
bgyorgy at archlinux.org
Fri Oct 4 21:27:14 UTC 2019
Date: Friday, October 4, 2019 @ 21:27:13
Author: bgyorgy
Revision: 512860
upgpkg: mate-session-manager 1.22.2-1
Update to new version, fix timeout with gnome-keyring 3.34 (FS#63995)
Added:
mate-session-manager/trunk/gnome-keyring-3.34.patch
Modified:
mate-session-manager/trunk/PKGBUILD
--------------------------+
PKGBUILD | 16 +++-
gnome-keyring-3.34.patch | 152 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 165 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2019-10-04 21:14:52 UTC (rev 512859)
+++ PKGBUILD 2019-10-04 21:27:13 UTC (rev 512860)
@@ -2,7 +2,7 @@
# Contributor: Martin Wimpress <code at flexion.org>
pkgname=mate-session-manager
-pkgver=1.22.1
+pkgver=1.22.2
pkgrel=1
pkgdesc="The MATE Session Handler"
url="https://mate-desktop.org"
@@ -15,9 +15,19 @@
groups=('mate')
conflicts=('mate-session-manager-gtk3')
replaces=('mate-session-manager-gtk3')
-source=("https://pub.mate-desktop.org/releases/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz")
-sha256sums=('2f1a68447a2ec30791e07865fd3747e367c3fffe8373d07ea948b0d759bca8c7')
+source=("https://pub.mate-desktop.org/releases/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"
+ "gnome-keyring-3.34.patch")
+sha256sums=('a814b07cbd42920ab86fe77c40f3e1ce7118cbc5da3251b1eb2ab9aa974c0aec'
+ '1fc88b5c804dc8fc7fd29ef3733d19e428322fdd34ae06c372ffffbbf26d22cf')
+prepare() {
+ cd "${pkgname}-${pkgver}"
+
+ # Fix timeout with gnome-keyring 3.34
+ # https://github.com/mate-desktop/mate-session-manager/pull/223
+ patch -Np1 -i ../gnome-keyring-3.34.patch
+}
+
build() {
cd "${pkgname}-${pkgver}"
./configure \
Added: gnome-keyring-3.34.patch
===================================================================
--- gnome-keyring-3.34.patch (rev 0)
+++ gnome-keyring-3.34.patch 2019-10-04 21:27:13 UTC (rev 512860)
@@ -0,0 +1,152 @@
+From 7bf6d1ca718c337659fb4ca581fcc47a80191c75 Mon Sep 17 00:00:00 2001
+From: Jindrich Makovicka <makovick at gmail.com>
+Date: Fri, 4 Oct 2019 21:08:28 +0200
+Subject: [PATCH] Fix timeout with gnome-keyring 3.34
+
+Launch gnome-keyring-daemon asynchronously, and remove the
+GNOME_KEYRING_PID reading code.
+
+GNOME_KEYRING_PID exposure was removed from gnome-keyring in 2014.
+---
+ mate-session/msm-gnome.c | 94 +++++++++++-----------------------------
+ 1 file changed, 25 insertions(+), 69 deletions(-)
+
+diff --git a/mate-session/msm-gnome.c b/mate-session/msm-gnome.c
+index 5e9cf02..f7f1154 100644
+--- a/mate-session/msm-gnome.c
++++ b/mate-session/msm-gnome.c
+@@ -49,7 +49,6 @@
+
+ static gboolean gnome_compat_started = FALSE;
+ static int keyring_lifetime_pipe[2];
+-static pid_t gnome_keyring_daemon_pid = 0;
+ static Window gnome_smproxy_window = None;
+
+ static void
+@@ -71,21 +70,26 @@ child_setup (gpointer user_data)
+ g_free (fd_str);
+ }
+
++static void
++gnome_keyring_daemon_finished (GPid pid,
++ gint status,
++ gpointer user_data)
++{
++ if (WEXITSTATUS (status) != 0)
++ {
++ /* daemon failed for some reason */
++ g_printerr ("gnome-keyring-daemon failed to start correctly, "
++ "exit code: %d\n", WEXITSTATUS (status));
++ }
++}
+
+ static void
+ gnome_keyring_daemon_startup (void)
+ {
+ GError *error = NULL;
+- gchar *sout;
+- gchar **lines;
+- gsize lineno;
+- gint status;
+- glong pid;
+- gchar *end;
++ gint sout;
++ GPid pid;
+ gchar *argv[3];
+- gchar *p;
+- gchar *name;
+- const gchar *value;
+
+ /* Pipe to slave keyring lifetime to */
+ if (pipe (keyring_lifetime_pipe))
+@@ -98,69 +102,24 @@ gnome_keyring_daemon_startup (void)
+ argv[0] = GNOME_KEYRING_DAEMON;
+ argv[1] = "--start";
+ argv[2] = NULL;
+- g_spawn_sync (NULL, argv, NULL,
+- G_SPAWN_SEARCH_PATH | G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
+- child_setup, NULL,
+- &sout, NULL, &status, &error);
+-
+- close (keyring_lifetime_pipe[0]);
+- /* We leave keyring_lifetime_pipe[1] open for the lifetime of the session,
+- in order to slave the keyring daemon lifecycle to the session. */
++ g_spawn_async_with_pipes (NULL, argv, NULL,
++ G_SPAWN_SEARCH_PATH | G_SPAWN_LEAVE_DESCRIPTORS_OPEN,
++ child_setup, NULL, &pid,
++ NULL, &sout, NULL, &error);
+
+ if (error != NULL)
+ {
+- g_printerr ("Failed to run gnome-keyring-daemon: %s\n",
++ g_printerr ("Failed to spawn gnome-keyring-daemon: %s\n",
+ error->message);
+ g_error_free (error);
++ return;
+ }
+- else
+- {
+- if (WIFEXITED (status) && WEXITSTATUS (status) == 0 && sout != NULL)
+- {
+- lines = g_strsplit (sout, "\n", 0);
+-
+- for (lineno = 0; lines[lineno] != NULL; lineno++)
+- {
+- p = strchr (lines[lineno], '=');
+- if (p == NULL)
+- continue;
+-
+- name = g_strndup (lines[lineno], p - lines[lineno]);
+- value = p + 1;
+-
+- g_setenv (name, value, TRUE);
+-
+- if (g_strcmp0 (name, "GNOME_KEYRING_PID") == 0)
+- {
+- pid = strtol (value, &end, 10);
+- if (end != value)
+- gnome_keyring_daemon_pid = pid;
+- }
+-
+- g_free (name);
+- }
+-
+- g_strfreev (lines);
+- }
+- else
+- {
+- /* daemon failed for some reason */
+- g_printerr ("gnome-keyring-daemon failed to start correctly, "
+- "exit code: %d\n", WEXITSTATUS (status));
+- }
+-
+- g_free (sout);
+- }
+-}
+
+-static void
+-gnome_keyring_daemon_shutdown (void)
+-{
+- if (gnome_keyring_daemon_pid != 0)
+- {
+- kill (gnome_keyring_daemon_pid, SIGTERM);
+- gnome_keyring_daemon_pid = 0;
+- }
++ close (keyring_lifetime_pipe[0]);
++ /* We leave keyring_lifetime_pipe[1] open for the lifetime of the session,
++ in order to slave the keyring daemon lifecycle to the session. */
++
++ g_child_watch_add (pid, gnome_keyring_daemon_finished, NULL);
+ }
+
+
+@@ -263,9 +222,6 @@ msm_gnome_stop (void)
+
+ g_debug ("MsmGnome: stopping");
+
+- /* shutdown the keyring daemon */
+- gnome_keyring_daemon_shutdown ();
+-
+ msm_compat_gnome_smproxy_shutdown ();
+
+ gnome_compat_started = FALSE;
More information about the arch-commits
mailing list