33cbb7d6cbe1686fb8b34a7f3e9dd145e37fe0c9
[bpt/coccinelle.git] / setup / fake-pdflatex.sh
1 #!/bin/sh -e
2
3 # If you don't have pdflatex installed, but do have the generated pdf files, then
4 # this script provides those pdf files as a substitute for the pdflatex invocation.
5
6 for arg in "$@"; do
7 basename="${arg%.*}"
8 extension="${arg##*.}"
9
10 if test "x$extension" = xtex; then
11 if test -f "${basename}.pdf"; then
12 echo "fake-pdflatex.sh: ${basename}.pdf provided as substitute for: $@"
13 touch "${basename}.pdf"
14 exit 1
15 fi
16 fi
17 done
18
19 echo "error: pdflatex has not been configured, therefore refusing to execute: $@" 1>&2
20 exit 1