groff-commit
[Top][All Lists]
Advanced

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

[Groff-commit] groff ./ChangeLog ./PROBLEMS ./aclocal.m4 ./con...


From: Werner LEMBERG
Subject: [Groff-commit] groff ./ChangeLog ./PROBLEMS ./aclocal.m4 ./con...
Date: Wed, 18 May 2005 03:03:07 -0400

CVSROOT:        /cvsroot/groff
Module name:    groff
Branch:         
Changes by:     Werner LEMBERG <address@hidden> 05/05/18 07:03:07

Modified files:
        .              : ChangeLog PROBLEMS aclocal.m4 configure 
        arch/misc      : shdeps.sh 
        contrib/eqn2graph: eqn2graph.sh 
        contrib/gdiffmk: gdiffmk.sh 
        contrib/gdiffmk/tests: runtests.in 
        contrib/grap2graph: grap2graph.sh 
        contrib/groffer: groffer.sh 
        contrib/mm     : mmroff.pl 
        contrib/mom/momdoc: appendices.html 
        contrib/pdfmark: ChangeLog Makefile.sub pdfroff.man pdfroff.sh 
        contrib/pic2graph: pic2graph.sh 
        font/devps/generate: afmname 
        src/devices/xditview: ad2c 
        src/preproc/eqn: neqn.sh 
        src/roff/grog  : grog.pl grog.sh 
        src/roff/nroff : nroff.sh 

Log message:
        Miscellaneous script portability enhancements.
        
        * aclocal.m4: (GROFF_CSH_HACK): Add space in shebang prototype for
        generated conftest.sh script, conforming to portability
        recommendation in autoconf docs.
        * configure: Likewise, for code generated by GROFF_CSH_HACK.
        * contrib/eqn2graph/eqn2graph.sh: Add space in shebang, conforming
        to portability recommendation in autoconf docs.
        * contrib/gdiffmk/gdiffmk.sh: Likewise.
        * contrib/gdiffmk/tests/runtests.in: Likewise.
        * contrib/grap2graph/grap2graph.sh: Likewise.
        * contrib/groffer/groffer.sh: Likewise.
        * contrib/mm/mmroff.pl: Likewise.
        * contrib/mom/momdoc/appendices.html: Likewise.
        * contrib/pic2graph/pic2graph.sh: Likewise.
        * font/devps/generate/afmname: Likewise.
        * src/devices/xditview/ad2c: Likewise.
        * src/preproc/eqn/neqn.sh: Likewise.
        * src/roff/grog/grog.pl: Likewise.
        * src/roff/grog/grog.sh: Likewise.
        * src/roff/nroff/nroff.sh: Likewise.
        * PROBLEMS: Likewise, in embedded script examples.
        
        Improve portability of `pdfroff' shell script.
        
        * arch/misc/shdeps.sh: Add space in shebang, conforming to
        portability guidelines in `autoconf' docs.
        (PATH_SEARCH_SETUP): New substitution; emits PATH_SEPARATOR
        initialization code.  Used by contrib/pdfmark/pdfroff.sh's
        `searchpath' function.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/ChangeLog.diff?tr1=1.824&tr2=1.825&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/PROBLEMS.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/aclocal.m4.diff?tr1=1.46&tr2=1.47&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/configure.diff?tr1=1.66&tr2=1.67&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/arch/misc/shdeps.sh.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/eqn2graph/eqn2graph.sh.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/gdiffmk/gdiffmk.sh.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/gdiffmk/tests/runtests.in.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/grap2graph/grap2graph.sh.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/groffer/groffer.sh.diff?tr1=1.22&tr2=1.23&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/mm/mmroff.pl.diff?tr1=2.2&tr2=2.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/mom/momdoc/appendices.html.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/pdfmark/ChangeLog.diff?tr1=1.10&tr2=1.11&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/pdfmark/Makefile.sub.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/pdfmark/pdfroff.man.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/pdfmark/pdfroff.sh.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/contrib/pic2graph/pic2graph.sh.diff?tr1=1.6&tr2=1.7&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/font/devps/generate/afmname.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/devices/xditview/ad2c.diff?tr1=1.1.1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/preproc/eqn/neqn.sh.diff?tr1=1.8&tr2=1.9&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/roff/grog/grog.pl.diff?tr1=1.14&tr2=1.15&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/roff/grog/grog.sh.diff?tr1=1.13&tr2=1.14&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/groff/groff/src/roff/nroff/nroff.sh.diff?tr1=1.17&tr2=1.18&r1=text&r2=text

Patches:
Index: groff/ChangeLog
diff -u groff/ChangeLog:1.824 groff/ChangeLog:1.825
--- groff/ChangeLog:1.824       Tue May 17 20:20:53 2005
+++ groff/ChangeLog     Wed May 18 07:03:06 2005
@@ -1,3 +1,38 @@
+2005-05-16  Keith Marshall  <address@hidden>
+
+       Miscellaneous script portability enhancements.
+
+       * aclocal.m4: (GROFF_CSH_HACK): Add space in shebang prototype for
+       generated conftest.sh script, conforming to portability
+       recommendation in autoconf docs.
+       * configure: Likewise, for code generated by GROFF_CSH_HACK.
+       * contrib/eqn2graph/eqn2graph.sh: Add space in shebang, conforming
+       to portability recommendation in autoconf docs.
+       * contrib/gdiffmk/gdiffmk.sh: Likewise.
+       * contrib/gdiffmk/tests/runtests.in: Likewise.
+       * contrib/grap2graph/grap2graph.sh: Likewise.
+       * contrib/groffer/groffer.sh: Likewise.
+       * contrib/mm/mmroff.pl: Likewise.
+       * contrib/mom/momdoc/appendices.html: Likewise.
+       * contrib/pic2graph/pic2graph.sh: Likewise.
+       * font/devps/generate/afmname: Likewise.
+       * src/devices/xditview/ad2c: Likewise.
+       * src/preproc/eqn/neqn.sh: Likewise.
+       * src/roff/grog/grog.pl: Likewise.
+       * src/roff/grog/grog.sh: Likewise.
+       * src/roff/nroff/nroff.sh: Likewise.
+       * PROBLEMS: Likewise, in embedded script examples.
+
+2005-05-16  Keith Marshall  <address@hidden>
+
+       Improve portability of `pdfroff' shell script.
+
+       * arch/misc/shdeps.sh: Add space in shebang, conforming to
+       portability guidelines in `autoconf' docs.
+       (PATH_SEARCH_SETUP): New substitution; emits PATH_SEPARATOR
+       initialization code.  Used by contrib/pdfmark/pdfroff.sh's
+       `searchpath' function.
+
 2005-05-14  Werner LEMBERG  <address@hidden>
 
        * contrib/pic2graph/pic2graph.sh, contrib/graph2graph.sh,
