annotate lib/swig/swigwin-2.0.11/Tools/mkrelease.py @ 1983:5cd26f2c6904

small fix
author Ritor1
date Fri, 01 Nov 2013 17:29:49 +0600
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 #!/usr/bin/env python
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 # This script builds the SWIG source tarball, creates the Windows executable and the Windows zip package
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 # and uploads them both to SF ready for release. Also uploaded are the release notes.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 import sys
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 import string
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 import os
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 def failed(message):
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 if message == "":
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 print "mkrelease.py failed to complete"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 else:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 print message
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 sys.exit(2)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 try:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 version = sys.argv[1]
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 username = sys.argv[2]
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 except:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 print "Usage: python mkrelease.py version username"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 print "where version should be x.y.z and username is your SF username"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 sys.exit(1)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 print "Looking for rsync"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 os.system("which rsync") and failed("rsync not installed/found. Please install.")
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 print "Making source tarball"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 os.system("python ./mkdist.py " + version) and failed("")
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 print "Build Windows package"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 os.system("./mkwindows.sh " + version) and failed("")
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 print "Uploading to SourceForge"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 swig_dir_sf = username + ",swig@frs.sourceforge.net:/home/frs/project/s/sw/swig/swig/swig-" + version + "/"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 swigwin_dir_sf = username + ",swig@frs.sourceforge.net:/home/frs/project/s/sw/swig/swigwin/swigwin-" + version + "/"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 # If a file with 'readme' in the name exists in the same folder as the zip/tarball, it gets automatically displayed as the release notes by SF
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 full_readme_file = "readme-" + version + ".txt"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 os.system("rm -f " + full_readme_file)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 os.system("cat swig-" + version + "/README " + "swig-" + version + "/CHANGES.current " + "swig-" + version + "/RELEASENOTES " + "> " + full_readme_file)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 os.system("rsync --archive --verbose -P --times -e ssh " + "swig-" + version + ".tar.gz " + full_readme_file + " " + swig_dir_sf) and failed("")
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 os.system("rsync --archive --verbose -P --times -e ssh " + "swigwin-" + version + ".zip " + full_readme_file + " " + swigwin_dir_sf) and failed("")
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 print "Finished"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 print "Now log in to SourceForge and set the operating systems applicable to the newly uploaded tarball and zip file. Also remember to do a 'git push'."