Revision 65dfd777 autotools/docbook-wrapper

b/autotools/docbook-wrapper
2 2

  
3 3
set -e
4 4

  
5
input="${1}"
6
output="${2}"
5
if test "$#" != 3
6
then
7
  echo "Wrong number of arguments." >&2
8
  exit 1
9
fi
10

  
11
cmd="${1}"
12
input="${2}"
13
output="${3}"
7 14

  
8 15
# docbook2man inserts a date formatted using the current locale into its
9 16
# output. Using the "C" locale makes sure it's always in the default format.
10 17
export LC_ALL=C
11 18

  
12
case "${output}" in
13
  *.pdf) cmd=docbook2pdf ;;
14
  *.html) cmd='docbook2html --nochunks' ;;
15
  *.7|*.8) cmd=docbook2man ;;
16
  *)
17
    echo "Unknown filetype: ${output}" >&2
18
    exit 1
19
  ;;
20
esac
21

  
22 19
tmpdir=`mktemp -d`
23 20
trap "rm -rf ${tmpdir}" EXIT
24 21

  
......
27 24
then
28 25
  echo "Building ${output} failed." >&2
29 26
  exit 1
30
fi;
27
fi
31 28

  
32 29
mv "${tmpdir}/`basename "${output}"`" "${output}"
33 30

  

Also available in: Unified diff