Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f4e717

Browse files
committed
Revise the scripts I use to update the documentation on the SourceForge
site. These now seem (slightly) more reliable, and easier to work with since update-docs.sh no longer needs to be installed ahead of time on my account at SF.
1 parent 93c8671 commit 3f4e717

2 files changed

Lines changed: 41 additions & 37 deletions

File tree

Doc/tools/push-docs.sh

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,43 @@
33
# Script to push docs from my development area to SourceForge, where the
44
# update-docs.sh script unpacks them into their final destination.
55

6-
TARGET=python.sourceforge.net:/home/users/fdrake
6+
TARGET=python.sourceforge.net:/home/users/fdrake/tmp
77

8-
if [ "$1" ] ; then
9-
scp "$1" $TARGET/python-docs-update.txt || exit $?
8+
9+
10+
11+
set -x
12+
13+
EXPLANATION=''
14+
15+
if [ "$1" = '-m' ] ; then
16+
EXPLANATION="$2"
17+
shift 2
18+
elif [ "$1" ] ; then
19+
EXPLANATION="`cat $1`"
20+
shift 1
1021
fi
1122

1223
START="`pwd`"
1324
MYDIR="`dirname $0`"
1425
cd "$MYDIR"
1526
MYDIR="`pwd`"
16-
HTMLDIR="${HTMLDIR:-html}"
1727

18-
cd "../$HTMLDIR"
19-
make --no-print-directory || exit $?
2028
cd ..
29+
30+
# now in .../Doc/
31+
make --no-print-directory || exit $?
32+
make --no-print-directory bziphtml || exit $?
2133
RELEASE=`grep '^RELEASE=' Makefile | sed 's|RELEASE=||'`
22-
make --no-print-directory HTMLDIR="$HTMLDIR" bziphtml
23-
scp "html-$RELEASE.tar.bz2" $TARGET/python-docs-update.tar.bz2
34+
scp "html-$RELEASE.tar.bz2" $TARGET/python-docs-update.tar.bz2 || exit $?
35+
scp tools/update-docs.sh $TARGET/update-docs.sh || exit $?
36+
ssh python.sourceforge.net 'tmp/update-docs.sh && rm tmp/update-docs.sh' || exit $?
37+
38+
Mail -s '[development doc updates]' $ADDRESSES <<EOF
39+
The development version of the documentation has been updated:
40+
41+
http://python.sourceforge.net/devel-docs/
42+
43+
$EXPLANATION
44+
EOF
45+
exit $?

Doc/tools/update-docs.sh

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,21 @@
11
#! /bin/sh
22

3-
# Script which determines if a new development snapshot of the
4-
# documentation is available, and unpacks it into the "Python @
5-
# SourceForge" website.
3+
# Script which installs a development snapshot of the documentation
4+
# into the "Python @ SourceForge" website.
65
#
7-
# A copy of this script is run periodically via cron.
6+
# The push-docs.sh script pushes this to the SourceForge when needed
7+
# and removes it when done.
88

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

14-
UPDATES=$HOME/python-docs-update.tar.bz2
15-
INFO=$HOME/python-docs-update.txt
14+
UPDATES=$HOME/tmp/python-docs-update.tar.bz2
1615

17-
if [ -f "$UPDATES" ] ; then
18-
cd /home/groups/python/htdocs
19-
rm -rf devel-docs || exit $?
20-
mkdir devel-docs || exit $?
21-
cd devel-docs || exit $?
22-
(bzip2 -dc "$UPDATES" | tar xf -) || exit $?
23-
rm "$UPDATES" || exit $?
24-
if [ -f "$INFO" ] ; then
25-
EXPLANATION="`cat $INFO`"
26-
else
27-
EXPLANATION=''
28-
fi
29-
Mail -s '[development doc updates]' \
30-
31-
<<EOF
32-
The development version of the documentation has been updated:
33-
34-
http://python.sourceforge.net/devel-docs/
35-
36-
$EXPLANATION
37-
EOF
38-
rm -f $HOME/python-docs-update.txt
39-
fi
16+
cd /home/groups/python/htdocs
17+
rm -rf devel-docs || exit $?
18+
mkdir devel-docs || exit $?
19+
cd devel-docs || exit $?
20+
(bzip2 -dc "$UPDATES" | tar xf -) || exit $?
21+
rm "$UPDATES" || exit $?

0 commit comments

Comments
 (0)