Left: | ||
Right: |
OLD | NEW |
---|---|
(Empty) | |
1 #!/bin/sh | |
2 | |
3 # realpath doesn't exist on OSX | |
4 realpath() { | |
hahnjo
2020/03/17 07:41:25
AFAIK sh syntax would be
realpath()
(
...
)
Cur
dak
2020/03/17 07:54:13
Are you sure? I have never seen that. What isn't
| |
5 python -c "import os; print(os.path.realpath('$1'))" | |
6 } | |
7 | |
8 set -eu | |
9 mf2pt1=$(realpath $1) | |
10 src=$(realpath $2) | |
11 target=$(realpath $3) | |
12 srcdir=$(dirname ${src}) | |
13 name=$(basename ${src} .mf) | |
14 | |
15 # mf2pt1 pollutes CWD, so run it in a tmp dir. | |
16 # | |
17 # the soft link for mf2pt1.mp is for recent mpost versions | |
18 # which no longer dump a .mem file | |
19 tmp=$(dirname $target)/tmp.$(basename $target) | |
20 rm -rf $tmp | |
21 mkdir $tmp | |
22 cd $tmp | |
23 ln -s ../mf2pt1.mem . | |
24 ln -s ../../mf2pt1.mp . | |
25 | |
26 export MFINPUTS="$srcdir:..::" | |
27 export max_print_line=1000 | |
28 | |
29 ${mf2pt1} --rounding=0.0001 \ | |
30 --family=$name \ | |
31 --fullname=$name \ | |
32 --name=$name $src | |
33 | |
34 python ${srcdir}/scan-mf-deps.py ${srcdir} ${target} ${name}.log > ${name}.dep | |
35 | |
36 mv *.pfb *.tfm *.log *.dep .. | |
37 cd .. | |
38 rm -rf ${tmp} | |
OLD | NEW |