pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/x11/gnome-session Let the reboot and halt options appe...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/14e43cb1f38f
branches:  trunk
changeset: 483826:14e43cb1f38f
user:      jmmv <jmmv%pkgsrc.org@localhost>
date:      Fri Nov 19 19:59:14 2004 +0000

description:
Let the reboot and halt options appear in GNOME's "Log Out" dialog and
make they use /sbin/shutdown under *BSD, instead of the poweroff and
reboot commands.

The patch is a hack (not to be submitted back to the upstream developers
without modification), but is the simplest thing we can do to avoid ugly
and hard to maintain patches.  I'll submit a better, but more complex
one, to GNOME's Bugzilla when I have more time.

Bump PKGREVISION to 1.

diffstat:

 x11/gnome-session/Makefile         |   3 +-
 x11/gnome-session/distinfo         |   3 +-
 x11/gnome-session/patches/patch-ac |  55 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 59 insertions(+), 2 deletions(-)

diffs (86 lines):

diff -r 0656b6d149b3 -r 14e43cb1f38f x11/gnome-session/Makefile
--- a/x11/gnome-session/Makefile        Fri Nov 19 19:44:15 2004 +0000
+++ b/x11/gnome-session/Makefile        Fri Nov 19 19:59:14 2004 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.44 2004/10/26 21:09:47 jmmv Exp $
+# $NetBSD: Makefile,v 1.45 2004/11/19 19:59:14 jmmv Exp $
 #
 
 DISTNAME=              gnome-session-2.8.1
+PKGREVISION=           1
 CATEGORIES=            x11 gnome
 MASTER_SITES=          ${MASTER_SITE_GNOME:=sources/gnome-session/2.8/}
 SITES_gnome-splash-2.8.0.1.png=        ${MASTER_SITE_LOCAL:=gnome-splash/}
diff -r 0656b6d149b3 -r 14e43cb1f38f x11/gnome-session/distinfo
--- a/x11/gnome-session/distinfo        Fri Nov 19 19:44:15 2004 +0000
+++ b/x11/gnome-session/distinfo        Fri Nov 19 19:59:14 2004 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.14 2004/10/26 21:09:47 jmmv Exp $
+$NetBSD: distinfo,v 1.15 2004/11/19 19:59:14 jmmv Exp $
 
 SHA1 (gnome-session-2.8.1.tar.bz2) = 0766a65f3b9de1b3266018da2c8f0fe0465e8f23
 Size (gnome-session-2.8.1.tar.bz2) = 883921 bytes
@@ -6,3 +6,4 @@
 Size (gnome-splash-2.8.0.1.png) = 115672 bytes
 SHA1 (patch-aa) = 6cdba04e00c439858b428dd275fff1c0c263534f
 SHA1 (patch-ab) = cb6e685ec5f2aa34fd72b7106906b3c05f519761
+SHA1 (patch-ac) = 45c0b5fcdef56b2286dbf84e73e924f5ad74bc6d
diff -r 0656b6d149b3 -r 14e43cb1f38f x11/gnome-session/patches/patch-ac
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/x11/gnome-session/patches/patch-ac        Fri Nov 19 19:59:14 2004 +0000
@@ -0,0 +1,55 @@
+$NetBSD: patch-ac,v 1.4 2004/11/19 19:59:14 jmmv Exp $
+
+--- gnome-session/logout.c.orig        2004-07-19 20:11:14.000000000 +0200
++++ gnome-session/logout.c
+@@ -37,12 +37,20 @@
+ 
+ static gchar *halt_command[] =
+ {
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++  "/sbin/shutdown", "-p", "now", NULL
++#else
+   HALT_COMMAND, NULL
++#endif
+ };
+ 
+ static gchar *reboot_command[] =
+ {
++#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
++  "/sbin/shutdown", "-r", "now", NULL
++#else
+   REBOOT_COMMAND, NULL
++#endif
+ };
+ 
+ /* What action to take upon shutdown */
+@@ -298,6 +306,7 @@ display_gui (void)
+   GtkWidget *reboot = NULL;
+   GtkWidget *invisible;
+   gboolean   retval = FALSE;
++  gboolean can_shutdown = FALSE;
+   gboolean save_active = FALSE;
+   gboolean halt_active = FALSE;
+   gboolean reboot_active = FALSE;
+@@ -392,6 +401,7 @@ display_gui (void)
+                         FALSE, TRUE, 0);
+     }
+ 
++#if defined(__linux__)
+   /* Red Hat specific code to check if the user has a
+    * good chance of being able to shutdown the system,
+    * and if so, give them that option
+@@ -400,6 +410,13 @@ display_gui (void)
+   t = g_strconcat ("/var/run/console/", g_get_user_name (), NULL);
+   if (((geteuid () == 0) || g_file_exists (t) || g_file_exists(s)) &&
+       access (halt_command[0], X_OK) == 0)
++    can_shutdown = TRUE;
++#else
++  if (access (halt_command[0], X_OK) == 0)
++    can_shutdown = TRUE;
++#endif
++
++  if (can_shutdown)
+     {
+       GtkWidget *title, *spacer;
+       GtkWidget *action_vbox, *hbox;



Home | Main Index | Thread Index | Old Index