Don't display KeyboardInterrupt in an error box.
[rox-lib.git] / MakeDist
blob72f5e3589e848cc3c62d75fa8284da8a74b8fdfc
1 #!/usr/bin/env python
2 from xml.dom import minidom, Node
3 import os, sys
5 sfuser='tal197'
6 if len(sys.argv)>1:
7 sfuser=sys.argv[1]
9 appinfo = minidom.parse('AppInfo.xml')
10 root = appinfo.documentElement
11 assert root.localName == 'AppInfo'
12 for x in root.childNodes:
13 if x.nodeType != Node.ELEMENT_NODE: continue
14 if x.localName == 'About': break
15 else:
16 assert 0
17 for y in x.childNodes:
18 if y.nodeType != Node.ELEMENT_NODE: continue
19 if y.localName == 'Version': break
20 else:
21 assert 0
22 version = ''.join([text.nodeValue for text in y.childNodes
23 if text.nodeType == Node.TEXT_NODE])
25 a, b, c = map(int, version.split(' ')[0].split('.')[:3])
27 sys.path.append(os.path.dirname(__file__) + '/python')
28 import rox
29 if rox.roxlib_version != (a, b, c):
30 print 'Version mismatch!'
31 print 'AppInfo : (%d.%d.%d)' % (a, b, c)
32 print '__init__.py: (%d.%d.%d)' % rox.roxlib_version
33 raise SystemExit(1)
35 raw_input("Create rox-lib-%s (%d.%d.%d)?" % (version, a, b, c))
37 os.system('cvs rel .')
38 os.system('cvs tag -F Release-%d-%d-%d' % (a, b, c))
40 os.chdir(os.environ['HOME'])
41 dir = 'rox-lib-%d.%d.%d' % (a, b, c)
42 os.mkdir(dir)
43 os.chdir(dir)
44 #os.system('cvs -d:pserver:anonymous@cvs.rox.sourceforge.net:/cvsroot/rox export -r Release-%d-%d-%d ROX-Lib2' % (a, b, c))
45 os.system('cvs -d%s@cvs.sourceforge.net:/cvsroot/rox export -r Release-%d-%d-%d ROX-Lib2' % (sfuser, a, b, c))
46 os.system('cd ROX-Lib2/Messages; ./update-po; ./dist; rm *.old')
47 os.system('cd ROX-Lib2/python; ./make_docs.py; rm rox/.cvsignore rox/*.pyc rox/messages.pot')
48 os.chdir(os.environ['HOME'])
49 os.system('tar czf %s.tgz %s' % (dir, dir))
50 print "%s.tgz is ready!" % dir