#!/bin/sh # $Id$ # Public domain. Originally written 2003, Karl Berry. # # Deal with files that are automatically updated in one way or another. # New files need to be added manually, doesn't happen often enough. PATH=/usr/local/gnu/bin:/usr/local/bin:$PATH; export PATH umask 0 chicken=echo chicken= cp="cp -fv" mv="mv -fv" diff="diff -U 2" mydir=`cd \`dirname $0\` && /bin/pwd` Master=`cd $mydir/../.. && /bin/pwd` cd $Master || exit 1 temp=/tmp/ua$$ trap "rm -f $temp*" 0 1 2 15 update_list= # autogenerate README.EN from readme.html. # $mydir/htmltext $temp if $diff readme-txt.dir/README.EN $temp >$temp.en.diff; then echo " README.EN ok." else $chicken $cp $temp readme-txt.dir/README.EN update_list="$update_list readme-txt.dir/README.EN" fi # modes.mf from elsewhere on tug.org. # modesmaster=/home/ftp/tex/modes.mf modesslave=texmf-dist/metafont/misc/modes.mf # if $diff $modesslave $modesmaster >$temp.modes.diff; then echo " $modesslave ok." else $chicken $cp $modesmaster $modesslave update_list="$update_list $modesslave" fi # texinfo.tex from elsewhere on tug.org. # tximaster=/home/ftp/tex/texinfo.tex txislave=texmf-dist/tex/texinfo/texinfo.tex # if $diff $txislave $tximaster >$temp.txi.diff; then echo " $txislave ok." else $chicken $cp $tximaster $txislave update_list="$update_list $txislave" fi # fontname from elsewhere on tug.org. # fontnamemaster=/home/httpd/html/fontname fontnamedocslave=texmf-dist/doc/fontname # for basef in ChangeLog Makefile bitstrea.aka \ fontname.pdf fontname.html fontname.texi; do fontnameslavef=$fontnamedocslave/$basef if $diff $fontnamemaster/$basef $fontnameslavef >$temp.$basef.diff; then echo " $fontnameslavef ok." else $chicken $cp $fontnamemaster/$basef $fontnameslavef update_list="$update_list $fontnameslavef" fi done # fontname runtime files. # fontnamemapslave=texmf-dist/fonts/map/fontname # files=`cd $fontnamemaster && ls *.map` for basef in $files; do test $basef = wolfram.map && continue # obsolete for TL fontnamemapslavef=$fontnamemapslave/$basef if $diff $fontnamemaster/$basef $fontnamemapslavef >$temp.$basef.diff; then echo " $fontnamemapslavef ok." else $chicken $cp $fontnamemaster/$basef $fontnamemapslavef update_list="$update_list $fontnamemapslavef" fi done fontnameencslave=texmf-dist/fonts/enc/dvips/base # files=`cd $fontnamemaster && ls *.enc | egrep -vw '(groff|t5).enc'` for basef in $files; do fontnameencslavef=$fontnameencslave/$basef if $diff $fontnameencslavef $fontnamemaster/$basef >$temp.$basef.diff; then echo " $fontnameencslavef ok." else $chicken $cp $fontnamemaster/$basef $fontnameencslavef update_list="$update_list $fontnameencslavef" fi done # config.guess/sub from GNU. # for gnuconf in config.guess config.sub; do url="http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=$gnuconf;hb=HEAD" wget -O $temp $url >$temp.2 2>&1 if test ! -s $temp; then echo "$0: skipping, could not retrieve $gnuconf:" >&2 cat $temp.2 continue fi # # we have no need for config.sub in the installer, so check elsewhere. case $gnuconf in config.guess) gnuconffile=tlpkg/installer/$gnuconf;; config.sub) gnuconffile=../Build/source/config/config.sub;; *) echo "$0: impossible $gnuconf" >&2; exit 1;; esac # if $diff $gnuconffile $temp >$temp.$gnuconf.diff; then echo " $gnuconf ok." rm -f $temp else # redundant in the case of config.sub, but doesn't hurt. $chicken $mv $temp $gnuconffile update_list="$update_list $gnuconffile" # find all copies in source. alldev="`find ../Build/source -name $gnuconf`" for f in $alldev; do $chicken $cp $gnuconffile $f done update_list="$update_list $alldev" fi done # tlmgr man page autogenerated. Arrange to ignore date differences. # # return 0 if files $1 and $2 are the same except for the first lines. # (we need to ignore the timestamps in the generation lines.) same_except_for_th () { rm -f /tmp/seft1 /tmp/seft2 sed '/^\.TH/d' <"$1" >/tmp/seft1 sed '/^\.TH/d' <"$2" >/tmp/seft2 cmp -s /tmp/seft1 /tmp/seft2 } mandir=texmf/doc/man manfile=$mandir/man1/tlmgr.1 tlmgr=texmf/scripts/texlive/tlmgr.pl # pod2man $tlmgr >$temp if same_except_for_th $manfile $temp; then echo " `basename $manfile` ok." rm -f $manfile.new else $chicken $mv $temp $manfile (cd $mandir && make) # remake pdfs, should do always but it's something update_list="$update_list $mandir" fi # Update the version on the web site; since these aren't checked in, we # can do it unconditionally. # pod2html="pod2html --cachedir=/tmp" $pod2html $tlmgr >/home/httpd/html/texlive/doc/tlmgr.html $pod2html install-tl >/home/httpd/html/texlive/doc/install-tl.html # doc.html. # $mydir/tl-update-docindex | tee $temp.doc \ | grep -v 'Generated' >$temp.doc.new cp $temp.doc.new /tmp/x # grep -v 'Generated' doc.html >$temp.doc.cur if $diff $temp.doc.cur $temp.doc.new >$temp.doc.diff; then echo " doc.html ok." else $chicken $cp $temp.doc.new doc.html update_list="$update_list doc.html" fi if test -z "$update_list"; then echo "$0: nothing to update." else test x"$chicken" != xecho && echo "$0: committing $update_list" $chicken svn commit --force-log -m$0 $update_list fi echo "$0: done `date`." exit 0