annotate man/tex3patch @ 65:3189028d0229

Added tag r19-16-pre7 for changeset a01e7a40045c
author cvs
date Mon, 13 Aug 2007 08:59:31 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 #!/bin/sh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 # Auxiliary script to work around TeX 3.0 bug. ---- tex3patch ----
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 # patches texinfo.tex in current directory, or in directory given as arg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ANYVERSION=no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 for arg in $1 $2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 case $arg in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 --dammit | -d ) ANYVERSION=yes ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 * ) dir=$arg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 esac
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 done
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 if [ -z "$dir" ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 dir='.'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 if [ \( 2 -lt $# \) -o \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 \( ! -f $dir/texinfo.tex \) ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 echo "To patch texinfo.tex for peaceful coexistence with Unix TeX 3.0,"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 echo "run $0"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 echo "with no arguments in the same directory as texinfo.tex; or run"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 echo " $0 DIRECTORY"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 echo "(where DIRECTORY is a path leading to texinfo.tex)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 if [ -z "$TMPDIR" ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 TMPDIR=/tmp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 echo "Checking for \`dummy.tfm'"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ( cd $TMPDIR; tex '\relax \batchmode \font\foo=dummy \bye' )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 grep -s '3.0' $TMPDIR/texput.log
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 if [ 1 = "$?" -a "$ANYVERSION" != "yes" ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 echo "You probably do not need this patch,"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 echo "since your TeX does not seem to be version 3.0."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 echo "If you insist on applying the patch, run $0"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 echo "again with the option \`--dammit'"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 grep -s 'file not found' $TMPDIR/texput.log
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 if [ 0 = $? ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 echo "This patch requires the dummy font metric file \`dummy.tfm',"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 echo "which does not seem to be part of your TeX installation."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 echo "Please get your TeX maintainer to install \`dummy.tfm',"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 echo "then run this script again."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 rm $TMPDIR/texput.log
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 echo "Patching $dir/texinfo.tex"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 sed -e 's/%%*\\font\\nullfont/\\font\\nullfont/' \
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 $dir/texinfo.tex >$TMPDIR/texinfo.tex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 mv $dir/texinfo.tex $dir/texinfo.tex-distrib; mv $TMPDIR/texinfo.tex $dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 if [ 0 = $? ]; then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 echo "Patched $dir/texinfo.tex to avoid TeX 3.0 bug."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 echo "The original version is saved as $dir/texinfo.tex-distrib."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 echo "Patch failed. Sorry."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 fi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ----------------------------------------tex3patch ends
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71