summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2014-02-08 11:08:56 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2014-02-08 11:08:56 +0000
commit3cf3be24abd8f5cf696c9eaf2d9d58785f05cf8a (patch)
tree9a866a28dae262090428c42c8fce5e4625a5e532 /Tools
parent98364d46daae716cc3c046c8235cb3fecf6fb3c9 (diff)
downloadswig-3cf3be24abd8f5cf696c9eaf2d9d58785f05cf8a.tar.gz
mkdist script tweaks to support releasing from any named branch
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/mkdist.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/Tools/mkdist.py b/Tools/mkdist.py
index 234c768f2..2e69dbece 100755
--- a/Tools/mkdist.py
+++ b/Tools/mkdist.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# This script builds a swig-x.y.z distribution.
-# Usage : mkdist.py version, where version should be x.y.z
+# Usage: mkdist.py version branch, where version should be x.y.z and branch is normally 'master'
import sys
import string
@@ -16,10 +16,16 @@ def failed():
try:
version = sys.argv[1]
dirname = "swig-" + version
+ branch = sys.argv[2]
except:
- print "Usage: mkdist.py version, where version should be x.y.z"
+ print "Usage: mkdist.py version branch, where version should be x.y.z and branch is normally 'master'"
sys.exit(1)
+if sys.version_info[0:2] < (2, 7):
+ print "Error: Python 2.7 is required"
+ sys.exit(3)
+
+
# Check name matches normal unix conventions
if string.lower(dirname) != dirname:
print "directory name ("+dirname+") should be in lowercase"
@@ -38,7 +44,7 @@ os.system("rm -f "+dirname+".tar")
# Grab the code from git
print "Checking git repository is in sync with remote repository"
-os.system("git remote update") == 0 or failed()
+os.system("git remote update origin") == 0 or failed()
command = ["git", "status", "--porcelain", "-uno"]
out = subprocess.check_output(command)
if out.strip() != "":
@@ -47,7 +53,7 @@ if out.strip() != "":
print out
sys.exit(3)
-command = ["git", "log", "--oneline", "master..origin/master"]
+command = ["git", "log", "--oneline", branch + "..origin/" + branch]
out = subprocess.check_output(command)
if out.strip() != "":
print "Remote repository has additional modifications to local repository"
@@ -55,7 +61,7 @@ if out.strip() != "":
print out
sys.exit(3)
-command = ["git", "log", "--oneline", "origin/master..master"]
+command = ["git", "log", "--oneline", "origin/" + branch + ".." + branch]
out = subprocess.check_output(command)
if out.strip() != "":
print "Local repository has modifications not pushed to the remote repository"