[arch-commits] CVS update of extra/gnome/fast-user-switch-applet (3 files)

Jan de Groot jgc at archlinux.org
Tue Dec 11 14:14:36 EST 2007


    Date: Tuesday, December 11, 2007 @ 14:14:36
  Author: jgc
    Path: /home/cvs-extra/extra/gnome/fast-user-switch-applet

   Added: fast-user-switch-applet-2.17.4-socket-check.patch (1.1)
          startx.patch (1.1)
Modified: PKGBUILD (1.10 -> 1.11)

upgpkg: fast-user-switch-applet 2.20.0-2
Add patches from Redhat to fix GDM socket detection and to avoid crashing when GDM is not found


---------------------------------------------------+
 PKGBUILD                                          |   10 +-
 fast-user-switch-applet-2.17.4-socket-check.patch |   20 +++++
 startx.patch                                      |   76 ++++++++++++++++++++
 3 files changed, 103 insertions(+), 3 deletions(-)


Index: extra/gnome/fast-user-switch-applet/PKGBUILD
diff -u extra/gnome/fast-user-switch-applet/PKGBUILD:1.10 extra/gnome/fast-user-switch-applet/PKGBUILD:1.11
--- extra/gnome/fast-user-switch-applet/PKGBUILD:1.10	Sat Sep 22 18:08:13 2007
+++ extra/gnome/fast-user-switch-applet/PKGBUILD	Tue Dec 11 14:14:36 2007
@@ -1,10 +1,10 @@
-# $Id: PKGBUILD,v 1.10 2007/09/22 22:08:13 jgc Exp $
+# $Id: PKGBUILD,v 1.11 2007/12/11 19:14:36 jgc Exp $
 # Maintainer: Jan de Groot <jgc at archlinux.org>
 # Contributor: Mark Rosenstand <mark at borkware.net>
 
 pkgname=fast-user-switch-applet
 pkgver=2.20.0
-pkgrel=1
+pkgrel=2
 pkgdesc="An applet for the GNOME panel which provides a menu to switch between users."
 arch=(i686 x86_64)
 license=('GPL')
@@ -13,11 +13,15 @@
 makedepends=('perlxml' 'pkgconfig')
 options=(!emptydirs)
 install=fusa.install