@@ -135,7 +170,7 @@
        * src/roff/nroff/nroff.sh: Make the script accept option `-M'.
 
 2005-04-01  Kees Zeelenberg  <address@hidden>
-            Werner LEMBERG  <address@hidden>
+           Werner LEMBERG  <address@hidden>
 
        Add binary relocation support for Windows platforms.
 
Index: groff/PROBLEMS
diff -u groff/PROBLEMS:1.25 groff/PROBLEMS:1.26
--- groff/PROBLEMS:1.25 Sat Apr 30 07:03:13 2005
+++ groff/PROBLEMS      Wed May 18 07:03:06 2005
@@ -633,13 +633,13 @@
 
 Create a script called 'eqn':
 
- > #!/bin/sh
+ > #! /bin/sh
  > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
  > geqn $*
 
 and a script called 'neqn':
 
- > #!/bin/sh
+ > #! /bin/sh
  > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
  > geqn -Tascii $*
 
@@ -659,7 +659,7 @@
 --- /usr/local/bin/psroff       Sat Feb 13 17:45:46 1993
 ***************
 *** 1,8 ****
-  #!/bin/sh
+  #! /bin/sh
 ! # Emulate nroff with groff.
 
   prog="$0"
@@ -668,7 +668,7 @@
 
   for i
 --- 1,8 ----
-  #!/bin/sh
+  #! /bin/sh
 ! # Emulate psroff with groff.
 
   prog="$0"
Index: groff/aclocal.m4
diff -u groff/aclocal.m4:1.46 groff/aclocal.m4:1.47
--- groff/aclocal.m4:1.46       Sat Apr 30 07:03:13 2005
+++ groff/aclocal.m4    Wed May 18 07:03:06 2005
@@ -202,7 +202,7 @@
   [AC_MSG_CHECKING([for csh hash hack])
 
 cat <<EOF >conftest.sh
-#!/bin/sh
+#! /bin/sh
 true || exit 0
 export PATH || exit 0
 exit 1
Index: groff/arch/misc/shdeps.sh
diff -u groff/arch/misc/shdeps.sh:1.2 groff/arch/misc/shdeps.sh:1.3
--- groff/arch/misc/shdeps.sh:1.2       Fri Apr  9 09:01:21 2004
+++ groff/arch/misc/shdeps.sh   Wed May 18 07:03:06 2005
@@ -1,7 +1,7 @@
-#!/bin/sh
+#! /bin/sh
 # shdeps.sh: Generate OS dependency fixups, for `groff' shell scripts
 #
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 #      Written by Keith Marshall (address@hidden)
 #
 # Invoked only by `make', as:
