update-docs.sh 746 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

if [ -z "$HOME" ] ; then
10
    HOME=`grep "$LOGNAME" /etc/passwd | sed 's|^.*:\([^:]*\):[^:]*$|\1|'`
11 12 13
    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 29
mv $TMPDIR/Python-Docs-* $DOCTYPE
rmdir $TMPDIR
30
rm -rf $DOCTYPE-temp || exit $?
31
mv "$UPDATES" python-docs-$DOCTYPE.tar.bz2 || exit $?