summaryrefslogtreecommitdiff
path: root/2005/flow-accounting-ols2005/OLS2005/Texmf/make-wrapper
blob: 820bb8304d5bbc4c582d83be281423ad16530f1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /bin/sh

if [ $# -eq 2 ]; then
    output="${2%.stmp}.tex"
    page=1
elif [ $# -eq 3 ]; then
    output="${3%.stmp}.tex"
    page=$(sed -ne 's:^\\newlabel{NextPage}{{}{\([0-9][0-9]*\)}}$:\1:p' "$2")
else
    echo "usage: $0 defs-file [prior-aux-file] output" >&2
    exit 2
fi

defs="$1"
wrapped="${output%-proc.tex}.tex"
wrapped="${wrapped#*/}"
{
    cat "$defs"
    echo '\def\ProcPage{'$page'}'
    echo '\input' "$wrapped"
} > "${output}T"

./Texmf/move-if-change "${output}T" "$output"
exit 0
personal git repositories of Harald Welte. Your mileage may vary