@@ -40,6 +40,7 @@
   cat << ETX
 \\
 GROFF_RUNTIME="\${GROFF_BIN_PATH=$3}:"
+/@PATH_SEARCH_SETUP@/d
 ETX
 
 else
@@ -83,6 +84,34 @@
     GROFF_RUNTIME=\${GROFF_BIN_PATH="$POSIX_BINDIR"}";" ;;\\
 esac
 ETX
+  # On Microsoft platforms, we may also need to configure
+  # the PATH search function, used in the `pdfroff' script,
+  # to use ';', instead of ':', as the PATH_SEPARATOR.
+
+  cat << ETX
+/@PATH_SEARCH_SETUP@/c\\
+#\\
+# This implementation is configured for a Microsoft platform.\\
+# Thus, the default PATH_SEPARATOR is ';', although some shells may\\
+# use the POSIX standard ':' instead.  Therefore, we need to examine\\
+# the OSTYPE environment variable, to identify which is appropriate\\
+# to make PATH searches work correctly.\\
+#\\
+  case "\$OSTYPE" in\\
+#\\
+    msys | cygwin)\\
+    #\\
+    # These emulate POSIX, and use ':'\\
+    #\\
+      PATH_SEPARATOR=\${PATH_SEPARATOR-':'} ;;\\
+#\\
+    *)\\
+    #\\
+    # For anything else, default to ';'\\
+    #\\
+      PATH_SEPARATOR=\${PATH_SEPARATOR-';'} ;;\\
+  esac
+ETX
 
 fi
 
Index: groff/configure
diff -u groff/configure:1.66 groff/configure:1.67
--- groff/configure:1.66        Sat Apr 30 07:03:13 2005
+++ groff/configure     Wed May 18 07:03:06 2005
@@ -5721,7 +5721,7 @@
 echo $ECHO_N "checking for csh hash hack... $ECHO_C" >&6
 
 cat <<EOF >conftest.sh
-#!/bin/sh
+#! /bin/sh
 true || exit 0
 export PATH || exit 0
 exit 1
Index: groff/contrib/eqn2graph/eqn2graph.sh
diff -u groff/contrib/eqn2graph/eqn2graph.sh:1.4 
groff/contrib/eqn2graph/eqn2graph.sh:1.5
--- groff/contrib/eqn2graph/eqn2graph.sh:1.4    Tue May 17 20:20:53 2005
+++ groff/contrib/eqn2graph/eqn2graph.sh        Wed May 18 07:03:06 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 #
 # eqn2graph -- compile EQN equation descriptions to bitmap images
 #
@@ -32,7 +32,7 @@
 #
 # Thus, we pass -U to groff(1), and everything else to convert(1).
 #
-# $Id: eqn2graph.sh,v 1.4 2005/05/17 20:20:53 wl Exp $
+# $Id: eqn2graph.sh,v 1.5 2005/05/18 07:03:06 wl Exp $
 #
 groff_opts=""
 convert_opts=""
Index: groff/contrib/gdiffmk/gdiffmk.sh
diff -u groff/contrib/gdiffmk/gdiffmk.sh:1.6 
groff/contrib/gdiffmk/gdiffmk.sh:1.7
--- groff/contrib/gdiffmk/gdiffmk.sh:1.6        Sun Jan 16 23:08:26 2005
+++ groff/contrib/gdiffmk/gdiffmk.sh    Wed May 18 07:03:06 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
 # Written by Mike Bianchi <address@hidden <mailto:address@hidden>>
 
