Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

mkdist script tweaks to support releasing from any named branch

  • Loading branch information...
commit 7f8cb93092640ead96b3da60a6fb8c42eb0c13d9 1 parent e2ff217
@wsfulton wsfulton authored
Showing with 11 additions and 5 deletions.
  1. +11 −5 Tools/mkdist.py
View
16 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 @@ def failed():
# 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 @@ def failed():
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 @@ def failed():
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"
Please sign in to comment.
Something went wrong with that request. Please try again.