| 1 |
#! /bin/sh |
| 2 |
|
| 3 |
# This script is meant to be run by cron regularly on the |
| 4 |
# www.python.org server to avoid letting the online PSEPs get stale. |
| 5 |
# Before using it, the user whose account it is run under needs to use |
| 6 |
# the "cvs login" command to log into the Python CVS server as |
| 7 |
# anonymous. |
| 8 |
|
| 9 |
TMPDIR="/tmp" |
| 10 |
WORKDIR="pseps-$$" |
| 11 |
|
| 12 |
AUXFILES="psep.css style.css index.html" |
| 13 |
|
| 14 |
TARGETDIR='/tmp/www.pyside.org/docs/pseps' |
| 15 |
|
| 16 |
GITROOT='git://gitorious.org/~lucianowolf/pyside/luck-pseps-clone.git' |
| 17 |
#CVSROOT=':pserver:anonymous@cvs.python.sourceforge.net:/cvsroot/python' |
| 18 |
#export CVSROOT |
| 19 |
|
| 20 |
cd "$TMPDIR" || exit $? |
| 21 |
#cvs -Q checkout -d "$WORKDIR" python/nondist/pseps || exit $? |
| 22 |
git clone --depth 1 $GITROOT "$WORKDIR" |
| 23 |
|
| 24 |
cd "$WORKDIR" || exit $? |
| 25 |
#python ./psep2html.py -q || exit $? |
| 26 |
make -s all || exit $? |
| 27 |
|
| 28 |
# This loop avoids modifying the files for an unchanged PSEP. |
| 29 |
# The HTML file is treated a little strangely since it contains the |
| 30 |
# (pseudo-)random selection of the corner logo. |
| 31 |
|
| 32 |
for FILE in psep-*.txt ; do |
| 33 |
HTML="${FILE%txt}html" |
| 34 |
ATT="${FILE%.txt}-*" |
| 35 |
if [ -e "$TARGETDIR/$FILE" ] ; then |
| 36 |
if cmp -s "$FILE" "$TARGETDIR/$FILE" ; then |
| 37 |
true |
| 38 |
else |
| 39 |
cp "$FILE" "$TARGETDIR/" || exit $? |
| 40 |
cp "$HTML" "$TARGETDIR/" || exit $? |
| 41 |
fi |
| 42 |
else |
| 43 |
cp "$FILE" "$TARGETDIR/" || exit $? |
| 44 |
cp "$HTML" "$TARGETDIR/" || exit $? |
| 45 |
fi |
| 46 |
for N in "$ATT"; do |
| 47 |
if [ -e "$N" ] ; then |
| 48 |
if cmp -s "$N" "$TARGETDIR/$N" ; then |
| 49 |
true |
| 50 |
else |
| 51 |
cp "$N" "$TARGETDIR/" || exit $? |
| 52 |
fi |
| 53 |
fi |
| 54 |
done |
| 55 |
done |
| 56 |
|
| 57 |
for FILE in $AUXFILES; do |
| 58 |
if [ -e "$FILE" ] ; then |
| 59 |
if [ -e "$TARGETDIR/$FILE" ] ; then |
| 60 |
if cmp -s "$FILE" "$TARGETDIR/$FILE" ; then |
| 61 |
true |
| 62 |
else |
| 63 |
cp -d "$FILE" "$TARGETDIR/" || exit $? |
| 64 |
fi |
| 65 |
else |
| 66 |
cp -d "$FILE" "$TARGETDIR/" || exit $? |
| 67 |
fi |
| 68 |
fi |
| 69 |
done |
| 70 |
|
| 71 |
cd "$TMPDIR" || exit $? |
| 72 |
rm -rf "$WORKDIR" || exit $? |