Index: groff/contrib/gdiffmk/tests/runtests.in
diff -u groff/contrib/gdiffmk/tests/runtests.in:1.4 
groff/contrib/gdiffmk/tests/runtests.in:1.5
--- groff/contrib/gdiffmk/tests/runtests.in:1.4 Sun Jan 16 01:43:21 2005
+++ groff/contrib/gdiffmk/tests/runtests.in     Wed May 18 07:03:06 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 #      A very simple function test for gdiffmk.sh.
 
 address@hidden@
Index: groff/contrib/grap2graph/grap2graph.sh
diff -u groff/contrib/grap2graph/grap2graph.sh:1.3 
groff/contrib/grap2graph/grap2graph.sh:1.4
--- groff/contrib/grap2graph/grap2graph.sh:1.3  Tue May 17 20:20:53 2005
+++ groff/contrib/grap2graph/grap2graph.sh      Wed May 18 07:03:06 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 #
 # grap2graph -- compile graph description descriptions to bitmap images
 #
@@ -28,7 +28,7 @@
 #
 # Thus, we pass -U to groff(1), and everything else to convert(1).
 #
-# $Id: grap2graph.sh,v 1.3 2005/05/17 20:20:53 wl Exp $
+# $Id: grap2graph.sh,v 1.4 2005/05/18 07:03:06 wl Exp $
 #
 groff_opts=""
 convert_opts=""
Index: groff/contrib/groffer/groffer.sh
diff -u groff/contrib/groffer/groffer.sh:1.22 
groff/contrib/groffer/groffer.sh:1.23
--- groff/contrib/groffer/groffer.sh:1.22       Tue Nov 16 09:18:41 2004
+++ groff/contrib/groffer/groffer.sh    Wed May 18 07:03:06 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 
 # groffer - display groff files
 
Index: groff/contrib/mm/mmroff.pl
diff -u groff/contrib/mm/mmroff.pl:2.2 groff/contrib/mm/mmroff.pl:2.3
--- groff/contrib/mm/mmroff.pl:2.2      Wed Sep 11 08:24:57 2002
+++ groff/contrib/mm/mmroff.pl  Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#! /usr/bin/perl
 
 use strict;
 # runs groff in safe mode, that seems to be the default
Index: groff/contrib/mom/momdoc/appendices.html
diff -u groff/contrib/mom/momdoc/appendices.html:1.7 
groff/contrib/mom/momdoc/appendices.html:1.8
--- groff/contrib/mom/momdoc/appendices.html:1.7        Sat May 14 07:07:12 2005
+++ groff/contrib/mom/momdoc/appendices.html    Wed May 18 07:03:07 2005
@@ -506,7 +506,7 @@
 the GROFF_FONTNAME.
 <p>
 <pre>
-#!/bin/bash
+#! /bin/bash
 
 # A script for installing Type1 fonts.
 #
