summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/eqn2graph/eqn2graph.sh4
-rw-r--r--contrib/gdiffmk/gdiffmk.sh2
-rw-r--r--contrib/gdiffmk/tests/runtests.in2
-rw-r--r--contrib/grap2graph/grap2graph.sh4
-rw-r--r--contrib/groffer/groffer.sh2
-rw-r--r--contrib/mm/mmroff.pl2
-rw-r--r--contrib/mom/momdoc/appendices.html2
-rw-r--r--contrib/pdfmark/ChangeLog16
-rw-r--r--contrib/pdfmark/Makefile.sub7
-rw-r--r--contrib/pdfmark/pdfroff.man24
-rw-r--r--contrib/pdfmark/pdfroff.sh109
-rw-r--r--contrib/pic2graph/pic2graph.sh4
12 files changed, 128 insertions, 50 deletions
diff --git a/contrib/eqn2graph/eqn2graph.sh b/contrib/eqn2graph/eqn2graph.sh
index 9a6ce068..98713a85 100644
--- a/contrib/eqn2graph/eqn2graph.sh
+++ b/contrib/eqn2graph/eqn2graph.sh
@@ -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=""
diff --git a/contrib/gdiffmk/gdiffmk.sh b/contrib/gdiffmk/gdiffmk.sh
index 85acbe9c..68e5b8f5 100644
--- a/contrib/gdiffmk/gdiffmk.sh
+++ b/contrib/gdiffmk/gdiffmk.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
# Written by Mike Bianchi <MBianchi@Foveal.com <mailto:MBianchi@Foveal.com>>
diff --git a/contrib/gdiffmk/tests/runtests.in b/contrib/gdiffmk/tests/runtests.in
index 200a95b1..82952652 100644
--- a/contrib/gdiffmk/tests/runtests.in
+++ b/contrib/gdiffmk/tests/runtests.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
# A very simple function test for gdiffmk.sh.
srcdir=@srcdir@
diff --git a/contrib/grap2graph/grap2graph.sh b/contrib/grap2graph/grap2graph.sh
index 99d9a96d..7c830c1a 100644
--- a/contrib/grap2graph/grap2graph.sh
+++ b/contrib/grap2graph/grap2graph.sh
@@ -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=""
diff --git a/contrib/groffer/groffer.sh b/contrib/groffer/groffer.sh
index 0a352766..c2146a23 100644
--- a/contrib/groffer/groffer.sh
+++ b/contrib/groffer/groffer.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
# groffer - display groff files
diff --git a/contrib/mm/mmroff.pl b/contrib/mm/mmroff.pl
index 155550bf..f61daa10 100644
--- a/contrib/mm/mmroff.pl
+++ b/contrib/mm/mmroff.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#! /usr/bin/perl
use strict;
# runs groff in safe mode, that seems to be the default
diff --git a/contrib/mom/momdoc/appendices.html b/contrib/mom/momdoc/appendices.html
index fa62535e..6b5b63fc 100644
--- a/contrib/mom/momdoc/appendices.html
+++ b/contrib/mom/momdoc/appendices.html
@@ -506,7 +506,7 @@ script requires an argument (the .pfb filename), then prompts for
the GROFF_FONTNAME.
<p>
<pre>
-#!/bin/bash
+#! /bin/bash
# A script for installing Type1 fonts.
#
diff --git a/contrib/pdfmark/ChangeLog b/contrib/pdfmark/ChangeLog
index b96debed..1b2e5bab 100644
--- a/contrib/pdfmark/ChangeLog
+++ b/contrib/pdfmark/ChangeLog
@@ -1,3 +1,19 @@
+2005-05-17 Keith Marshall <keith.d.marshall@ntlworld.com>
+
+ 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 <keith.d.marshall@ntlworld.com>
Interim documentation update.
diff --git a/contrib/pdfmark/Makefile.sub b/contrib/pdfmark/Makefile.sub
index af7d01bf..387dc167 100644
--- a/contrib/pdfmark/Makefile.sub
+++ b/contrib/pdfmark/Makefile.sub
@@ -71,12 +71,13 @@ gnu.eps:
$(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)
diff --git a/contrib/pdfmark/pdfroff.man b/contrib/pdfmark/pdfroff.man
index a1cc2732..7d83cdd9 100644
--- a/contrib/pdfmark/pdfroff.man
+++ b/contrib/pdfmark/pdfroff.man
@@ -420,6 +420,30 @@ if none of these are found,
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
diff --git a/contrib/pdfmark/pdfroff.sh b/contrib/pdfmark/pdfroff.sh
index abb18926..8acff214 100644
--- a/contrib/pdfmark/pdfroff.sh
+++ b/contrib/pdfmark/pdfroff.sh
@@ -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).
+# 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"`
#
- 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 '$'$#`
+ 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.
#
diff --git a/contrib/pic2graph/pic2graph.sh b/contrib/pic2graph/pic2graph.sh
index 9620f692..5a066cef 100644
--- a/contrib/pic2graph/pic2graph.sh
+++ b/contrib/pic2graph/pic2graph.sh
@@ -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=""