#!/bin/sh # $Id$ # Public domain. Originally written 2003, Karl Berry. # # Deal with files that are automatically updated in one way or another. LC_ALL=C; export LC_ALL PATH=/usr/local/gnu/bin:/usr/local/bin:$PATH; export PATH umask 022 exec &2; exit 1; } 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=$TMPDIR/ua$$ trap "rm -f $temp*" 0 1 2 15 update_list= add_list= # autogenerate README.EN from readme.html. # (skip, better to generate when needed and avoid spurious changes.) # #if $config_scripts_only; then :; else #$mydir/htmltext $temp #if $diff readme-txt.dir/README.EN $temp >$temp.en.diff; then # $verbose " README.EN ok." #else # $chicken $cp $temp readme-txt.dir/README.EN # update_list="$update_list readme-txt.dir/README.EN" #fi #fi # !config_scripts_only # texinfo.tex from elsewhere on tug.org. # if $config_scripts_only; then :; else tximaster=/home/ftp/tex/texinfo.tex txislave=texmf-dist/tex/texinfo/texinfo.tex # if $diff $txislave $tximaster >$temp.txi.diff; then $verbose " $txislave ok." else $chicken $cp $tximaster $txislave update_list="$update_list $txislave" fi fi # !config_scripts_only # fontname from elsewhere on tug.org. # if $config_scripts_only; then :; else fontnamemaster=/home/httpd/html/fontname fontnamedocslave=texmf-dist/doc/fonts/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 $verbose " $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 $verbose " $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|texnansi|xt2|xl2).enc'` for basef in $files; do fontnameencslavef=$fontnameencslave/$basef if $diff $fontnameencslavef $fontnamemaster/$basef >$temp.$basef.diff; then $verbose " $fontnameencslavef ok." else $chicken $cp $fontnamemaster/$basef $fontnameencslavef update_list="$update_list $fontnameencslavef" fi done fi # !config_scripts_only # beebe .bib from elsewhere on tug.org, mirrored from utah. # if $config_scripts_only; then :; else beebe_master=/home/ftp/mirror/ftp.math.utah.edu/bib beebe_slave=texmf-dist/bibtex/bib/beebe # # Unusually, we check and upate only the bib files already committed to # TL, not all from the master area. There are tons of bib files there, # some quite large, so await requests. When a new bib is to be added, # commit manually the first time. files=`cd $beebe_slave && ls *.bib` # for basef in $files; do beebe_slavef=$beebe_slave/$basef if $diff $beebe_master/$basef $beebe_slavef >$temp.$basef.diff; then $verbose " $beebe_slavef ok." else $chicken $cp $beebe_master/$basef $beebe_slavef update_list="$update_list $beebe_slavef" fi done fi # !config_scripts_only # config.guess/sub/etc. from elsewhere on tug.org, mirrored from gnulib. # See Build/source/build-aux/README.TL for more info on common scripts. # if $config_scripts_only || true; then # just for parallelism config_masterdir=/home/ftp/dist/build-aux for gnuconf in ar-lib compile config.guess config.sub depcomp \ install-sh texinfo.tex; do master_conffile=$config_masterdir/$gnuconf local_conffile=../Build/source/build-aux/$gnuconf # if test ! -s $master_conffile; then echo "$0: $master_conffile missing, skipping." >&2 continue fi # if $diff $local_conffile $master_conffile >$temp.$gnuconf.diff; then $verbose " $gnuconf ok." rm -f $temp.$gnuconf.diff else # updated needed. find all copies in source. # Build/source/utils/asymptote/gc* is not checked in (since it's not # unpacked in the original release), therefore we cannot commit to it. alldev="`find ../Build/source -name $gnuconf | grep -v asymptote/gc`" for f in $alldev; do $chicken $cp $master_conffile $f done update_list="$update_list $alldev" # in the case of config.guess, but nothing else, we also need it in # the installer. if test $gnuconf = config.guess; then installer_config_guess=tlpkg/installer/$gnuconf $chicken $cp $master_conffile $installer_config_guess update_list="$update_list $installer_config_guess" fi fi done fi # !config_scripts_only # tlmgr and install-tl man pages + html autogenerated. # Arrange to ignore date differences. # if $config_scripts_only; then :; else # return 0 if files $1 and $2 are the same except for .TH and Id lines. same_except_for_auto () { rm -f $TMPDIR/seft1 $TMPDIR/seft2 sed -e '/^\.TH/d' -e '/[$]Id:/d' <"$1" >$TMPDIR/seft1 sed -e '/^\.TH/d' -e '/[$]Id:/d' <"$2" >$TMPDIR/seft2 cmp -s $TMPDIR/seft1 $TMPDIR/seft2 } mandir=texmf-dist/doc/man tldocdir=texmf-dist/doc/texlive webdir=/home/httpd/html/texlive/doc man_update=false for script in texmf-dist/scripts/texlive/tlmgr.pl install-tl; do pod2man $script >$temp basescript=`basename $script .pl` manfile=$mandir/man1/$basescript.1 if same_except_for_auto $manfile $temp; then $verbose " `basename $manfile` ok." rm -f $manfile.new else $chicken $mv $temp $manfile man_update=true # Update the version on the web site; since these aren't checked in, we # can do it unconditionally. # pod2html="$chicken pod2html --cachedir=$TMPDIR" if test -z "$chicken"; then $pod2html $script >$webdir/$basescript.html cp -p $webdir/$basescript.html $tldocdir/ update_list="$update_list $tldocdir/$basescript.html" fi fi done if test -z "$chicken" && $man_update; then (cd $mandir && make) # remake pdfs, should do always but better than nothing update_list="$update_list $mandir" add_list=`svn status $mandir | sed -n 's/^\? *//p'` fi fi # !config_scripts_only # doc.html. # if $config_scripts_only; then :; else $mydir/tl-update-docindex | tee $temp.doc \ | grep -v 'Generated' >$temp.doc.new # grep -v 'Generated' doc.html >$temp.doc.cur if $diff $temp.doc.cur $temp.doc.new >$temp.doc.diff; then $verbose " doc.html ok." else $chicken $cp $temp.doc doc.html update_list="$update_list doc.html" fi fi # !config_scripts_only # ctan mirror list from ctan. There is constant churn, so don't # update more than once a day. if $config_scripts_only; then :; else ctan_mirrors=$TMPDIR/mirrors # incoming data from CTAN ctan_mirmon=$TMPDIR/mirmon.state mirrors4tl=tlpkg/installer/ctan-mirrors.pl # massaged for TL if test -n "`find $mirrors4tl -newermt '23 hours ago'`"; then echo "$0: ctan mirror list already updated today, skipping update:" >&2 ls -lt $mirrors4tl >&2 elif wget --quiet https://ctan.org/tex-archive/CTAN.sites -O $ctan_mirrors \ && rsync rsync://rsync.dante.ctan.org/MirMon/mirmon.state $ctan_mirmon; then echo "got new mirror data"; ls -l $TMPDIR $mydir/tl-update-ctan-mirrors -v $ctan_mirrors $ctan_mirmon \ >$mirrors4tl.new if test $? -ne 0 || test ! -s $mirrors4tl.new; then echo "$0: tl-update-ctan-mirrors apparently failed, skipping." >&2 elif $diff $mirrors4tl $mirrors4tl.new; then $verbose " $mirrors4tl ok." rm -f $mirrors4tl.new else $chicken $mv $mirrors4tl.new $mirrors4tl $verbose " $mirrors4tl update." test $verbose >/dev/null \ && ls -l $ctan_mirrors $ctan_mirmon $mirrors4tl update_list="$update_list $mirrors4tl" fi else echo "$0: ctan mirror data not retrievable, skipping." >&2 fi fi # !config_scripts_only || !odd_day_num # curl cert bundle. Every other day is more than often enough. if $config_scripts_only || test `expr $(date +%d) % 2` = 0; then :; else curl_cert_src=https://curl.se/ca/cacert.pem curl_cert_dl=$TMPDIR/cacert.pem curl_cert_inst=tlpkg/installer/curl/curl-ca-bundle.crt if wget --quiet $curl_cert_src -O $curl_cert_dl; then if cmp -s $curl_cert_dl $curl_cert_inst; then $verbose " `basename $curl_cert_inst` ok." else $chicken $cp $curl_cert_dl $curl_cert_inst update_list="$update_list $curl_cert_inst" fi else echo "$0: cert bundle not retrievable (wget $curl_cert_src), skipping." >&2 fi fi # !config_scripts_only || !odd_day_num # svn commits. status=0 if test -z "$update_list"; then echo "$0: nothing to update." else if test -z "$add_list"; then :; else test x"$chicken" = xecho || echo "$0: svn adding $add_list" $chicken svn add $add_list fi test x"$chicken" = xecho || echo "$0: committing $update_list" $chicken svn commit --force-log -m"`basename $0`" $update_list status=$? test $status -ne 0 && echo "$0: *** svn commit failed, fix me." >&2 fi echo "$0: done `date`." exit $status