Index: groff/contrib/pdfmark/ChangeLog
diff -u groff/contrib/pdfmark/ChangeLog:1.10 
groff/contrib/pdfmark/ChangeLog:1.11
--- groff/contrib/pdfmark/ChangeLog:1.10        Tue May 17 20:18:57 2005
+++ groff/contrib/pdfmark/ChangeLog     Wed May 18 07:03:07 2005
@@ -1,3 +1,19 @@
+2005-05-17  Keith Marshall  <address@hidden>
+
+       Improve portability of `pdfroff' shell script.
+
+       * pdfroff.sh: Add space in shebang, conforming to portability
+       guidelines in `autoconf' docs.
+       (searchpath): New shell function; use it instead of `type' command
+       to locate prerequisite helper programs.
+
+       * pdfroff.man: Socument influence of `TYPE' and `PATH_SEPARATOR'
+       environment variables.
+
+       * Makefile.sub: (pdfroff): Make it depend on SH_DEPS_SED_SCRIPT,
+       from arch/misc/shdeps.sh; use it to customize PATH_SEPARATOR
+       initialization code for `searchpath' function in pdfroff.sh.
+
 2005-05-16  Keith Marshall  <address@hidden>
 
        Interim documentation update.
Index: groff/contrib/pdfmark/Makefile.sub
diff -u groff/contrib/pdfmark/Makefile.sub:1.3 
groff/contrib/pdfmark/Makefile.sub:1.4
--- groff/contrib/pdfmark/Makefile.sub:1.3      Wed Mar  2 09:16:15 2005
+++ groff/contrib/pdfmark/Makefile.sub  Wed May 18 07:03:07 2005
@@ -71,12 +71,13 @@
            $(pnmtops_nosetpage) -noturn -rle >$@ ; \
        fi
 
-pdfroff: pdfroff.sh
+pdfroff: pdfroff.sh $(SH_DEPS_SED_SCRIPT)
        $(RM) $@
-       sed -e "s|@VERSION@|$(version)$(revision)|" \
+       sed -f $(SH_DEPS_SED_SCRIPT) \
+           -e "s|@VERSION@|$(version)$(revision)|" \
            -e "s|@GROFF_AWK_INTERPRETERS@|$(ALT_AWK_PROGS)|" \
            -e "s|@GROFF_GHOSTSCRIPT_INTERPRETERS@|$(ALT_GHOSTSCRIPT_PROGS)|" \
-           -e "s|@GROFF_BIN_DIR@|$(bindir)|" $^ >$@
+           -e "s|@GROFF_BIN_DIR@|$(bindir)|" $(srcdir)/pdfroff.sh >$@
        chmod +x $@
 
 install_data: $(make_install_pdfdoc)
Index: groff/contrib/pdfmark/pdfroff.man
diff -u groff/contrib/pdfmark/pdfroff.man:1.2 
groff/contrib/pdfmark/pdfroff.man:1.3
--- groff/contrib/pdfmark/pdfroff.man:1.2       Wed Mar  2 09:16:15 2005
+++ groff/contrib/pdfmark/pdfroff.man   Wed May 18 07:03:07 2005
@@ -420,6 +420,30 @@
 will issue a warning message, and continue processing;
 however, in this case, no reference dictionary will be created.
 .TP
+.B OSTYPE
+Typically defined automatically by the operating system,
+.B OSTYPE
+is used on Microsoft Win32/MS\(hyDOS platforms
+.IR only ,
+to infer the default
+.B PATH_SEPARATOR
+character,
+which is used when parsing the process
+.B PATH
+to search for external helper programs.
+.TP
+.B PATH_SEPARATOR
+If set,
+.B PATH_SEPARATOR
+overrides the default separator character,
+(':' on POSIX/UNIX systems,
+inferred from
+.B OSTYPE
+on Microsoft Win32/MS\(hyDOS),
+which is used when parsing the process
+.B PATH
+to search for external helper programs.
+.TP
 .B SHOW_PROGRESS
 If this is set to a non-empty value, then
 .B pdfroff
Index: groff/contrib/pdfmark/pdfroff.sh
diff -u groff/contrib/pdfmark/pdfroff.sh:1.3 
groff/contrib/pdfmark/pdfroff.sh:1.4
--- groff/contrib/pdfmark/pdfroff.sh:1.3        Mon May  2 10:31:10 2005
+++ groff/contrib/pdfmark/pdfroff.sh    Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 # 
------------------------------------------------------------------------------
 #
 # Function: Format PDF Output from groff Markup
@@ -37,36 +37,66 @@
 #
   CMD=`exec 2>$NULLDEV; basename $0` || CMD=$0
 #
+# To ensure that prerequisite helper programs are available, and are
+# executable, a [fairly] portable method of detecting such programs is
+# provided by function `searchpath'.
+#
+  searchpath(){
+  #
+  # Usage:  searchpath progname path
+  #
+    IFS="${PATH_SEPARATOR-":"}" prog=':'
+    for dir in $2
+    do
+      for ext in '' '.exe'
+      #
+      # try `progname' with all well known extensions
+      # (e.g. Win32 may require `progname.exe')
+      #
+      do
+        try="$dir/$1$ext"
+        test -f "$try" && test -x "$try" && prog="$try" && break
+      done
+      test "$prog" = ":" || break
+    done
+    echo "$prog"
+  }
+# @PATH_SEARCH_SETUP@
+#
 # We need both 'grep' and 'sed' programs, to parse script options,
 # and we also need 'cat', to display help and some error messages,
 # so ensure they are all installed, before we continue.
-# (Again, note that we first check the status from 'type', BEFORE
-#  we attempt to use the result, because Cygwin's 'ash' uses 'stdout'
-#  instead of 'stderr', to display its 'not found' message).
-#
-  CAT=':' GREP=':' SED=':'
-  type cat >$NULLDEV 2>&1 && CAT=`set :\`type cat\` ; eval echo '$'$#`
-  type grep >$NULLDEV 2>&1 && GREP=`set :\`type grep\` ; eval echo '$'$#`
-  type sed >$NULLDEV 2>&1 && SED=`set :\`type sed\` ; eval echo '$'$#`
+#
+  CAT=`searchpath cat "$PATH"`
+  GREP=`searchpath grep "$PATH"`
+  SED=`searchpath sed "$PATH"`
 #
 # Another fundamental requirement is the 'groff' program itself;