-source=(http://ftp.gnome.org/pub/GNOME/sources/fast-user-switch-applet/2.20/${pkgname}-${pkgver}.tar.bz2)
+source=(http://ftp.gnome.org/pub/GNOME/sources/fast-user-switch-applet/2.20/${pkgname}-${pkgver}.tar.bz2
+	fast-user-switch-applet-2.17.4-socket-check.patch
+	startx.patch)
 md5sums=('1d1fd25b5599f7656e3fa89aa913137c')
 
 build() {
   cd ${startdir}/src/${pkgname}-${pkgver}
+  patch -Np1 -i ${startdir}/src/startx.patch || return 1
+  patch -Np1 -i ${startdir}/src/fast-user-switch-applet-2.17.4-socket-check.patch || return 1
   ./configure --prefix=/usr --sysconfdir=/etc \
               --libexecdir=/usr/lib/fast-user-switch-applet \
               --localstatedir=/var --disable-scrollkeeper \
Index: extra/gnome/fast-user-switch-applet/fast-user-switch-applet-2.17.4-socket-check.patch
diff -u /dev/null extra/gnome/fast-user-switch-applet/fast-user-switch-applet-2.17.4-socket-check.patch:1.1
--- /dev/null	Tue Dec 11 14:14:36 2007
+++ extra/gnome/fast-user-switch-applet/fast-user-switch-applet-2.17.4-socket-check.patch	Tue Dec 11 14:14:36 2007
@@ -0,0 +1,20 @@
+--- fast-user-switch-applet-2.17.4/src/gdm-queue.c.socket-check	2007-03-30 16:09:50.000000000 -0400
++++ fast-user-switch-applet-2.17.4/src/gdm-queue.c	2007-03-30 16:10:35.000000000 -0400
+@@ -201,7 +201,7 @@
+ 
+   if (stat (GDM_NEW_SOCKET_FILENAME, &file_stat) == 0)
+     strcpy (addr.sun_path, GDM_NEW_SOCKET_FILENAME);
+-  if (stat (GDM_OLD_SOCKET_FILENAME, &file_stat) == 0)
++  else if (stat (GDM_OLD_SOCKET_FILENAME, &file_stat) == 0)
+     strcpy (addr.sun_path, GDM_OLD_SOCKET_FILENAME);
+   else
+     return FALSE;
+@@ -265,7 +265,7 @@
+ 
+         if (stat (GDM_NEW_SOCKET_FILENAME, &file_stat) == 0)
+           strcpy (addr.sun_path, GDM_NEW_SOCKET_FILENAME);
+-        if (stat (GDM_OLD_SOCKET_FILENAME, &file_stat) == 0)
++        else if (stat (GDM_OLD_SOCKET_FILENAME, &file_stat) == 0)
+           strcpy (addr.sun_path, GDM_OLD_SOCKET_FILENAME);
+         else
+           g_error ("Can't find gdm socket!");
Index: extra/gnome/fast-user-switch-applet/startx.patch
diff -u /dev/null extra/gnome/fast-user-switch-applet/startx.patch:1.1
--- /dev/null	Tue Dec 11 14:14:36 2007
+++ extra/gnome/fast-user-switch-applet/startx.patch	Tue Dec 11 14:14:36 2007
@@ -0,0 +1,76 @@
+--- fast-user-switch-applet-2.17.4/src/gdm-queue.c.startx	2007-02-22 18:28:42.000000000 -0500
++++ fast-user-switch-applet-2.17.4/src/gdm-queue.c	2007-03-28 16:24:34.000000000 -0400
+@@ -190,6 +190,34 @@
+   gdm_socket_status = GDM_SOCKET_CLOSED;
+ }
+ 
++gboolean
++gdm_is_running (void)
++{ 
++  struct sockaddr_un addr;
++  struct stat file_stat;
++  int fd;
++  
++  fd = socket (PF_LOCAL, SOCK_STREAM, 0);
++
++  if (stat (GDM_NEW_SOCKET_FILENAME, &file_stat) == 0)
++    strcpy (addr.sun_path, GDM_NEW_SOCKET_FILENAME);
++  if (stat (GDM_OLD_SOCKET_FILENAME, &file_stat) == 0)
++    strcpy (addr.sun_path, GDM_OLD_SOCKET_FILENAME);
++  else
++    return FALSE;
++
++  addr.sun_family = AF_UNIX;
++
++  if (connect (fd, (struct sockaddr *)&addr, sizeof (addr)) < 0) {
++    VE_IGNORE_EINTR (close (fd));
++    return FALSE;
++  }
++
++  VE_IGNORE_EINTR (close (fd));
++
++  return TRUE;
++}
++         
+ /* This is the function which gets called repeatedly while we're idle
+  * to remove messages from the queue and send them to GDM.
+  */
+--- fast-user-switch-applet-2.17.4/src/applet.c.startx	2007-03-28 16:24:34.000000000 -0400
++++ fast-user-switch-applet-2.17.4/src/applet.c	2007-03-28 16:24:53.000000000 -0400
+@@ -60,6 +60,7 @@
+ #include "fusa-manager.h"
+ #include "fusa-user-menu-item.h"
+ #include "fusa-utils.h"
++#include "gdm-queue.h"
+ 
+ 
+ /* **************** *
+@@ -296,6 +297,9 @@
+   if (strcmp (iid, "OAFIID:GNOME_FastUserSwitchApplet") != 0)
+     return FALSE;
+ 
++  if (!gdm_is_running ())
++    return TRUE;
++
+   /* Global FusaManager */
+   if (!first_time)
+     {
+@@ -325,6 +329,7 @@
+       gtk_window_set_default_icon_name ("stock_people");
+     }
+ 
++  
+   adata = g_new0 (FusaAppletData, 1);
+   adata->applet = applet;
+ 
+--- fast-user-switch-applet-2.17.4/src/gdm-queue.h.startx	2007-02-02 18:17:07.000000000 -0500
++++ fast-user-switch-applet-2.17.4/src/gdm-queue.h	2007-03-28 16:24:34.000000000 -0400
+@@ -102,6 +102,8 @@
+ /* This just gets a cookie of MIT-MAGIC-COOKIE-1 type */
+ gchar *get_mit_magic_cookie (GdkScreen *screen, gboolean binary);
+ 
++gboolean gdm_is_running (void);
++
+ G_END_DECLS
+ 
+ #endif /* !__GDM_QUEUE_H__ */




More information about the arch-commits mailing list