~svn/ubuntu/raring/subversion/ppa

« back to all changes in this revision

Viewing changes to doc/tools/bin/run-fop.sh

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:26:14 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205012614-qom4xfypgtsqc2xq
Tags: 1.2.3dfsg1-3ubuntu1
Merge with the final Debian release of 1.2.3dfsg1-3, bringing in
fixes to the clean target, better documentation of the libdb4.3
upgrade and build fixes to work with swig1.3_1.3.27.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
# run-fop: Attempt to run fop (or fop.sh), fail articulately otherwise.
 
4
#
 
5
# Usage:    run-fop.sh BOOK_TOP [FOP_ARGS...]
 
6
#
 
7
# This script is meant to be invoked by subversion/doc/book/Makefile.
 
8
# The first argument is the top of the book directory, that is,
 
9
# subversion/doc/book (*not* subversion/doc/book/book), and the
 
10
# remaining arguments are passed along to `fop'.
 
11
 
 
12
BOOK_TOP=${1}
 
13
 
 
14
if [ "${BOOK_TOP}X" = X ]; then
 
15
  echo "usage:  run-fop.sh BOOK_TOP [FOP_ARGS...]"
 
16
  exit 1
 
17
fi
 
18
 
 
19
shift
 
20
 
 
21
# The fop of last resort.
 
22
DESPERATION_FOP_DIR=${BOOK_TOP}/tools/fop
 
23
DESPERATION_FOP_PGM=${DESPERATION_FOP_DIR}/fop.sh
 
24
 
 
25
if [ "${FOP_HOME}X" = X ]; then
 
26
  FOP_HOME=${DESPERATION_FOP_DIR}
 
27
  export FOP_HOME
 
28
fi
 
29
 
 
30
 
 
31
# Unfortunately, 'which' seems to behave slightly differently on every
 
32
# platform, making it unreliable for shell scripts.  Just do it inline
 
33
# instead.  Also, note that we search for `fop' or `fop.sh', since
 
34
# different systems seem to package it different ways.
 
35
SAVED_IFS=${IFS}
 
36
IFS=:
 
37
for dir in ${PATH}; do
 
38
   if [ -x ${dir}/fop -a "${FOP_PGM}X" = X ]; then
 
39
     FOP_PGM=${dir}/fop
 
40
   elif [ -x ${dir}/fop.sh -a "${FOP_PGM}X" = X ]; then
 
41
     FOP_PGM=${dir}/fop.sh
 
42
   fi
 
43
done
 
44
IFS=${SAVED_IFS}
 
45
 
 
46
if [ "${FOP_PGM}X" = X ]; then
 
47
  FOP_PGM=${DESPERATION_FOP_PGM}
 
48
fi
 
49
 
 
50
echo "(Using '${FOP_PGM}' for FOP)"
 
51
 
 
52
# FOP is noisy on stdout, and -q doesn't seem to help, so stuff that
 
53
# garbage into /dev/null.
 
54
${FOP_PGM} $@ | grep -v "\[ERROR\]"
 
55