-# we will first perform a PATH search to locate this;  however,
-# we will prefer any version existing in a specified GROFF_BIN_DIR,
-# or, if unspecified, the installed location of 'groff' programs;
-# (this will override the result of the initial PATH search).
-#
-  GROFF=':'
-  type groff >$NULLDEV 2>&1 && GROFF=`set :\`type groff\` ; eval echo '$'$#`
-  type ${GROFF_BIN_DIR="@GROFF_BIN_DIR@"}/groff >$NULLDEV 2>&1 \
-    && GROFF=`set :\`type $GROFF_BIN_DIR/groff\` ; eval echo '$'$#`
+# we MUST use a 'groff' program located in 'GROFF_BIN_DIR', if this
+# is specified; if not, we will search 'GROFF_BIN_PATH', only falling
+# back to a 'PATH' search, if neither of these is specified.
+#
+  if test -n "$GROFF_BIN_DIR"
+  then
+    GPATH=GROFF_BIN_DIR
+    GROFF=`searchpath groff "$GROFF_BIN_DIR"`
+#
+  elif test -n "$GROFF_BIN_PATH"
+  then
+    GPATH=GROFF_BIN_PATH
+    GROFF=`searchpath groff "$GROFF_BIN_PATH"`
+#
+  else
+    GPATH=PATH
+    GROFF=`searchpath groff "$PATH"`
+  fi
 #
 # If one or more of these is missing, diagnose and bail out.
 #
-  NO=''
-  NOPROG="$CMD: installation problem: cannot find program"
+  NO='' NOPROG="$CMD: installation problem: cannot find program"
   test "$CAT" = ":" && echo >&2 "$NOPROG 'cat' in PATH" && NO="$NO 'cat'"
   test "$GREP" = ":" && echo >&2 "$NOPROG 'grep' in PATH" && NO="$NO 'grep'"
-  test "$GROFF" = ":" && echo >&2 "$NOPROG 'groff' in $GBIN" && NO="$NO 
'groff'"
+  test "$GROFF" = ":" && echo >&2 "$NOPROG 'groff' in $GPATH" && NO="$NO 
'groff'"
   test "$SED" = ":" && echo >&2 "$NOPROG 'sed' in PATH" && NO="$NO 'sed'"
   if test -n "$NO"
   then
@@ -349,15 +379,19 @@
 #   In order to correctly resolve 'pdfmark' references,
 #   we need to have both the 'awk' and 'diff' programs available.
 #
-    NO='' AWK=':'
-    eval set ${GROFF_AWK_INTERPRETER-"@GROFF_AWK_INTERPRETERS@"}
-    while test $# -gt 0
-    do
-      type $1 >$NULLDEV 2>&1 && AWK=`set :\`type $1\` ; eval echo '$'$#`
-      test "$AWK" = ":" || set "$AWK"
-      shift
-    done
-    type diff >$NULLDEV 2>&1 && DIFF=`set :\`type diff\` ; eval echo '$'$#`
+    NO=''
+    if test -n "$GROFF_AWK_INTERPRETER"
+    then
+      AWK="$GROFF_AWK_INTERPRETER"
+      test -f "$AWK" && test -x "$AWK" || AWK=":"
+    else
+      for prog in @GROFF_AWK_INTERPRETERS@
+      do
+       AWK=`searchpath $prog "$PATH"`
+       test "$AWK" = ":" || break
+      done
+    fi
+    DIFF=`searchpath diff "$PATH"`
     test "$AWK" = ":" && echo >&2 "$NOPROG 'awk' in PATH" && NO="$NO 'awk'"
     test "$DIFF" = ":" && echo >&2 "$NOPROG 'diff' in PATH" && NO="$NO 'diff'"
     if test -n "$NO"
@@ -443,14 +477,17 @@
 # from which the PDF output will be compiled -- but before proceding further 
...
 # let's make sure we have a GhostScript interpreter to convert them!
 #
