diff options
author | jmmv <jmmv> | 2004-11-19 19:59:14 +0000 |
---|---|---|
committer | jmmv <jmmv> | 2004-11-19 19:59:14 +0000 |
commit | ed60d212fcf5b023ee29391a7a0beb00181228de (patch) | |
tree | 520daf9768bfe6ef6812f3b9887a143c2fa9513f /x11 | |
parent | 9c9a3d0e6b58edf32e2f993bb74cc8b5ede23e7b (diff) | |
download | pkgsrc-ed60d212fcf5b023ee29391a7a0beb00181228de.tar.gz |
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 (limited to 'x11')
-rw-r--r-- | x11/gnome-session/Makefile | 3 | ||||
-rw-r--r-- | x11/gnome-session/distinfo | 3 | ||||
-rw-r--r-- | x11/gnome-session/patches/patch-ac | 55 |
3 files changed, 59 insertions, 2 deletions
diff --git a/x11/gnome-session/Makefile b/x11/gnome-session/Makefile index 20a2db91ea9..56b557fc01d 100644 --- a/x11/gnome-session/Makefile +++ b/x11/gnome-session/Makefile @@ -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 --git a/x11/gnome-session/distinfo b/x11/gnome-session/distinfo index e0954285084..f599cae4a5f 100644 --- a/x11/gnome-session/distinfo +++ b/x11/gnome-session/distinfo @@ -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 @@ SHA1 (gnome-splash-2.8.0.1.png) = c278e7fd1eb487b1905cedf0bb62e2672ba0e6f8 Size (gnome-splash-2.8.0.1.png) = 115672 bytes SHA1 (patch-aa) = 6cdba04e00c439858b428dd275fff1c0c263534f SHA1 (patch-ab) = cb6e685ec5f2aa34fd72b7106906b3c05f519761 +SHA1 (patch-ac) = 45c0b5fcdef56b2286dbf84e73e924f5ad74bc6d diff --git a/x11/gnome-session/patches/patch-ac b/x11/gnome-session/patches/patch-ac new file mode 100644 index 00000000000..df58aaf515d --- /dev/null +++ b/x11/gnome-session/patches/patch-ac @@ -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; |