summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaul Cuza <raulcuza@gmail.com>2011-07-07 10:24:09 -0400
committerRaul Cuza <raulcuza@gmail.com>2011-07-07 10:25:28 -0400
commitddbaad0ea618ce3bfd92db2cedc25ccc75a10f13 (patch)
treea81f11e533ab15bef0802beedcc40d01213e3d97
parent32ed613f486bc379d9c5edbab79c181eb87d1ee6 (diff)
downloadbcfg2-ddbaad0ea618ce3bfd92db2cedc25ccc75a10f13.tar.gz
bcfg2-ddbaad0ea618ce3bfd92db2cedc25ccc75a10f13.tar.bz2
bcfg2-ddbaad0ea618ce3bfd92db2cedc25ccc75a10f13.zip
Add verification that version_info['micro'] is a single digit.
Because of restrictions in Mac OS X packaging, Bcfg2's Micro and Minor version numbers must be combined into an integer in the OS X package (IFMinorVersion attribute). In order for this to work, the micro version must be an integer, otherwise we'll run into cases where theĀ· IFMinorVersion will not be in sequence with the Bcfg2 Micro and Minor versions.
-rw-r--r--osx/Makefile2
-rwxr-xr-xtools/export.py25
2 files changed, 15 insertions, 12 deletions
diff --git a/osx/Makefile b/osx/Makefile
index 4bca85582..de2d75402 100644
--- a/osx/Makefile
+++ b/osx/Makefile
@@ -31,7 +31,7 @@ SITELIBDIR = /Library/Python/${PYVERSION}/site-packages
# integers (e.g. "1" and "00" for bcfg2 version 1.0.0.
BCFGVER = 1.2.0pre3
MAJOR = 1
-MINOR = 2.0
+MINOR = 20
default: clean client
diff --git a/tools/export.py b/tools/export.py
index fa75686b6..b1c4d0ecb 100755
--- a/tools/export.py
+++ b/tools/export.py
@@ -97,24 +97,27 @@ def main(argv=None):
vkeys = ["major", "minor", "microbuild"]
try:
version_info = dict(zip(vkeys,version.split(".")))
- if not version_info["major"].isdigit() or not version_info["minor"].isdigit():
+ version_info["micro"] = version_info["microbuild"][0:1]
+ version_info["build"] = version_info["microbuild"][1:]
+ version_release = "%s.%s.%s" % (version_info['major'], version_info['minor'], version_info['micro'])
+
+ if options.debug:
+ print "version is %s" % version
+ print "version_info is %s" % version_info
+ print "version_release is %s" % version_release
+
+ if not version_info["major"].isdigit() or not version_info["minor"].isdigit() or not version_info["micro"]:
raise VersionError('isdigit() test failed')
+ if version_info["micro"] > 1:
+ raise VersionError('micro must be single digit because IFMinorVersion restrictions in Mac OS X Packaging')
except:
print """Version must be of the form Major.Minor.MicroBuild,
where Major and Minor are integers and
Micro is a single digit optionally followed by Build (i.e. pre##)
E.G. 1.2.0pre1 is a valid version.
- """
+"""
quit()
- version_info["micro"] = version_info["microbuild"][0:1]
- version_info["build"] = version_info["microbuild"][1:]
- version_release = "%s.%s.%s" % (version_info['major'], version_info['minor'], version_info['micro'])
-
- if options.debug:
- print "version is %s" % version
- print "version_info is %s" % version_info
- print "version_release is %s" % version_release
tarname = '/tmp/%s-%s.tar.gz' % (pkgname, version)
@@ -199,7 +202,7 @@ E.G. 1.2.0pre1 is a valid version.
startswith=True,
dryrun=options.dryrun)
find_and_replace('osx/Makefile', 'MINOR =',
- 'MINOR = %s.%s\n' % (version_info['minor'], version_info['micro']),
+ 'MINOR = %s%s\n' % (version_info['minor'], version_info['micro']),
startswith=True,
dryrun=options.dryrun)