-  GS=':'
-  eval set ${GROFF_GHOSTSCRIPT_INTERPRETER-"@GROFF_GHOSTSCRIPT_INTERPRETERS@"}
-  while test $# -gt 0
-  do
-    type $1 >$NULLDEV 2>&1 && GS=`set :\`type $1\` ; eval echo '$'$#`
-    test "$GS" = ":" || set "$GS"
-    shift
-  done
+  if test -n "$GROFF_GHOSTSCRIPT_INTERPRETER"
+  then
+    GS="$GROFF_GHOSTSCRIPT_INTERPRETER"
+    test -f "$GS" && test -x "$GS" || GS=":"
+  else
+    for prog in @GROFF_GHOSTSCRIPT_INTERPRETERS@
+    do
+      GS=`searchpath $prog "$PATH"`
+      test "$GS" = ":" || break
+    done
+  fi
 #
 # If we could not find a GhostScript interpreter, then we can do no more.
 #
Index: groff/contrib/pic2graph/pic2graph.sh
diff -u groff/contrib/pic2graph/pic2graph.sh:1.6 
groff/contrib/pic2graph/pic2graph.sh:1.7
--- groff/contrib/pic2graph/pic2graph.sh:1.6    Tue May 17 20:20:53 2005
+++ groff/contrib/pic2graph/pic2graph.sh        Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 #
 # pic2graph -- compile PIC image descriptions to bitmap images
 #
@@ -32,7 +32,7 @@
 # We don't have complete option coverage on eqn because this is primarily
 # intended as a pic translator; we can live with eqn defaults. 
 #
-# $Id: pic2graph.sh,v 1.6 2005/05/17 20:20:53 wl Exp $
+# $Id: pic2graph.sh,v 1.7 2005/05/18 07:03:07 wl Exp $
 #
 groffpic_opts=""
 gs_opts=""
Index: groff/font/devps/generate/afmname
diff -u groff/font/devps/generate/afmname:1.2 
groff/font/devps/generate/afmname:1.3
--- groff/font/devps/generate/afmname:1.2       Mon May 22 20:46:24 2000
+++ groff/font/devps/generate/afmname   Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 # Fix the path name of an AFM file.
 if test -f "$1"
 then
Index: groff/src/devices/xditview/ad2c
diff -u groff/src/devices/xditview/ad2c:1.1.1.1 
groff/src/devices/xditview/ad2c:1.2
--- groff/src/devices/xditview/ad2c:1.1.1.1     Tue Jun  1 10:39:54 2004
+++ groff/src/devices/xditview/ad2c     Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 #
 #      ad2c : Convert app-defaults file to C strings decls.
 #
Index: groff/src/preproc/eqn/neqn.sh
diff -u groff/src/preproc/eqn/neqn.sh:1.8 groff/src/preproc/eqn/neqn.sh:1.9
--- groff/src/preproc/eqn/neqn.sh:1.8   Wed Apr  7 17:46:00 2004
+++ groff/src/preproc/eqn/neqn.sh       Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 # Provision of this shell script should not be taken to imply that use of
 # GNU eqn with groff -Tascii|-Tlatin1|-Tutf8|-Tcp1047 is supported.
 
Index: groff/src/roff/grog/grog.pl
diff -u groff/src/roff/grog/grog.pl:1.14 groff/src/roff/grog/grog.pl:1.15
--- groff/src/roff/grog/grog.pl:1.14    Sat Jun  8 12:34:48 2002
+++ groff/src/roff/grog/grog.pl Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#! /usr/bin/perl
 # grog -- guess options for groff command
 # Inspired by doctype script in Kernighan & Pike, Unix Programming
 # Environment, pp 306-8.
Index: groff/src/roff/grog/grog.sh
diff -u groff/src/roff/grog/grog.sh:1.13 groff/src/roff/grog/grog.sh:1.14
--- groff/src/roff/grog/grog.sh:1.13    Wed Jul 17 04:55:51 2002
+++ groff/src/roff/grog/grog.sh Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 # grog -- guess options for groff command
 # Like doctype in Kernighan & Pike, Unix Programming Environment, pp 306-8.
 
Index: groff/src/roff/nroff/nroff.sh
diff -u groff/src/roff/nroff/nroff.sh:1.17 groff/src/roff/nroff/nroff.sh:1.18
--- groff/src/roff/nroff/nroff.sh:1.17  Wed Apr 13 05:56:32 2005
+++ groff/src/roff/nroff/nroff.sh       Wed May 18 07:03:07 2005
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
 # Emulate nroff with groff.
 
 prog="$0"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]