r30661 removed the only use of the vdelta algorithm from Subversion,
[svn.git] / doc / tools / bin / run-fop.sh
blob1ac0b2ecb2e784d908ba417d2c9e78b9636fef38
1 #!/bin/sh
3 # run-fop: Attempt to run fop (or fop.sh), fail articulately otherwise.
5 # Usage: run-fop.sh [FOP_ARGS...]
7 # This script is meant to be invoked by book translation Makefiles.
8 # Arguments are passed along to `fop'.
10 # If the user has a .foprc, source it.
11 if [ -f ${HOME}/.foprc ]; then
12 . ${HOME}/.foprc
15 # The fop of last resort.
16 DESPERATION_FOP_DIR="`dirname \"$0\"`/../fop"
17 DESPERATION_FOP_PGM=${DESPERATION_FOP_DIR}/fop.sh
19 if [ "${FOP_HOME}X" = X ]; then
20 FOP_HOME=${DESPERATION_FOP_DIR}
21 export FOP_HOME
25 # Unfortunately, 'which' seems to behave slightly differently on every
26 # platform, making it unreliable for shell scripts. Just do it inline
27 # instead. Also, note that we search for `fop' or `fop.sh', since
28 # different systems seem to package it different ways.
29 SAVED_IFS=${IFS}
30 IFS=:
31 PATH=${PATH}:${FOP_HOME}
32 for dir in ${PATH}; do
33 if [ -x ${dir}/fop -a "${FOP_PGM}X" = X ]; then
34 FOP_PGM=${dir}/fop
35 elif [ -x ${dir}/fop.sh -a "${FOP_PGM}X" = X ]; then
36 FOP_PGM=${dir}/fop.sh
38 done
39 IFS=${SAVED_IFS}
41 if [ "${FOP_PGM}X" = X ]; then
42 FOP_PGM=${DESPERATION_FOP_PGM}
45 echo "(Using '${FOP_PGM}' for FOP)"
47 # FOP is noisy on stdout, and -q doesn't seem to help, so stuff that
48 # garbage into /dev/null.
49 ${FOP_PGM} $@ | grep -v "\[ERROR\]"