xscreensaver-04-solaris-paths.diff revision 19033
10139N/A/*
10139N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
10139N/A *
12198N/A * Permission is hereby granted, free of charge, to any person obtaining a
10139N/A * copy of this software and associated documentation files (the "Software"),
10139N/A * to deal in the Software without restriction, including without limitation
10139N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17596N/A * and/or sell copies of the Software, and to permit persons to whom the
10139N/A * Software is furnished to do so, subject to the following conditions:
17178N/A *
17178N/A * The above copyright notice and this permission notice (including the next
17178N/A * paragraph) shall be included in all copies or substantial portions of the
10139N/A * Software.
10139N/A *
10139N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10139N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17977N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
10139N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
10139N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10139N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
10139N/A * DEALINGS IN THE SOFTWARE.
17887N/A */
10139N/A
10139N/AVarious fixes to deal with where we install things on Solaris:
10139N/A
10139N/A- Only run hacks from the hacks dir, not $PATH
10139N/A
10142N/A- Find helper programs even though they are not in $PATH
10142N/A
12773N/A- Show author names when reading RSS feeds from sites like blogs.sun.com
12773N/A
12773N/A- Show Solaris package names in demo app when hacks are not installed
10139N/A
10139N/A- Use gnome-help to display man pages nicely, without requiring internet
10139N/A access (which some customers at secure sites won't have configured),
10139N/A instead of opening a web browser to view the man page at jwz.org or
10139N/A opening a gnome-terminal to run the man command.
10139N/A
13269N/ABackport notes: this change relies on the gnome-help version delivered in
13269N/ANevada that supports "man:xscreensaver" style URL's to display man pages.
13868N/AWhen backporting to older releases you will probably want to uncomment the
14258N/Alines shown for GNOME 2.4/2.6.
15166N/A
15166N/AAlso, you'll need to fix the package names shown when the hacks are not
10139N/Ainstalled to be the older SUNWxscreensaver-*, and to not use the a href
10139N/Amarkup links added in newer gtk versions, nor link to IPS .p5i files to
10139N/Ainstall the packages.
10139N/A---
10139N/A driver/Makefile.in | 9 ++++--
10139N/A driver/XScreenSaver.ad.in | 14 +++++++---
10139N/A driver/demo-Gtk.c | 4 +-
10139N/A driver/subprocs.c | 54 +++++++++++++++++++++++++++++++++++++-
10139N/A driver/xscreensaver-demo.glade2 | 8 +++--
10139N/A driver/xscreensaver-text | 6 +++-
10139N/A driver/xscreensaver.man | 5 +--
10139N/A hacks/glx/Makefile.in | 4 +-
10139N/A 8 files changed, 84 insertions(+), 20 deletions(-)
10139N/A
10139N/Adiff --git xscreensaver-5.12/driver/Makefile.in xscreensaver-5.12/driver/Makefile.in
10139N/A--- xscreensaver-5.12/driver/Makefile.in
10139N/A+++ xscreensaver-5.12/driver/Makefile.in
10139N/A@@ -27,7 +27,7 @@ INTLTOOL_MERGE = @INTLTOOL_MERGE@
10139N/A GTK_DATADIR = @GTK_DATADIR@
10139N/A GTK_APPDIR = $(GTK_DATADIR)/applications
10139N/A GTK_ICONDIR = $(GTK_DATADIR)/pixmaps
10139N/A-GTK_GLADEDIR = $(GTK_DATADIR)/xscreensaver/glade
10139N/A+GTK_GLADEDIR = $(prefix)/lib/xscreensaver/config
10139N/A HACK_CONF_DIR = @HACK_CONF_DIR@
10139N/A
10139N/A CC = @CC@
10139N/A@@ -36,8 +36,11 @@ CFLAGS = @CFLAGS@
10139N/A LDFLAGS = @LDFLAGS@
10139N/A DEFS = @DEFS@
10139N/A INTL_DEFS = -DLOCALEDIR=\"$(localedir)\"
10139N/A-SUBP_DEFS = $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
10139N/A-GTK_DEFS = $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"'
10139N/A+SUBP_DEFS = $(DEFS) -DHACK_PATH='"@HACKDIR@"' \
10139N/A+ -DDEFAULT_PATH_PREFIX='"@HACKDIR@:$(libexecdir)"' \
10139N/A+ -DHELPER_PATH='"$(libexecdir)"'
10139N/A+GTK_DEFS = $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"' \
10139N/A+ -DBINDIR='"$(bindir)"'
10139N/A CONF_DEFS = -DHACK_CONFIGURATION_PATH='"$(HACK_CONF_DIR)"'
10139N/A
10139N/A LIBS = @LIBS@
11461N/Adiff --git xscreensaver-5.12/driver/XScreenSaver.ad.in xscreensaver-5.12/driver/XScreenSaver.ad.in
10139N/A--- xscreensaver-5.12/driver/XScreenSaver.ad.in
10139N/A+++ xscreensaver-5.12/driver/XScreenSaver.ad.in
10139N/A@@ -87,18 +87,24 @@ GetViewPortIsFullOfLies: False
10139N/A
10139N/A ! This is the URL loaded by the "Help" button on the splash screen,
11461N/A ! and by the "Documentation" menu item in xscreensaver-demo.
10139N/A-*helpURL: http://www.jwz.org/xscreensaver/man.html
10142N/A+*helpURL: man:xscreensaver
10139N/A
10139N/A ! loadURL -- how the "Help" buttons load the helpURL (/bin/sh syntax.)
13269N/A ! manualCommand -- how the "Documentation" buttons display man pages.
11959N/A !
10139N/A ! And there are so very many options to choose from!
10139N/A !
13653N/A+! Modern GNOME:
15166N/A+!
10139N/A+*loadURL: gnome-help '%s'
10139N/A+*manualCommand: gnome-help 'man:%s'
10139N/A+!
10139N/A ! Gnome 2.4, 2.6: (yelp can't display man pages, as of 2.6.3)
10139N/A !
10139N/A-@GNOME24@*loadURL: @WITH_BROWSER@ '%s'
10139N/A-@GNOME24@*manualCommand: gnome-terminal --title '%s manual' \
10139N/A-@GNOME24@ --command '/bin/sh -c "man %s; read foo"'
10139N/A+!*loadURL: gnome-terminal --title 'xscreensaver manual' \
10139N/A+! --command '/bin/ksh -c "man xscreensaver; read foo"'
10139N/A+!*manualCommand: gnome-terminal --title '%s manual' \
10139N/A+! --command '/bin/ksh -c "man %s; read foo"'
10139N/A !
10139N/A ! Gnome 2.2:
10139N/A !
17517N/Adiff --git xscreensaver-5.12/driver/demo-Gtk.c xscreensaver-5.12/driver/demo-Gtk.c
16174N/A--- xscreensaver-5.12/driver/demo-Gtk.c
10139N/A+++ xscreensaver-5.12/driver/demo-Gtk.c
10139N/A@@ -990,7 +990,7 @@ restart_menu_cb (GtkWidget *widget, gpointer user_data)
12773N/A flush_dialog_changes_and_save (s);
12773N/A xscreensaver_command (GDK_DISPLAY(), XA_EXIT, 0, False, NULL);
12773N/A sleep (1);
12773N/A- if (system ("xscreensaver -nosplash &") < 0)
12773N/A+ if (system (BINDIR "/xscreensaver -nosplash &") < 0)
16632N/A fprintf (stderr, "%s: fork error\n", blurb());
10139N/A
10139N/A await_xscreensaver (s);
10139N/A@@ -4933,7 +4933,7 @@ main (int argc, char **argv)
10139N/A
10139N/A if (init_results == 1)
10139N/A {
10139N/A- system ("xscreensaver -nosplash &");
10139N/A+ system (BINDIR "/xscreensaver -nosplash &");
10139N/A return 0;
10139N/A }
10139N/A
10139N/Adiff --git xscreensaver-5.12/driver/subprocs.c xscreensaver-5.12/driver/subprocs.c
10139N/A--- xscreensaver-5.12/driver/subprocs.c
10139N/A+++ xscreensaver-5.12/driver/subprocs.c
10139N/A@@ -14,6 +14,7 @@
10139N/A # include "config.h"
10139N/A #endif
10139N/A
10139N/A+#include <sys/stat.h>
10139N/A #include <ctype.h>
10139N/A #include <stdio.h>
10139N/A #include <string.h>
11461N/A@@ -791,6 +792,8 @@ print_path_error (const char *program)
10139N/A free (cmd);
11461N/A perror (buf);
10142N/A
10139N/A+/* mali - security issue do not want to display user's path */
10139N/A+#ifdef EXPOSE_USER_PATH
10139N/A if (errno == ENOENT &&
10139N/A (token = getenv("PATH")))
10139N/A {
10139N/A@@ -821,6 +824,7 @@ print_path_error (const char *program)
10139N/A }
10139N/A fprintf (stderr, "\n");
10139N/A }
10139N/A+#endif
10139N/A }
10139N/A
10139N/A
10139N/A@@ -877,12 +881,42 @@ fork_and_exec (saver_screen_info *ssi, const char *command)
10139N/A return forked;
10139N/A }
10139N/A
10139N/A+static Bool
10139N/A+check_if_hacks_dir_exists(Bool verbose_p)
10139N/A+{
10139N/A+ const char hackdir[] = HACK_PATH;
10139N/A+
10139N/A+ int status;
10139N/A+ struct stat st;
10139N/A+
10139N/A+ status = stat (hackdir, &st);
10139N/A+
10139N/A+ if (status == 0 && S_ISDIR(st.st_mode))
10139N/A+ {
10139N/A+ return True;
10139N/A+ }
10139N/A+ else
10139N/A+ {
10139N/A+ if (verbose_p)
10139N/A+ {
10139N/A+ fprintf(stderr,
10139N/A+ "%s: Warning: dir: %s missing. Will not run hacks\n",
10139N/A+ blurb(), hackdir);
10139N/A+ }
10139N/A+ return False;
17977N/A+ }
17977N/A+}
17856N/A
17856N/A void
17631N/A spawn_screenhack (saver_screen_info *ssi)
17631N/A {
17596N/A saver_info *si = ssi->global;
17596N/A saver_preferences *p = &si->prefs;
17394N/A+ char* complete_hack_command;
17394N/A+
17306N/A+ if (si->prefs.verbose_p)
17306N/A+ fprintf(stderr, "--> spawn_screenhack()\n");
17120N/A+
17120N/A XFlush (si->dpy);
16834N/A
16834N/A if (!monitor_powered_on_p (si))
16696N/A@@ -962,6 +996,12 @@ spawn_screenhack (saver_screen_info *ssi)
16696N/A ;
16696N/A }
16632N/A
16632N/A+ if ((new_hack >= 0) &&
16632N/A+ (check_if_hacks_dir_exists(p->verbose_p) == False))
16372N/A+ {
16632N/A+ new_hack = -1;
16158N/A+ }
16632N/A+
16158N/A if (new_hack < 0) /* don't run a hack */
16136N/A {
16632N/A ssi->current_hack = -1;
15868N/A@@ -1009,7 +1049,17 @@ spawn_screenhack (saver_screen_info *ssi)
16632N/A if (si->selection_mode < 0)
15848N/A si->selection_mode = 0;
16632N/A
15739N/A- forked = fork_and_exec (ssi, hack->command);
16632N/A+ /* We need complete path to hack command else any executable
15621N/A+ * with the same name in the path gets executed.
15621N/A+ */
15579N/A+ complete_hack_command = malloc (10 + strlen(hack->command) +
16632N/A+ strlen (HACK_PATH));
15448N/A+ sprintf(complete_hack_command, HACK_PATH"/%s", hack->command);
16632N/A+
15166N/A+
15166N/A+ forked = fork_and_exec (ssi, complete_hack_command);
15166N/A+ free (complete_hack_command);
15166N/A+
14538N/A switch ((int) forked)
14538N/A {
14258N/A case -1: /* fork failed */
14258N/A@@ -1186,7 +1236,7 @@ get_best_gl_visual (saver_info *si, Screen *screen)
14103N/A char *av[10];
14103N/A int ac = 0;
13964N/A
13964N/A- av[ac++] = "xscreensaver-gl-helper";
13919N/A+ av[ac++] = HELPER_PATH "/xscreensaver-gl-helper";
16632N/A av[ac] = 0;
13868N/A
13868N/A if (pipe (fds))
13868N/Adiff --git xscreensaver-5.12/driver/xscreensaver-demo.glade2 xscreensaver-5.12/driver/xscreensaver-demo.glade2
13868N/A--- xscreensaver-5.12/driver/xscreensaver-demo.glade2
13868N/A+++ xscreensaver-5.12/driver/xscreensaver-demo.glade2
13817N/A@@ -927,10 +927,12 @@ Installed</property>
13818N/A <property name="visible">True</property>
13818N/A <property name="label" translatable="yes">Very few (or no) screen savers appear to be available.
13653N/A
13653N/A-This probably means that the &quot;xscreensaver-extras&quot; and
13641N/A-&quot;xscreensaver-gl-extras&quot; packages are not installed.</property>
13641N/A+This probably means that the “&lt;a href="file:/usr/lib/xscreensaver/config/xscreensaver-hacks.p5i"&gt;desktop/xscreensaver/hacks&lt;/a&gt;,”
13429N/A+“&lt;a href="file:/usr/lib/xscreensaver/config/xscreensaver-hacks-gl.p5i"&gt;desktop/xscreensaver/hacks/hacks-gl&lt;/a&gt;,” and
13429N/A+“&lt;a href="file:/usr/lib/xscreensaver/config/rss-glx.p5i"&gt;desktop/xscreensaver/hacks/rss-glx&lt;/a&gt;” packages
13322N/A+are not installed.</property>
13322N/A <property name="use_underline">False</property>
13269N/A- <property name="use_markup">False</property>
13269N/A+ <property name="use_markup">True</property>
16632N/A <property name="justify">GTK_JUSTIFY_CENTER</property>
13262N/A <property name="wrap">False</property>
13262N/A <property name="selectable">False</property>
13250N/Adiff --git xscreensaver-5.12/driver/xscreensaver-text xscreensaver-5.12/driver/xscreensaver-text
13250N/A--- xscreensaver-5.12/driver/xscreensaver-text
13250N/A+++ xscreensaver-5.12/driver/xscreensaver-text
13058N/A@@ -695,12 +695,15 @@ sub reformat_rss($) {
16632N/A $i++;
13013N/A
13013N/A my ($title, $body1, $body2, $body3);
16632N/A+ my $author;
12965N/A
12965N/A $title = $3 if (m@<((TITLE) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
12813N/A $body1 = $3 if (m@<((DESCRIPTION) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
12813N/A $body2 = $3 if (m@<((CONTENT) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
12578N/A $body3 = $3 if (m@<((SUMMARY) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
16632N/A
12480N/A+ $author = $3 if (m@<((DC:CREATOR) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
12480N/A+
12472N/A # If there are both <description> and <content> or <content:encoded>,
12472N/A # use whichever one contains more text.
12472N/A #
12472N/A@@ -724,10 +727,11 @@ sub reformat_rss($) {
12369N/A
12369N/A $title = rss_field_to_html ($title || '');
12279N/A $body1 = rss_field_to_html ($body1 || '');
12279N/A+ $author = rss_field_to_html ($author || '');
12198N/A
12198N/A $title = '' if ($body1 eq $title); # Identical in Twitter's atom feed.
12078N/A
12078N/A- reformat_html ("$title<P>$body1", 1);
11922N/A+ reformat_html ("$title<BR>$author<P>$body1", 1);
11922N/A print "\n";
11416N/A }
11416N/A }
11314N/Adiff --git xscreensaver-5.12/driver/xscreensaver.man xscreensaver-5.12/driver/xscreensaver.man
11314N/A--- xscreensaver-5.12/driver/xscreensaver.man
11258N/A+++ xscreensaver-5.12/driver/xscreensaver.man
11258N/A@@ -97,9 +97,8 @@ xscreensaver-command -restart
11190N/A If you want to set the system-wide defaults, then make your edits to
11190N/A the xscreensaver app-defaults file, which should have been installed
11070N/A when xscreensaver itself was installed. The app-defaults file will
11070N/A-usually be named /usr/lib/X11/app-defaults/XScreenSaver, but different
10979N/A-systems might keep it in a different place (for example,
10979N/A-/usr/openwin/lib/app-defaults/XScreenSaver on Solaris.)
10911N/A+usually be named /usr/share/X11/app-defaults/XScreenSaver, but different
10911N/A+systems might keep it in a different place.
10811N/A
10811N/A When settings are changed in the Preferences dialog box (see above)
10746N/A the current settings will be written to the \fI.xscreensaver\fP file.
10746N/Adiff --git xscreensaver-5.12/hacks/glx/Makefile.in xscreensaver-5.12/hacks/glx/Makefile.in
10730N/A--- xscreensaver-5.12/hacks/glx/Makefile.in
10730N/A+++ xscreensaver-5.12/hacks/glx/Makefile.in
10631N/A@@ -270,7 +270,7 @@ install-program:: $(EXES)
10631N/A # the xscreensaver-gl-helper program, in $bindir
10461N/A install-program:: $(EXES)
10461N/A @exes="@GL_UTIL_EXES@" ; \
10461N/A- idir="$(install_prefix)$(bindir)" ; \
10285N/A+ idir="$(install_prefix)$(libexecdir)" ; \
10285N/A if [ "$$exes" != "" ]; then \
10199N/A if [ ! -d $$idir ]; then \
10208N/A $(INSTALL_DIRS) $$idir ; \
10139N/A@@ -339,7 +339,7 @@ uninstall-program::
10139N/A # the xscreensaver-gl-helper program, in $bindir
10139N/A uninstall-program::
10139N/A @exes="$(GL_UTIL_EXES)" ; \
10139N/A- idir="$(install_prefix)$(bindir)" ; \
10139N/A+ idir="$(install_prefix)$(libexecdir)" ; \
16632N/A for program in $$exes; do \
10139N/A echo rm -f $$idir/$$program ; \
10139N/A rm -f $$idir/$$program ; \
10139N/A
10139N/A