xscreensaver-04-solaris-paths.diff revision 18778
10139N/A/*
10139N/A * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
10139N/A *
12147N/A * Permission is hereby granted, free of charge, to any person obtaining a
10139N/A * copy of this software and associated documentation files (the
10139N/A * "Software"), to deal in the Software without restriction, including
10139N/A * without limitation the rights to use, copy, modify, merge, publish,
17185N/A * distribute, and/or sell copies of the Software, and to permit persons
10139N/A * to whom the Software is furnished to do so, provided that the above
17177N/A * copyright notice(s) and this permission notice appear in all copies of
17177N/A * the Software and that both the above copyright notice(s) and this
17177N/A * permission notice appear in supporting documentation.
10139N/A *
10139N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10139N/A * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17496N/A * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
10139N/A * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
10139N/A * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
10139N/A * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
10139N/A * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
17379N/A * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
10139N/A * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16360N/A *
16428N/A * Except as contained in this notice, the name of a copyright holder
16428N/A * shall not be used in advertising or otherwise to promote the sale, use
16428N/A * or other dealings in this Software without prior written authorization
16428N/A * of the copyright holder.
16428N/A *
10491N/A */
12088N/A
10139N/AVarious fixes to deal with where we install things on Solaris:
12088N/A
10139N/A- Only run hacks from the hacks dir, not $PATH
12088N/A
12176N/A- Find helper programs even though they are not in $PATH
12196N/A
12306N/A- Show author names when reading RSS feeds from sites like blogs.sun.com
12368N/A
13088N/A- Show Solaris package names in demo app when hacks are not installed
13278N/A
16768N/A--- xscreensaver-5.11/driver/Makefile.in-orig 2010-05-04 14:36:49.467716079 -0500
14363N/A+++ xscreensaver-5.11/driver/Makefile.in 2010-05-04 14:37:27.923478737 -0500
16768N/A@@ -27,7 +27,7 @@ INTLTOOL_MERGE = @INTLTOOL_MERGE@
16642N/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@
10139N/A--- xscreensaver-5.11/driver/demo-Gtk.c-orig 2010-05-04 14:35:22.685155164 -0500
10139N/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);
10139N/A- if (system ("xscreensaver -nosplash &") < 0)
10139N/A+ if (system (BINDIR "/xscreensaver -nosplash &") < 0)
10139N/A fprintf (stderr, "%s: fork error\n", blurb());
10139N/A
10139N/A await_xscreensaver (s);
10139N/A@@ -4894,7 +4894,7 @@ main (int argc, char **argv)
10139N/A
10139N/A if (init_results == 1)
10139N/A {
10139N/A- system ("xscreensaver -nosplash &");
12819N/A+ system (BINDIR "/xscreensaver -nosplash &");
12288N/A return 0;
15377N/A }
14363N/A
15959N/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>
10139N/A@@ -791,6 +792,8 @@ print_path_error (const char *program)
10139N/A free (cmd);
10139N/A perror (buf);
10139N/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)
17320N/A }
10318N/A fprintf (stderr, "\n");
10318N/A }
10318N/A+#endif
10318N/A }
10318N/A
10318N/A
10139N/A@@ -877,12 +881,42 @@ fork_and_exec (saver_screen_info *ssi, c
12140N/A return forked;
16309N/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+
17379N/A+ if (status == 0 && S_ISDIR(st.st_mode))
17379N/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;
10139N/A+ }
10139N/A+}
10139N/A
10139N/A void
10139N/A spawn_screenhack (saver_screen_info *ssi)
10139N/A {
10139N/A saver_info *si = ssi->global;
10139N/A saver_preferences *p = &si->prefs;
10139N/A+ char* complete_hack_command;
10139N/A+
10139N/A+ if (si->prefs.verbose_p)
10139N/A+ fprintf(stderr, "--> spawn_screenhack()\n");
10139N/A+
10139N/A XFlush (si->dpy);
10139N/A
10139N/A if (!monitor_powered_on_p (si))
10139N/A@@ -962,6 +996,12 @@ spawn_screenhack (saver_screen_info *ssi
17496N/A ;
17496N/A }
17379N/A
17379N/A+ if ((new_hack >= 0) &&
17320N/A+ (check_if_hacks_dir_exists(p->verbose_p) == False))
17320N/A+ {
17234N/A+ new_hack = -1;
17234N/A+ }
17091N/A+
17091N/A if (new_hack < 0) /* don't run a hack */
17091N/A {
16821N/A ssi->current_hack = -1;
16821N/A@@ -1009,7 +1049,17 @@ spawn_screenhack (saver_screen_info *ssi
16802N/A if (si->selection_mode < 0)
16802N/A si->selection_mode = 0;
16802N/A
16768N/A- forked = fork_and_exec (ssi, hack->command);
16667N/A+ /* We need complete path to hack command else any executable
16667N/A+ * with the same name in the path gets executed.
16667N/A+ */
16667N/A+ complete_hack_command = malloc (10 + strlen(hack->command) +
16653N/A+ strlen (HACK_PATH));
16653N/A+ sprintf(complete_hack_command, HACK_PATH"/%s", hack->command);
16367N/A+
16367N/A+
16309N/A+ forked = fork_and_exec (ssi, complete_hack_command);
16309N/A+ free (complete_hack_command);
16134N/A+
16134N/A switch ((int) forked)
16030N/A {
16030N/A case -1: /* fork failed */
15959N/A@@ -1184,7 +1234,7 @@ get_best_gl_visual (saver_info *si, Scre
15959N/A char *av[10];
15880N/A int ac = 0;
15880N/A
15860N/A- av[ac++] = "xscreensaver-gl-helper";
15860N/A+ av[ac++] = HELPER_PATH "/xscreensaver-gl-helper";
15838N/A av[ac] = 0;
15838N/A
15613N/A if (pipe (fds))
15613N/A--- xscreensaver-5.11/driver/xscreensaver-demo.glade2-orig 2010-05-04 14:35:39.239705081 -0500
15613N/A+++ xscreensaver-5.11/driver/xscreensaver-demo.glade2 2010-05-04 14:37:27.936058032 -0500
15521N/A@@ -872,8 +872,10 @@ Installed</property>
15521N/A <property name="visible">True</property>
15521N/A <property name="label" translatable="yes">Very few (or no) screen savers appear to be available.
15448N/A
15448N/A-This probably means that the &quot;xscreensaver-extras&quot; and
15448N/A-&quot;xscreensaver-gl-extras&quot; packages are not installed.</property>
15448N/A+This probably means that the &quot;desktop/xscreensaver/hacks&quot;,
14363N/A+&quot;desktop/xscreensaver/hacks/hacks-gl&quot;, and
14363N/A+&quot;desktop/xscreensaver/hacks/rss-glx&quot; packages
14196N/A+are not installed.</property>
14196N/A <property name="use_underline">False</property>
14136N/A <property name="use_markup">False</property>
14136N/A <property name="justify">GTK_JUSTIFY_CENTER</property>
13910N/A--- xscreensaver-5.11/driver/xscreensaver-text-orig 2010-05-04 14:36:38.547595871 -0500
13910N/A+++ xscreensaver-5.11/driver/xscreensaver-text 2010-05-04 14:44:24.855228963 -0500
13910N/A@@ -695,12 +695,15 @@ sub reformat_rss($) {
13876N/A $i++;
13876N/A
13791N/A my ($title, $body1, $body2, $body3);
13791N/A+ my $author;
13620N/A
13620N/A $title = $3 if (m@<((TITLE) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
13519N/A $body1 = $3 if (m@<((DESCRIPTION) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
13519N/A $body2 = $3 if (m@<((CONTENT) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
13497N/A $body3 = $3 if (m@<((SUMMARY) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
13497N/A
13400N/A+ $author = $3 if (m@<((DC:CREATOR) [^<>\s]*)[^<>]*>\s*(.*?)\s*</\1>@xsi);
13400N/A+
13278N/A # If there are both <description> and <content> or <content:encoded>,
13278N/A # use whichever one contains more text.
13278N/A #
13109N/A@@ -724,10 +727,11 @@ sub reformat_rss($) {
13109N/A
13088N/A $title = rss_field_to_html ($title || '');
13088N/A $body1 = rss_field_to_html ($body1 || '');
13088N/A+ $author = rss_field_to_html ($author || '');
13088N/A
13055N/A $title = '' if ($body1 eq $title); # Identical in Twitter's atom feed.
13055N/A
12819N/A- reformat_html ("$title<P>$body1", 1);
12819N/A+ reformat_html ("$title<BR>$author<P>$body1", 1);
12812N/A print "\n";
12812N/A }
12811N/A }
12811N/A--- xscreensaver-5.11/driver/xscreensaver.man-orig 2010-05-04 14:35:54.713676218 -0500
12765N/A+++ xscreensaver-5.11/driver/xscreensaver.man 2010-05-04 14:37:27.937746778 -0500
12765N/A@@ -97,9 +97,8 @@ xscreensaver-command -restart
12746N/A If you want to set the system-wide defaults, then make your edits to
12746N/A the xscreensaver app-defaults file, which should have been installed
12619N/A when xscreensaver itself was installed. The app-defaults file will
12619N/A-usually be named /usr/lib/X11/app-defaults/XScreenSaver, but different
12619N/A-systems might keep it in a different place (for example,
12584N/A-/usr/openwin/lib/app-defaults/XScreenSaver on Solaris.)
12584N/A+usually be named /usr/share/X11/app-defaults/XScreenSaver, but different
12468N/A+systems might keep it in a different place.
12468N/A
12368N/A When settings are changed in the Preferences dialog box (see above)
12368N/A the current settings will be written to the \fI.xscreensaver\fP file.
12368N/A--- xscreensaver-5.11/hacks/glx/Makefile.in-orig 2010-05-04 14:37:13.227295589 -0500
12287N/A+++ xscreensaver-5.11/hacks/glx/Makefile.in 2010-05-04 14:37:27.939158739 -0500
12287N/A@@ -270,7 +270,7 @@ install-program:: $(EXES)
12246N/A # the xscreensaver-gl-helper program, in $bindir
12246N/A install-program:: $(EXES)
12196N/A @exes="@GL_UTIL_EXES@" ; \
12196N/A- idir="$(install_prefix)$(bindir)" ; \
12765N/A+ idir="$(install_prefix)$(libexecdir)" ; \
12176N/A if [ "$$exes" != "" ]; then \
12176N/A if [ ! -d $$idir ]; then \
12147N/A $(INSTALL_DIRS) $$idir ; \
12152N/A@@ -339,7 +339,7 @@ uninstall-program::
12140N/A # the xscreensaver-gl-helper program, in $bindir
12140N/A uninstall-program::
12095N/A @exes="$(GL_UTIL_EXES)" ; \
12096N/A- idir="$(install_prefix)$(bindir)" ; \
12096N/A+ idir="$(install_prefix)$(libexecdir)" ; \
12093N/A for program in $$exes; do \
12093N/A echo rm -f $$idir/$$program ; \
12092N/A rm -f $$idir/$$program ; \
12092N/A