update-docs.sh 685 Bytes
Newer Older
1 2
#! /bin/sh

3
# Script which installs a development snapshot of the documentation
4
# into the development website.
5
#
6
# The push-docs.sh script pushes this to the server when needed
7
# and removes it when done.
8 9 10 11 12 13

if [ -z "$HOME" ] ; then
    HOME=`grep fdrake /etc/passwd | sed 's|^.*:\([^:]*\):[^:]*$|\1|'`
    export HOME
fi

14 15 16 17
DOCTYPE="$1"
UPDATES="$HOME/tmp/$2"

TMPDIR="$$-docs"
18

19
cd /ftp/ftp.python.org/pub/www.python.org/dev/doc/ || exit $?
20 21
mkdir $TMPDIR || exit $?
cd $TMPDIR || exit $?
22
(bzip2 -dc "$UPDATES" | tar xf -) || exit $?
23 24
cd .. || exit $?

25 26
if [ -d $DOCTYPE ] ; then
    mv $DOCTYPE $DOCTYPE-temp
27
fi
28
mv $TMPDIR $DOCTYPE
29
rm -rf $DOCTYPE-temp || exit $?
30
rm "$UPDATES" || exit $?