xscreensaver-04-solaris-paths.diff revision 18790
10139N/A/*
10139N/A * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
10139N/A *
16880N/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,
17185N/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:
16880N/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.
16880N/A *
10139N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17089N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12578N/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
16880N/A * DEALINGS IN THE SOFTWARE.
16880N/A */
16880N/A
16880N/AVarious fixes to deal with where we install things on Solaris:
16880N/A
17089N/A- Only run hacks from the hacks dir, not $PATH
17089N/A
16880N/A- Find helper programs even though they are not in $PATH
16880N/A
16880N/A- Show author names when reading RSS feeds from sites like blogs.sun.com
16880N/A
16880N/A- Show Solaris package names in demo app when hacks are not installed
16880N/A
16880N/A--- xscreensaver-5.11/driver/Makefile.in-orig 2010-05-04 14:36:49.467716079 -0500
16880N/A+++ xscreensaver-5.11/driver/Makefile.in 2010-05-04 14:37:27.923478737 -0500
16880N/A@@ -27,7 +27,7 @@ INTLTOOL_MERGE = @INTLTOOL_MERGE@
16880N/A GTK_DATADIR = @GTK_DATADIR@
16880N/A GTK_APPDIR = $(GTK_DATADIR)/applications
17089N/A GTK_ICONDIR = $(GTK_DATADIR)/pixmaps
17073N/A-GTK_GLADEDIR = $(GTK_DATADIR)/xscreensaver/glade
17089N/A+GTK_GLADEDIR = $(prefix)/lib/xscreensaver/config
17074N/A HACK_CONF_DIR = @HACK_CONF_DIR@
17089N/A
17186N/A CC = @CC@
17186N/A@@ -36,8 +36,11 @@ CFLAGS = @CFLAGS@
17222N/A LDFLAGS = @LDFLAGS@
17200N/A DEFS = @DEFS@
17222N/A INTL_DEFS = -DLOCALEDIR=\"$(localedir)\"
17209N/A-SUBP_DEFS = $(DEFS) -DDEFAULT_PATH_PREFIX='"@HACKDIR@"'
17222N/A-GTK_DEFS = $(DEFS) -DDEFAULT_ICONDIR='"$(GTK_GLADEDIR)"'
17222N/A+SUBP_DEFS = $(DEFS) -DHACK_PATH='"@HACKDIR@"' \
16880N/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)"'
12274N/A
12274N/A LIBS = @LIBS@
12274N/A--- xscreensaver-5.11/driver/demo-Gtk.c-orig 2010-05-04 14:35:22.685155164 -0500
12274N/A+++ xscreensaver-5.11/driver/demo-Gtk.c 2010-05-04 14:37:27.930156399 -0500
10139N/A@@ -955,7 +955,7 @@ restart_menu_cb (GtkWidget *widget, gpoi
10139N/A flush_dialog_changes_and_save (s);
10139N/A xscreensaver_command (GDK_DISPLAY(), XA_EXIT, 0, False, NULL);
10139N/A sleep (1);
11002N/A- if (system ("xscreensaver -nosplash &") < 0)
13025N/A+ if (system (BINDIR "/xscreensaver -nosplash &") < 0)
12830N/A fprintf (stderr, "%s: fork error\n", blurb());
13664N/A
16425N/A await_xscreensaver (s);
15591N/A@@ -4894,7 +4894,7 @@ main (int argc, char **argv)
17073N/A
17186N/A if (init_results == 1)
17200N/A {
17209N/A- system ("xscreensaver -nosplash &");
17222N/A+ system (BINDIR "/xscreensaver -nosplash &");
10139N/A return 0;
10139N/A }
10139N/A
10139N/A--- xscreensaver-5.11/driver/subprocs.c-orig 2010-05-04 14:36:10.440266951 -0500
10139N/A+++ xscreensaver-5.11/driver/subprocs.c 2010-05-04 14:42:13.356333432 -0500
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>
16880N/A@@ -791,6 +792,8 @@ print_path_error (const char *program)
16880N/A free (cmd);
16880N/A perror (buf);
16880N/A
16880N/A+/* mali - security issue do not want to display user's path */
16880N/A+#ifdef EXPOSE_USER_PATH
10139N/A if (errno == ENOENT &&
16880N/A (token = getenv("PATH")))
16880N/A {
10139N/A@@ -821,6 +824,7 @@ print_path_error (const char *program)
10139N/A }
10139N/A fprintf (stderr, "\n");
16880N/A }
16880N/A+#endif
10139N/A }
10139N/A
16880N/A
11155N/A@@ -877,12 +881,42 @@ fork_and_exec (saver_screen_info *ssi, c
16880N/A return forked;
16880N/A }
16880N/A
10139N/A+static Bool
10139N/A+check_if_hacks_dir_exists(Bool verbose_p)
10139N/A+{
10139N/A+ const char hackdir[] = HACK_PATH;
16880N/A+
16880N/A+ int status;
16880N/A+ struct stat st;
16880N/A+
10139N/A+ status = stat (hackdir, &st);
17059N/A+
17059N/A+ if (status == 0 && S_ISDIR(st.st_mode))
17059N/A+ {
16880N/A+ return True;
16880N/A+ }
16880N/A+ else
17059N/A+ {
17059N/A+ if (verbose_p)
11358N/A+ {
16880N/A+ fprintf(stderr,
16880N/A+ "%s: Warning: dir: %s missing. Will not run hacks\n",
10248N/A+ blurb(), hackdir);
16880N/A+ }
16880N/A+ return False;
10139N/A+ }
10139N/A+}
10139N/A
10139N/A void
10139N/A spawn_screenhack (saver_screen_info *ssi)
16880N/A {
16880N/A saver_info *si = ssi->global;
16880N/A saver_preferences *p = &si->prefs;
16880N/A+ char* complete_hack_command;
16880N/A+
16880N/A+ if (si->prefs.verbose_p)
16880N/A+ fprintf(stderr, "--> spawn_screenhack()\n");
16880N/A+
16880N/A XFlush (si->dpy);
16880N/A
16880N/A if (!monitor_powered_on_p (si))
16880N/A@@ -962,6 +996,12 @@ spawn_screenhack (saver_screen_info *ssi
16880N/A ;
16880N/A }
16880N/A
16880N/A+ if ((new_hack >= 0) &&
16880N/A+ (check_if_hacks_dir_exists(p->verbose_p) == False))
16880N/A+ {
16880N/A+ new_hack = -1;
16880N/A+ }
16880N/A+
16880N/A if (new_hack < 0) /* don't run a hack */
16880N/A {
16880N/A ssi->current_hack = -1;
16880N/A@@ -1009,7 +1049,17 @@ spawn_screenhack (saver_screen_info *ssi
16880N/A if (si->selection_mode < 0)
16880N/A si->selection_mode = 0;
16880N/A
16880N/A- forked = fork_and_exec (ssi, hack->command);
16880N/A+ /* We need complete path to hack command else any executable
16880N/A+ * with the same name in the path gets executed.
10139N/A+ */
16880N/A+ complete_hack_command = malloc (10 + strlen(hack->command) +
16880N/A+ strlen (HACK_PATH));
16880N/A+ sprintf(complete_hack_command, HACK_PATH"/%s", hack->command);
16880N/A+
10139N/A+
10139N/A+ forked = fork_and_exec (ssi, complete_hack_command);
17222N/A+ free (complete_hack_command);
17222N/A+
17222N/A switch ((int) forked)
17209N/A {
17209N/A case -1: /* fork failed */
17200N/A@@ -1184,7 +1234,7 @@ get_best_gl_visual (saver_info *si, Scre
17200N/A char *av[10];
17186N/A int ac = 0;
17186N/A
17089N/A- av[ac++] = "xscreensaver-gl-helper";
17089N/A+ av[ac++] = HELPER_PATH "/xscreensaver-gl-helper";
17073N/A av[ac] = 0;
17073N/A
17059N/A if (pipe (fds))
17059N/A--- xscreensaver-5.11/driver/xscreensaver-demo.glade2-orig 2010-05-04 14:35:39.239705081 -0500
17059N/A+++ xscreensaver-5.11/driver/xscreensaver-demo.glade2 2010-05-04 14:37:27.936058032 -0500
16880N/A@@ -872,8 +872,10 @@ Installed</property>
16880N/A <property name="visible">True</property>
16880N/A <property name="label" translatable="yes">Very few (or no) screen savers appear to be available.
16623N/A
16623N/A-This probably means that the &quot;xscreensaver-extras&quot; and
16511N/A-&quot;xscreensaver-gl-extras&quot; packages are not installed.</property>
16511N/A+This probably means that the &quot;desktop/xscreensaver/hacks&quot;,
16395N/A+&quot;desktop/xscreensaver/hacks/hacks-gl&quot;, and
16395N/A+&quot;desktop/xscreensaver/hacks/rss-glx&quot; packages
16193N/A+are not installed.</property>
16193N/A <property name="use_underline">False</property>
16190N/A <property name="use_markup">False</property>
16190N/A <property name="justify">GTK_JUSTIFY_CENTER</property>
16054N/A--- xscreensaver-5.11/driver/xscreensaver-text-orig 2010-05-04 14:36:38.547595871 -0500
16054N/A+++ xscreensaver-5.11/driver/xscreensaver-text 2010-05-04 14:44:24.855228963 -0500
16013N/A@@ -695,12 +695,15 @@ sub reformat_rss($) {
16013N/A $i++;
16013N/A
16038N/A my ($title, $body1, $body2, $body3);
15968N/A+ my $author;
15968N/A
15968N/A $title = $3 if (m@<((TITLE) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
15792N/A $body1 = $3 if (m@<((DESCRIPTION) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
15792N/A $body2 = $3 if (m@<((CONTENT) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
15591N/A $body3 = $3 if (m@<((SUMMARY) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
15591N/A
15591N/A+ $author = $3 if (m@<((DC:CREATOR) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
15543N/A+
15543N/A # If there are both <description> and <content> or <content:encoded>,
15543N/A # use whichever one contains more text.
15543N/A #
15503N/A@@ -724,10 +727,11 @@ sub reformat_rss($) {
15503N/A
15460N/A $title = rss_field_to_html ($title || '');
15460N/A $body1 = rss_field_to_html ($body1 || '');
15389N/A+ $author = rss_field_to_html ($author || '');
15389N/A
15389N/A $title = '' if ($body1 eq $title); # Identical in Twitter's atom feed.
15347N/A
15347N/A- reformat_html ("$title<P>$body1", 1);
15347N/A+ reformat_html ("$title<BR>$author<P>$body1", 1);
15347N/A print "\n";
15247N/A }
15247N/A }
15230N/A--- xscreensaver-5.11/driver/xscreensaver.man-orig 2010-05-04 14:35:54.713676218 -0500
15230N/A+++ xscreensaver-5.11/driver/xscreensaver.man 2010-05-04 14:37:27.937746778 -0500
14468N/A@@ -97,9 +97,8 @@ xscreensaver-command -restart
14468N/A If you want to set the system-wide defaults, then make your edits to
14362N/A the xscreensaver app-defaults file, which should have been installed
14362N/A when xscreensaver itself was installed. The app-defaults file will
14133N/A-usually be named /usr/lib/X11/app-defaults/XScreenSaver, but different
14133N/A-systems might keep it in a different place (for example,
14126N/A-/usr/openwin/lib/app-defaults/XScreenSaver on Solaris.)
14126N/A+usually be named /usr/share/X11/app-defaults/XScreenSaver, but different
14014N/A+systems might keep it in a different place.
14014N/A
14014N/A When settings are changed in the Preferences dialog box (see above)
14014N/A the current settings will be written to the \fI.xscreensaver\fP file.
14014N/A--- xscreensaver-5.11/hacks/glx/Makefile.in-orig 2010-05-04 14:37:13.227295589 -0500
14014N/A+++ xscreensaver-5.11/hacks/glx/Makefile.in 2010-05-04 14:37:27.939158739 -0500
14014N/A@@ -270,7 +270,7 @@ install-program:: $(EXES)
14014N/A # the xscreensaver-gl-helper program, in $bindir
13907N/A install-program:: $(EXES)
13907N/A @exes="@GL_UTIL_EXES@" ; \
13819N/A- idir="$(install_prefix)$(bindir)" ; \
13819N/A+ idir="$(install_prefix)$(libexecdir)" ; \
13786N/A if [ "$$exes" != "" ]; then \
13786N/A if [ ! -d $$idir ]; then \
13786N/A $(INSTALL_DIRS) $$idir ; \
13786N/A@@ -339,7 +339,7 @@ uninstall-program::
13786N/A # the xscreensaver-gl-helper program, in $bindir
13491N/A uninstall-program::
13453N/A @exes="$(GL_UTIL_EXES)" ; \
13453N/A- idir="$(install_prefix)$(bindir)" ; \
13453N/A+ idir="$(install_prefix)$(libexecdir)" ; \
13317N/A for program in $$exes; do \
13318N/A echo rm -f $$idir/$$program ; \
13083N/A rm -f $$idir/$$program ; \
13083N/A