2000-10-19 02:54:51 -03:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# Script to push docs from my development area to SourceForge, where the
|
|
|
|
# update-docs.sh script unpacks them into their final destination.
|
|
|
|
|
2002-04-01 16:15:05 -04:00
|
|
|
TARGETHOST=www.python.org
|
|
|
|
TARGETDIR=/usr/home/fdrake/tmp
|
|
|
|
|
2004-06-17 15:36:54 -03:00
|
|
|
PKGTYPE="bzip" # must be one of: bzip, tar, zip ("tar" implies gzip)
|
|
|
|
|
2002-04-01 16:15:05 -04:00
|
|
|
TARGET="$TARGETHOST:$TARGETDIR"
|
2000-11-30 03:38:59 -04:00
|
|
|
|
2001-03-02 17:05:58 -04:00
|
|
|
ADDRESSES='python-dev@python.org doc-sig@python.org python-list@python.org'
|
|
|
|
|
2003-09-28 19:14:29 -03:00
|
|
|
TOOLDIR="`dirname $0`"
|
|
|
|
VERSION=`$TOOLDIR/getversioninfo`
|
|
|
|
|
|
|
|
# Set $EXTRA to something non-empty if this is a non-trunk version:
|
2001-04-22 03:20:31 -03:00
|
|
|
EXTRA=`echo "$VERSION" | sed 's/^[0-9][0-9]*\.[0-9][0-9]*//'`
|
2003-09-28 19:14:29 -03:00
|
|
|
|
|
|
|
if echo "$EXTRA" | grep -q '[.]' ; then
|
2001-04-22 03:20:31 -03:00
|
|
|
DOCLABEL="maintenance"
|
|
|
|
DOCTYPE="maint"
|
|
|
|
else
|
|
|
|
DOCLABEL="development"
|
|
|
|
DOCTYPE="devel"
|
|
|
|
fi
|
|
|
|
|
2004-11-13 13:45:39 -04:00
|
|
|
DOCTYPE_SPECIFIED=false
|
2001-03-02 17:05:58 -04:00
|
|
|
EXPLANATION=''
|
2001-08-08 02:41:01 -03:00
|
|
|
ANNOUNCE=true
|
2001-03-02 17:05:58 -04:00
|
|
|
|
2004-06-17 19:04:17 -03:00
|
|
|
getopt -T >/dev/null
|
|
|
|
if [ $? -eq 4 ] ; then
|
|
|
|
# We have a sufficiently useful getopt(1) implementation.
|
2004-11-02 15:18:20 -04:00
|
|
|
eval "set -- `getopt -ssh m:p:qt:F: \"$@\"`"
|
2004-06-17 19:04:17 -03:00
|
|
|
else
|
|
|
|
# This version of getopt doesn't support quoting of long options
|
|
|
|
# with spaces, so let's not rely on it at all.
|
|
|
|
:
|
|
|
|
fi
|
|
|
|
|
2001-06-12 10:31:37 -03:00
|
|
|
while [ "$#" -gt 0 ] ; do
|
|
|
|
case "$1" in
|
|
|
|
-m)
|
|
|
|
EXPLANATION="$2"
|
|
|
|
shift 2
|
|
|
|
;;
|
2004-06-17 15:36:54 -03:00
|
|
|
-p)
|
|
|
|
PKGTYPE="$2"
|
|
|
|
shift 1
|
|
|
|
;;
|
2001-08-08 02:41:01 -03:00
|
|
|
-q)
|
|
|
|
ANNOUNCE=false
|
|
|
|
shift 1
|
|
|
|
;;
|
2001-06-12 10:31:37 -03:00
|
|
|
-t)
|
|
|
|
DOCTYPE="$2"
|
2004-11-13 13:45:39 -04:00
|
|
|
DOCTYPE_SPECIFIED=true
|
2001-06-12 10:31:37 -03:00
|
|
|
shift 2
|
|
|
|
;;
|
|
|
|
-F)
|
|
|
|
EXPLANATION="`cat $2`"
|
|
|
|
shift 2
|
|
|
|
;;
|
2004-06-29 11:39:06 -03:00
|
|
|
--)
|
|
|
|
shift 1
|
|
|
|
break
|
|
|
|
;;
|
2001-06-12 10:31:37 -03:00
|
|
|
-*)
|
|
|
|
echo "Unknown option: $1" >&2
|
|
|
|
exit 2
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
if [ "$1" ] ; then
|
|
|
|
if [ "$EXPLANATION" ] ; then
|
|
|
|
echo "Explanation may only be given once!" >&2
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
EXPLANATION="$1"
|
|
|
|
shift
|
2000-11-30 03:38:59 -04:00
|
|
|
fi
|
|
|
|
|
2000-10-19 02:54:51 -03:00
|
|
|
START="`pwd`"
|
|
|
|
MYDIR="`dirname $0`"
|
|
|
|
cd "$MYDIR"
|
|
|
|
MYDIR="`pwd`"
|
|
|
|
|
2004-06-17 15:36:54 -03:00
|
|
|
if [ "$PKGTYPE" = bzip ] ; then
|
|
|
|
PKGEXT=tar.bz2
|
|
|
|
elif [ "$PKGTYPE" = tar ] ; then
|
|
|
|
PKGEXT=tgz
|
|
|
|
elif [ "$PKGTYPE" = zip ] ; then
|
|
|
|
PKGEXT=zip
|
|
|
|
else
|
|
|
|
echo 1>&2 "unsupported package type: $PKGTYPE"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
2004-11-13 13:45:39 -04:00
|
|
|
# switch to .../Doc/
|
2000-10-24 16:59:55 -03:00
|
|
|
cd ..
|
2001-03-02 17:05:58 -04:00
|
|
|
|
2004-11-13 13:45:39 -04:00
|
|
|
# If $DOCTYPE was not specified explicitly, look for .doctype in
|
|
|
|
# .../Doc/ and use the content of that file if present.
|
|
|
|
if $DOCTYPE_SPECIFIED ; then
|
|
|
|
:
|
|
|
|
elif [ -f .doctype ] ; then
|
|
|
|
DOCTYPE="`cat .doctype`"
|
|
|
|
fi
|
|
|
|
|
2004-06-17 15:36:54 -03:00
|
|
|
make --no-print-directory ${PKGTYPE}html || exit $?
|
|
|
|
PACKAGE="html-$VERSION.$PKGEXT"
|
2001-04-13 02:13:55 -03:00
|
|
|
scp "$PACKAGE" tools/update-docs.sh $TARGET/ || exit $?
|
2002-04-01 16:15:05 -04:00
|
|
|
ssh "$TARGETHOST" tmp/update-docs.sh $DOCTYPE $PACKAGE '&&' rm tmp/update-docs.sh || exit $?
|
2001-03-02 17:05:58 -04:00
|
|
|
|
2001-08-08 02:41:01 -03:00
|
|
|
if $ANNOUNCE ; then
|
|
|
|
sendmail $ADDRESSES <<EOF
|
2001-07-06 20:45:16 -03:00
|
|
|
To: $ADDRESSES
|
|
|
|
From: "Fred L. Drake" <fdrake@acm.org>
|
|
|
|
Subject: [$DOCLABEL doc updates]
|
2002-04-04 14:06:06 -04:00
|
|
|
X-No-Archive: yes
|
2001-07-06 20:45:16 -03:00
|
|
|
|
2001-07-12 18:50:10 -03:00
|
|
|
The $DOCLABEL version of the documentation has been updated:
|
2001-03-02 17:05:58 -04:00
|
|
|
|
2002-04-01 16:15:05 -04:00
|
|
|
http://$TARGETHOST/dev/doc/$DOCTYPE/
|
2001-03-02 17:05:58 -04:00
|
|
|
|
|
|
|
$EXPLANATION
|
2004-06-17 15:36:54 -03:00
|
|
|
|
|
|
|
A downloadable package containing the HTML is also available:
|
|
|
|
|
|
|
|
http://$TARGETHOST/dev/doc/python-docs-$DOCTYPE.$PKGEXT
|
2001-03-02 17:05:58 -04:00
|
|
|
EOF
|
2001-08-08 02:41:01 -03:00
|
|
|
exit $?
|
|
|
|
fi
|