X-Git-Url: https://mattmccutchen.net/utils/utils.git/blobdiff_plain/55aac39bdb217143421d24b57db92c3f67a2f907..658331ab07da4138fbb4c31fc6cbfe2c6d526e7b:/xsltdepcomp diff --git a/xsltdepcomp b/xsltdepcomp new file mode 100755 index 0000000..2c8481e --- /dev/null +++ b/xsltdepcomp @@ -0,0 +1,21 @@ +#!/bin/bash +# Invoke as xsltdepcomp +set -e + +outfile="$1" +depfile="$2" +shift 2 + +set -o pipefail +trap 'rm -f $depfile.tmp' EXIT + +xsltproc --load-trace "$@" 2>&1 >"$outfile" \ +| sed -f /dev/fd/3 3<"$depfile.tmp" \ +&& mv "$depfile.tmp" "$depfile" +s/^Loaded URL="\(.*\)" ID=".*"$/\1/ +td +w /dev/stderr +/^warning: failed to load external entity / q 6 +d +:d +EOF