Script that gets run by cron on www.python.org to update the online PEPs from

CVS.
This commit is contained in:
Fred Drake 2002-04-03 04:26:44 +00:00
parent c56891588c
commit a3e1cd5abe
1 changed files with 42 additions and 0 deletions

42
update.sh Executable file
View File

@ -0,0 +1,42 @@
#! /bin/sh
# This script is meant to be run by cron regularly on the
# www.python.org server to avoid letting the online PEPs get stale.
# Before using it, the user whose account it is run under needs to use
# the "cvs login" command to log into the Python CVS server as
# anonymous.
TMPDIR="$HOME/tmp"
WORKDIR="peps-$$"
TARGETDIR='/ftp/ftp.python.org/pub/www.python.org/peps'
CVSROOT=':pserver:anonymous@cvs.python.sourceforge.net:/cvsroot/python'
export CVSROOT
cd "$TMPDIR" || exit $?
cvs -Q checkout -d "$WORKDIR" python/nondist/peps || exit $?
cd "$WORKDIR" || exit $?
python ./pep2html.py -q || exit $?
# This loop avoids modifying the files for an unchanged PEP.
# The HTML file is treated a little strangely since it contains the
# (pseudo-)random selection of the corner logo.
for FILE in *.txt ; do
HTML="${FILE%txt}html"
if [ -e "$TARGETDIR/$FILE" ] ; then
if cmp -s "$FILE" "$TARGETDIR/$FILE" ; then
true
else
cp "$FILE" "$TARGETDIR/" || exit $?
cp "$HTML" "$TARGETDIR/" || exit $?
fi
else
cp "$HTML" "$TARGETDIR/" || exit $?
fi
done
cd "$TMPDIR" || exit $?
rm -r "$WORKDIR" || exit $?