summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBuild/tools/mkdocindex6
-rwxr-xr-xBuild/tools/update-auto180
2 files changed, 75 insertions, 111 deletions
diff --git a/Build/tools/mkdocindex b/Build/tools/mkdocindex
index cc83a522810..4e7630686f4 100755
--- a/Build/tools/mkdocindex
+++ b/Build/tools/mkdocindex
@@ -11,11 +11,13 @@ sub main
umask (0);
chomp (my $mydir = `dirname $0`); # Tools
- chdir ("$mydir/..") || exit 1; # Master
+ chdir ("$mydir/../../Master") || exit 1; # Master
# shell fragment we use to find doc files in a directory.
+ $ENV{"_POSIX2_VERSION"} = 0; # POSIX likes to be backward-incompatible
$FIND_POST = " \\( -name \\*.html -o -name \\*.pdf \\) "
- . " | sort -f -t/ +3 |";
+ . " | tee /tmp/doclist"
+ . " | sort -f -t/ +2 |";
print <<END_HEADER;
<html>
diff --git a/Build/tools/update-auto b/Build/tools/update-auto
index 849bd8e333a..e8c6baeacd7 100755
--- a/Build/tools/update-auto
+++ b/Build/tools/update-auto
@@ -3,35 +3,36 @@
# Public domain. Originally written 2003, Karl Berry.
#
# Deal with files that are automatically updated in one way or another.
-#
-# We should rewrite this to use rdist or make or something, but we'll
-# stick with this kludgy approach as long as we have perforce.
+# New files need to be added manually, doesn't happen often enough.
PATH=/usr/local/bin:$PATH; export PATH
umask 0
-# most stuff in Master.
-Master=`cd \`dirname $0\`/../../Master && /bin/pwd`
+chicken=echo
+chicken=
+cp="cp -fv"
+diff="diff -u2"
+
+tools=`cd \`dirname $0\` && /bin/pwd`
+
+# most stuff is in Master.
+Master=`cd $tools/../../Master && /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.
#
-./Tools/htmltext <readme.en.html >$temp
-if diff $temp README.EN; then
+$tools/htmltext <readme.en.html >$temp
+if $diff README.EN $temp >$temp.en.diff; then
echo " README.EN ok."
else
- p4 edit README.EN || exit 1
- mv $temp README.EN
- #
- printf "Change: new
-Description:
-\t$0 (from readme.en.html)
-Files:
-\t//depot/Master/README.EN
-" | p4 submit -i README.EN
+ echo "will update README.EN."
+ $chicken $cp $temp README.EN
+ update_list="$update_list README.EN"
fi
@@ -46,17 +47,11 @@ for f in $faqmaster/*; do
basef=`basename $f`
faqslavef=$faqslave/$basef
- if diff $faqslavef $f; then
+ if $diff $faqslavef $f >$temp.$basef.diff; then
echo " $faqslavef ok."
else
- p4 edit $faqslavef || exit 1
- cp $f $faqslavef
- printf "Change: new
-Description:
-\t$0 (from $f)
-Files:
-\t//depot/Master/$faqslavef
-" | p4 submit -i $faqslavef
+ $chicken $cp $f $faqslavef
+ update_list="$update_list $faqslavef"
fi
done
# for now, don't bother auto-updating the html files.
@@ -67,18 +62,11 @@ done
modesmaster=/home/ftp/tex/modes.mf
modesslave=texmf-dist/metafont/misc/modes.mf
#
-if diff $modesslave $modesmaster; then
+if $diff $modesslave $modesmaster >$temp.modes.diff; then
echo " $modesslave ok."
else
- p4 edit $modesslave || exit 1
- cp $modesmaster $modesslave
- #
- printf "Change: new
-Description:
-\t$0 (from `hostname`:$modesmaster)
-Files:
-\t//depot/Master/$modesslave
-" | p4 submit -i $modesslave
+ $chicken $cp $modesmaster $modesslave
+ update_list="$update_list $modesslave"
fi
@@ -87,44 +75,30 @@ fi
tximaster=/home/ftp/tex/texinfo.tex
txislave=texmf-dist/tex/texinfo/texinfo.tex
#
-if diff $txislave $tximaster; then
+if $diff $txislave $tximaster >$temp.txi.diff; then
echo " $txislave ok."
else
- p4 edit $txislave || exit 1
- cp $tximaster $txislave
- #
- printf "Change: new
-Description:
-\t$0 (from `hostname`:$tximaster)
-Files:
-\t//depot/Master/$txislave
-" | p4 submit -i $txislave
+ $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 $fontnameslavef $fontnamemaster/$basef; then
+ if $diff $fontnamemaster/$basef $fontnameslavef >$temp.$basef.diff; then
echo " $fontnameslavef ok."
else
- p4 edit $fontnameslavef || exit 1
- cp $fontnamemaster/$basef $fontnameslavef
- printf "Change: new
-Description:
-\t$0 (from $basef)
-Files:
-\t//depot/Master/$fontnameslavef
-" | p4 submit -i $fontnameslavef
+ $chicken $cp $fontnamemaster/$basef $fontnameslavef
+ update_list="$update_list $fontnameslavef"
fi
done
-
# fontname runtime files.
#
fontnamemapslave=texmf-dist/fonts/map/fontname
@@ -133,85 +107,73 @@ files=`cd $fontnamemaster && ls *.map`
for basef in $files; do
test $basef = wolfram.map && continue # obsolete for TL
fontnamemapslavef=$fontnamemapslave/$basef
- if diff $fontnamemapslavef $fontnamemaster/$basef; then
+ if $diff $fontnamemaster/$basef $fontnamemapslavef >$temp.$basef.diff; then
echo " $fontnamemapslavef ok."
else
- p4 edit $fontnamemapslavef || exit 1
- cp $fontnamemaster/$basef $fontnamemapslavef
- printf "Change: new
-Description:
-\t$0 (from $basef)
-Files:
-\t//depot/Master/$fontnamemapslavef
-" | p4 submit -i $fontnamemapslavef
+ $chicken $cp $fontnamemaster/$basef $fontnamemapslavef
+ update_list="$update_list $fontnamemapslavef"
fi
done
-
fontnameencslave=texmf-dist/fonts/enc/dvips/base
#
-files=`cd $fontnamemaster && ls *.enc | grep -vw t5.enc`
+files=`cd $fontnamemaster && ls *.enc | egrep -vw '(groff|t5).enc'`
for basef in $files; do
fontnameencslavef=$fontnameencslave/$basef
- if diff $fontnameencslavef $fontnamemaster/$basef; then
+ if $diff $fontnameencslavef $fontnamemaster/$basef >$temp.$basef.diff; then
echo " $fontnameencslavef ok."
else
- p4 edit $fontnameencslavef || exit 1
- cp $fontnamemaster/$basef $fontnameencslavef
- printf "Change: new
-Description:
-\t$0 (from $basef)
-Files:
-\t//depot/Master/$fontnameencslavef
-" | p4 submit -i $fontnameencslavef
+ $chicken $cp $fontnamemaster/$basef $fontnameencslavef
+ update_list="$update_list $fontnameencslavef"
fi
done
-# doc.html.
-doctemp=docnew.html
-./Tools/mkdocindex | tee $doctemp | grep -v '<small>Generated' >$doctemp.new
-grep -v '<small>Generated' doc.html >$doctemp.cur
-if diff $doctemp.cur $doctemp.new; then
- echo " doc.html ok."
-else
- p4 edit doc.html || exit 1
- mv $doctemp doc.html
- #
- printf "Change: new
-Description:
-\t$0 (from mkdocindex)
-Files:
-\t//depot/Master/doc.html
-" | p4 submit -i doc.html
-fi
-rm $doctemp*
-
-
# config.{guess,sub} from GNU.
#
-updated=
for gnuconf in config.guess config.sub; do
- wget -O $temp "http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/$gnuconf?rev=HEAD&content-type=text/plain" >$temp.2 2>&1
+ url="http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/$gnuconf?rev=HEAD&content-type=text/plain"
+ 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
- if cmp -s $temp $gnuconf; then
+ if $diff $gnuconf $temp >$temp.$gnuconf.diff; then
echo " $gnuconf ok."
else
- # autoupdate all copies in source.
- (cd ..
- alldev="Master/$gnuconf `find Build/source Build/source.development -name $gnuconf`"
+ $chicken $cp $temp $gnuconf
+ update_list="$update_list $gnuconf"
+
+ # find all copies in source.
+ alldev="`find ../Build/source -name $gnuconf`"
for f in $alldev; do
- echo " updating $f."
- p4 edit $f || continue
- cp -pf $temp $f
+ $chicken $cp $gnuconf $f
done
- p4 change -o \
- | sed "s!<enter description here>!$gnuconf update by $0!" \
- | p4 submit -i
- )
+ update_list="$update_list $alldev"
fi
done
+
+
+# doc.html.
+#
+$tools/mkdocindex | tee $temp.doc | grep -v '<small>Generated' >$temp.doc.new
+#
+grep -v '<small>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 -v $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 -m'$0' $update_list
+fi
+
+echo "$0: done `date`."
+exit 0