summaryrefslogtreecommitdiff
path: root/Build/tools/tpmfromcat
blob: 2caf0f44a463d9bbd4509b6db556ba7e25e05912 (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
25
#!/bin/sh
# $Id$
# read the CTAN catalogue and update the TPM files where possible
Master=`cd \`dirname $0\`/../../Master && /bin/pwd`
cd $Master || exit 1

test $# -eq 0 && set - `find texmf-dist/tpm -name "*.tpm"`
for i in "$@"; do
 echo Try to update $i
 p4 edit $i
 N=`basename $i .tpm`
 L=`echo $N | sed 's/\(.\).*/\1/'`
 wget -q -O x.xml  \
http://cvs.sarovar.org/cgi-bin/cvsweb.cgi/~checkout~/texcatalogue/entries/$L/$N.xml?cvsroot=texcatalogue 
grep -q "<entry" x.xml || echo "<entry/>" > x.xml
xmllint --dropdtd x.xml > /tmp/$N.xml 
 xsltproc \
 -o $N.tpm \
 --stringparam sarovar /tmp/$N.xml \
 --stringparam authors `pwd`/texmf-doc/doc/english/catalogue/authors.xml \
   `pwd`/Tools/tpmfromcat.xsl $i
   xmllint --format $N.tpm > $i
   rm x.xml /tmp/$N.xml $N.tpm
done
p4 revert -a