3 # Script to push docs from my development area to SourceForge, where the
4 # update-docs.sh script unpacks them into their final destination.
6 TARGETHOST
=www.python.org
7 TARGETDIR
=/usr
/home
/fdrake
/tmp
9 PKGTYPE
="bzip" # must be one of: bzip, tar, zip ("tar" implies gzip)
11 TARGET
="$TARGETHOST:$TARGETDIR"
13 ADDRESSES
='python-dev@python.org doc-sig@python.org python-list@python.org'
15 TOOLDIR
="`dirname $0`"
16 VERSION
=`$TOOLDIR/getversioninfo`
18 # Set $EXTRA to something non-empty if this is a non-trunk version:
19 EXTRA
=`echo "$VERSION" | sed 's/^[0-9][0-9]*\.[0-9][0-9]*//'`
21 if echo "$EXTRA" |
grep -q '[.]' ; then
22 DOCLABEL
="maintenance"
25 DOCLABEL
="development"
29 DOCTYPE_SPECIFIED
=false
34 if [ $?
-eq 4 ] ; then
35 # We have a sufficiently useful getopt(1) implementation.
36 eval "set -- `getopt -ssh m:p:qt:F: \"$@\"`"
38 # This version of getopt doesn't support quoting of long options
39 # with spaces, so let's not rely on it at all.
43 while [ "$#" -gt 0 ] ; do
59 DOCTYPE_SPECIFIED
=true
63 EXPLANATION
="`cat $2`"
71 echo "Unknown option: $1" >&2
80 if [ "$EXPLANATION" ] ; then
81 echo "Explanation may only be given once!" >&2
93 if [ "$PKGTYPE" = bzip
] ; then
95 elif [ "$PKGTYPE" = tar ] ; then
97 elif [ "$PKGTYPE" = zip ] ; then
100 echo 1>&2 "unsupported package type: $PKGTYPE"
107 # If $DOCTYPE was not specified explicitly, look for .doctype in
108 # .../Doc/ and use the content of that file if present.
109 if $DOCTYPE_SPECIFIED ; then
111 elif [ -f .doctype
] ; then
112 DOCTYPE
="`cat .doctype`"
115 make --no-print-directory ${PKGTYPE}html ||
exit $?
116 PACKAGE
="html-$VERSION.$PKGEXT"
117 scp
"$PACKAGE" tools
/update-docs.sh
$TARGET/ ||
exit $?
118 ssh "$TARGETHOST" tmp
/update-docs.sh
$DOCTYPE $PACKAGE '&&' rm tmp
/update-docs.sh ||
exit $?
121 sendmail
$ADDRESSES <<EOF
123 From: "Fred L. Drake" <fdrake@acm.org>
124 Subject: [$DOCLABEL doc updates]
127 The $DOCLABEL version of the documentation has been updated:
129 http://$TARGETHOST/dev/doc/$DOCTYPE/
133 A downloadable package containing the HTML is also available:
135 http://$TARGETHOST/dev/doc/python-docs-$DOCTYPE.$PKGEXT