Better help for processes.
[rox-lib.git] / MakeDist
blob136bb0991d9f41513a7d92a0669d70231787e68b
1 #!/usr/bin/env python
2 from xml.dom import minidom, Node
3 import os, sys
5 appinfo = minidom.parse('AppInfo.xml')
6 root = appinfo.documentElement
7 assert root.localName == 'AppInfo'
8 for x in root.childNodes:
9 if x.nodeType != Node.ELEMENT_NODE: continue
10 if x.localName == 'About': break
11 else:
12 assert 0
13 for y in x.childNodes:
14 if y.nodeType != Node.ELEMENT_NODE: continue
15 if y.localName == 'Version': break
16 else:
17 assert 0
18 version = ''.join([text.nodeValue for text in y.childNodes
19 if text.nodeType == Node.TEXT_NODE])
21 a, b, c = map(int, version.split(' ')[0].split('.')[:3])
23 sys.path.append(os.path.dirname(__file__) + '/python')
24 import rox
25 if rox.roxlib_version != (a, b, c):
26 print 'Version mismatch!'
27 print 'AppInfo : (%d.%d.%d)' % (a, b, c)
28 print '__init__.py: (%d.%d.%d)' % rox.roxlib_version
29 raise SystemExit(1)
31 raw_input("Create rox-lib-%s (%d.%d.%d)?" % (version, a, b, c))
33 os.system('cvs rel .')
34 os.system('cvs tag -F Release-%d-%d-%d' % (a, b, c))
36 os.chdir(os.environ['HOME'])
37 dir = 'rox-lib-%d.%d.%d' % (a, b, c)
38 os.mkdir(dir)
39 os.chdir(dir)
40 #os.system('cvs -d:pserver:anonymous@cvs.rox.sourceforge.net:/cvsroot/rox export -r Release-%d-%d-%d ROX-Lib2' % (a, b, c))
41 os.system('cvs -dtal197@cvs.rox.sourceforge.net:/cvsroot/rox export -r Release-%d-%d-%d ROX-Lib2' % (a, b, c))
42 os.system('cd ROX-Lib2/python; ./make_docs.py; rm rox/.cvsignore rox/*.pyc')
43 os.chdir(os.environ['HOME'])
44 os.system('tar czf %s.tgz %s' % (dir, dir))
45 print "%s.tgz is ready!" % dir