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

Skip to content

Commit 34b48e8

Browse files
committed
Update publish-to-SourceForge scripts to automatically determine if the
branch is the head (development) branch or a maintenance brach, and use the appropriate target directory for each.
1 parent 82f93c6 commit 34b48e8

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

Doc/tools/push-docs.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ TARGET=python.sourceforge.net:/home/users/fdrake/tmp
77

88
99

10+
VERSION=`echo '$Revision$' | sed 's/[$]Revision: \(.*\) [$]/\1/'`
11+
EXTRA=`echo "$VERSION" | sed 's/^[0-9][0-9]*\.[0-9][0-9]*//'`
12+
if [ "$EXTRA" ] ; then
13+
DOCLABEL="maintenance"
14+
DOCTYPE="maint"
15+
else
16+
DOCLABEL="development"
17+
DOCTYPE="devel"
18+
fi
19+
1020
EXPLANATION=''
1121

1222
if [ "$1" = '-m' ] ; then
@@ -30,12 +40,12 @@ make --no-print-directory bziphtml || exit $?
3040
RELEASE=`grep '^RELEASE=' Makefile | sed 's|RELEASE=||'`
3141
PACKAGE="html-$RELEASE.tar.bz2"
3242
scp "$PACKAGE" tools/update-docs.sh $TARGET/ || exit $?
33-
ssh python.sourceforge.net tmp/update-docs.sh $PACKAGE '&&' rm tmp/update-docs.sh || exit $?
43+
ssh python.sourceforge.net tmp/update-docs.sh $DOCTYPE $PACKAGE '&&' rm tmp/update-docs.sh || exit $?
3444

35-
Mail -s '[development doc updates]' $ADDRESSES <<EOF
45+
Mail -s "[$DOCLABEL doc updates]" $ADDRESSES <<EOF
3646
The development version of the documentation has been updated:
3747
38-
http://python.sourceforge.net/devel-docs/
48+
http://python.sourceforge.net/$DOCTYPE-docs/
3949
4050
$EXPLANATION
4151
EOF

Doc/tools/update-docs.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,20 @@ if [ -z "$HOME" ] ; then
1111
export HOME
1212
fi
1313

14-
UPDATES="$HOME/tmp/$1"
14+
DOCTYPE="$1"
15+
UPDATES="$HOME/tmp/$2"
16+
17+
TMPDIR="$$-docs"
1518

1619
cd /home/groups/python/htdocs || exit $?
17-
rm -rf devel-docs || exit $?
18-
mkdir devel-docs || exit $?
19-
cd devel-docs || exit $?
20+
mkdir $TMPDIR || exit $?
21+
cd $TMPDIR || exit $?
2022
(bzip2 -dc "$UPDATES" | tar xf -) || exit $?
23+
cd .. || exit $?
24+
25+
if [ -d $DOCTYPE-docs ] ; then
26+
mv $DOCTYPE-docs $DOCTYPE-temp
27+
fi
28+
mv $TMPDIR $DOCTYPE-docs
29+
rm -rf $DOCTYPE-temp || exit $?
2130
rm "$UPDATES" || exit $?

0 commit comments

Comments
 (0)