X-Git-Url: http://git.projectaon.org/?p=project-aon.git;a=blobdiff_plain;f=common%2Fpdf%2Fbuild%2Fcheck-images.sh;fp=common%2Fpdf%2Fbuild%2Fcheck-images.sh;h=57cb59b388e27ebb2dbc4d8df5d1cde01080bd5d;hp=0000000000000000000000000000000000000000;hb=f4bdee5083ca9a72713637e1e979aa183e06faea;hpb=97545603aea8298f1eceb604ff65085cc7adfced diff --git a/common/pdf/build/check-images.sh b/common/pdf/build/check-images.sh new file mode 100644 index 0000000..57cb59b --- /dev/null +++ b/common/pdf/build/check-images.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +# Check if the included files are all available in the current directory + +file=$1 + +if [ -z "$file" ] ; then + echo "Usage: $0 file.tex" + echo "Checks if the included graphics in the TeX file are available in " + echo "the current directory" + exit 1 +fi + +if [ ! -r "$file" ] ; then + echo "ERROR: Cannot read $file" + exit 1 +fi + +exitval=0 +grep includegraphics $file | +perl -ne 'print $1."\n" if /.*\{(\w+\.pdf)\}/' | +sort -u | +while read graph; do + [ ! -e "$graph" ] && echo "WARNING: Included graphic file $graph is not available in the current directory." >&2 + exitval=1 +done + + +exit $exitval