Commit b70290a7 authored by Georg Brandl's avatar Georg Brandl

Update current version of the "dailybuild" script.

parent 5fb657df
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
# #
# Usages: # Usages:
# #
# dailybuild.py # dailybuild.py [-q]
# #
# without any arguments builds docs for all branches configured in the global # without any arguments builds docs for all branches configured in the global
# BRANCHES value. # BRANCHES value. -q selects "quick build", which means to build only HTML.
# #
# dailybuild.py [-d] <checkout> <target> # dailybuild.py [-q] [-d] <checkout> <target>
# #
# builds one version, where <checkout> is an SVN checkout directory of the # builds one version, where <checkout> is an SVN checkout directory of the
# Python branch to build docs for, and <target> is the directory where the # Python branch to build docs for, and <target> is the directory where the
...@@ -39,18 +39,20 @@ BRANCHES = [ ...@@ -39,18 +39,20 @@ BRANCHES = [
] ]
def build_one(checkout, target, isdev): def build_one(checkout, target, isdev, quick):
print 'Doc autobuild started in %s' % checkout print 'Doc autobuild started in %s' % checkout
os.chdir(checkout) os.chdir(checkout)
print 'Running hg pull --update' print 'Running hg pull --update'
os.system('/usr/local/bin/hg pull --update') os.system('/usr/local/bin/hg pull --update')
print 'Running make autobuild' print 'Running make autobuild'
if os.WEXITSTATUS(os.system( maketarget = 'autobuild-' + ('html' if quick else
'cd Doc; make autobuild-%s' % (isdev and 'dev' or 'stable'))) == 2: ('dev' if isdev else 'stable'))
if os.WEXITSTATUS(os.system('cd Doc; make %s' % maketarget)) == 2:
print '*' * 80 print '*' * 80
return return
print 'Copying HTML files' print 'Copying HTML files to %s' % target
os.system('cp -a Doc/build/html/* %s' % target) os.system('cp -a Doc/build/html/* %s' % target)
if not quick:
print 'Copying dist files' print 'Copying dist files'
os.system('mkdir -p %s/archives' % target) os.system('mkdir -p %s/archives' % target)
os.system('cp -a Doc/dist/* %s/archives' % target) os.system('cp -a Doc/dist/* %s/archives' % target)
...@@ -67,15 +69,21 @@ def usage(): ...@@ -67,15 +69,21 @@ def usage():
if __name__ == '__main__': if __name__ == '__main__':
try: try:
opts, args = getopt.getopt(sys.argv[1:], 'd') opts, args = getopt.getopt(sys.argv[1:], 'dq')
except getopt.error: except getopt.error:
usage() usage()
if opts and not args: quick = devel = False
for opt, _ in opts:
if opt == '-q':
quick = True
if opt == '-d':
devel = True
if devel and not args:
usage() usage()
if args: if args:
if len(args) != 2: if len(args) != 2:
usage() usage()
build_one(args[0], args[1], bool(opts)) build_one(args[0], args[1], devel, quick)
else: else:
for branch in BRANCHES: for checkout, dest, devel in BRANCHES:
build_one(*branch) build_one(checkout, dest, devel, quick)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment