]> git.donarmstrong.com Git - lilypond.git/blob - stepmake/bin/release.py
d614eb5cd3e1568173a56920bc625ec9ed9892ad
[lilypond.git] / stepmake / bin / release.py
1 #!@PYTHON@
2 # release.py
3
4 name = 'release'
5 version = '0.1'
6
7 import os
8 import sys
9 import getopt
10
11 (options, files) = getopt.getopt(sys.argv[1:], 'hp:', ['help', 'package=']) 
12
13 def help ():
14     sys.stdout.write ("Usage: release [OPTION]...\n"
15                  "Make a tarball and patch and combined ../test/updeet\n\n"
16                  + "Options:\n"
17                  + "  -h, --help             print this help\n"
18                  + "  -p, --package=DIR      specify package\n"
19                       )
20     sys.exit (0)
21
22 for opt in options:
23     o = opt[0]
24     a = opt[1]
25     if o == '-h' or o == '--help':
26         help ()
27     elif o == '-p' or o == '--package':
28         topdir = a
29
30 sys.path.append (topdir + '/stepmake/bin')
31 from packagepython import *
32 package = Package (topdir)
33 packager = Packager ()
34 from flower import *
35
36 os.chdir(package.topdir)
37 status =os.system('make dist')
38 if status:
39     raise 'make dist failed'
40
41 cur_ver = package.version
42 # urg?
43 # print tarball(cur_ver)
44 barbaal=package.name + '-' + version_tuple_to_str (cur_ver) + '.tar.gz'
45 print barbaal
46 # os.rename('out/' + tarball(cur_ver), released_tarball(cur_ver))
47 # hmmm
48 os.remove(package.release_dir + barbaal)
49 os.link('out/' + barbaal, package.release_dir + barbaal)
50 os.chdir(package.test_dir)
51 try:
52         os.system('set -x; rm ' + package.test_dir + package.name + '*gz')
53 except:
54         pass
55 # os.link(released_tarball(cur_ver), tarball(cur_ver))
56 os.link(package.release_dir + barbaal, barbaal)
57
58 # not a module, but a script (JCN)
59 # makepatch.main()
60
61 # Module wherefore aren't thou Script
62 # A Rose by any other name would be as blonde. --HWN
63
64 # urg
65 # os.system('@PYTHON@ ' + package.topdir + '/stepmake/bin/package-diff.py --package=' + topdir)
66 os.system(sys.executable + ' ' + package.topdir + '/stepmake/bin/package-diff.py --package=' + topdir)
67
68 pn = package.name + '-%s' % version_tuple_to_str(cur_ver)
69 pn = pn + '.diff'
70 pn = pn + '.gz'
71 rel_pn = package.patch_dir + pn
72
73 os.rename(pn, rel_pn)
74 os.link(rel_pn, pn)
75