mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	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.
This commit is contained in:
		
							parent
							
								
									93c867139f
								
							
						
					
					
						commit
						3f4e717c31
					
				
					 2 changed files with 41 additions and 37 deletions
				
			
		| 
						 | 
					@ -3,21 +3,43 @@
 | 
				
			||||||
#  Script to push docs from my development area to SourceForge, where the
 | 
					#  Script to push docs from my development area to SourceForge, where the
 | 
				
			||||||
#  update-docs.sh script unpacks them into their final destination.
 | 
					#  update-docs.sh script unpacks them into their final destination.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
TARGET=python.sourceforge.net:/home/users/fdrake
 | 
					TARGET=python.sourceforge.net:/home/users/fdrake/tmp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ "$1" ] ; then
 | 
					ADDRESSES='python-dev@python.org doc-sig@python.org python-list@python.org'
 | 
				
			||||||
    scp "$1" $TARGET/python-docs-update.txt || exit $?
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set -x
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					EXPLANATION=''
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [ "$1" = '-m' ] ; then
 | 
				
			||||||
 | 
					    EXPLANATION="$2"
 | 
				
			||||||
 | 
					    shift 2
 | 
				
			||||||
 | 
					elif [ "$1" ] ; then
 | 
				
			||||||
 | 
					    EXPLANATION="`cat $1`"
 | 
				
			||||||
 | 
					    shift 1
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
START="`pwd`"
 | 
					START="`pwd`"
 | 
				
			||||||
MYDIR="`dirname $0`"
 | 
					MYDIR="`dirname $0`"
 | 
				
			||||||
cd "$MYDIR"
 | 
					cd "$MYDIR"
 | 
				
			||||||
MYDIR="`pwd`"
 | 
					MYDIR="`pwd`"
 | 
				
			||||||
HTMLDIR="${HTMLDIR:-html}"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
cd "../$HTMLDIR"
 | 
					 | 
				
			||||||
make --no-print-directory || exit $?
 | 
					 | 
				
			||||||
cd ..
 | 
					cd ..
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# now in .../Doc/
 | 
				
			||||||
 | 
					make --no-print-directory || exit $?
 | 
				
			||||||
 | 
					make --no-print-directory bziphtml || exit $?
 | 
				
			||||||
RELEASE=`grep '^RELEASE=' Makefile | sed 's|RELEASE=||'`
 | 
					RELEASE=`grep '^RELEASE=' Makefile | sed 's|RELEASE=||'`
 | 
				
			||||||
make --no-print-directory HTMLDIR="$HTMLDIR" bziphtml
 | 
					scp "html-$RELEASE.tar.bz2" $TARGET/python-docs-update.tar.bz2 || exit $?
 | 
				
			||||||
scp "html-$RELEASE.tar.bz2" $TARGET/python-docs-update.tar.bz2
 | 
					scp tools/update-docs.sh $TARGET/update-docs.sh || exit $?
 | 
				
			||||||
 | 
					ssh python.sourceforge.net 'tmp/update-docs.sh && rm tmp/update-docs.sh' || exit $?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Mail -s '[development doc updates]' $ADDRESSES <<EOF
 | 
				
			||||||
 | 
					The development version of the documentation has been updated:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						http://python.sourceforge.net/devel-docs/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$EXPLANATION
 | 
				
			||||||
 | 
					EOF
 | 
				
			||||||
 | 
					exit $?
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,39 +1,21 @@
 | 
				
			||||||
#! /bin/sh
 | 
					#! /bin/sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#  Script which determines if a new development snapshot of the
 | 
					# Script which installs a development snapshot of the documentation
 | 
				
			||||||
#  documentation is available, and unpacks it into the "Python @
 | 
					# into the "Python @ SourceForge" website.
 | 
				
			||||||
#  SourceForge" website.
 | 
					 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
#  A copy of this script is run periodically via cron.
 | 
					# The push-docs.sh script pushes this to the SourceForge when needed
 | 
				
			||||||
 | 
					# and removes it when done.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -z "$HOME" ] ; then
 | 
					if [ -z "$HOME" ] ; then
 | 
				
			||||||
    HOME=`grep fdrake /etc/passwd | sed 's|^.*:\([^:]*\):[^:]*$|\1|'`
 | 
					    HOME=`grep fdrake /etc/passwd | sed 's|^.*:\([^:]*\):[^:]*$|\1|'`
 | 
				
			||||||
    export HOME
 | 
					    export HOME
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
UPDATES=$HOME/python-docs-update.tar.bz2
 | 
					UPDATES=$HOME/tmp/python-docs-update.tar.bz2
 | 
				
			||||||
INFO=$HOME/python-docs-update.txt
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ -f "$UPDATES" ] ; then
 | 
					cd /home/groups/python/htdocs
 | 
				
			||||||
    cd /home/groups/python/htdocs
 | 
					rm -rf devel-docs || exit $?
 | 
				
			||||||
    rm -rf devel-docs || exit $?
 | 
					mkdir devel-docs || exit $?
 | 
				
			||||||
    mkdir devel-docs || exit $?
 | 
					cd devel-docs || exit $?
 | 
				
			||||||
    cd devel-docs || exit $?
 | 
					(bzip2 -dc "$UPDATES" | tar xf -) || exit $?
 | 
				
			||||||
    (bzip2 -dc "$UPDATES" | tar xf -) || exit $?
 | 
					rm "$UPDATES" || exit $?
 | 
				
			||||||
    rm "$UPDATES" || exit $?
 | 
					 | 
				
			||||||
    if [ -f "$INFO" ] ; then
 | 
					 | 
				
			||||||
        EXPLANATION="`cat $INFO`"
 | 
					 | 
				
			||||||
    else
 | 
					 | 
				
			||||||
        EXPLANATION=''
 | 
					 | 
				
			||||||
    fi
 | 
					 | 
				
			||||||
    Mail -s '[development doc updates]' \
 | 
					 | 
				
			||||||
     python-dev@python.org doc-sig@python.org \
 | 
					 | 
				
			||||||
     <<EOF
 | 
					 | 
				
			||||||
The development version of the documentation has been updated:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	http://python.sourceforge.net/devel-docs/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
$EXPLANATION
 | 
					 | 
				
			||||||
EOF
 | 
					 | 
				
			||||||
    rm -f $HOME/python-docs-update.txt
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue