diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-06-04 15:50:03 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-06-04 15:50:03 +0200 |
commit | e3b7744bee37c3d4a026d2193bed5e9439c40ff3 (patch) | |
tree | f3f7b07ca9bd78bf7ac2d76dd55b61b2a8bb549e /application/basilisk/app/macversion.py | |
parent | cbce4f0b6a337f8250b62cae028f1c6d4cce51df (diff) | |
parent | 031afcafe288bf0f46c0c5caae20dd3db8bd0297 (diff) | |
download | UXP-e3b7744bee37c3d4a026d2193bed5e9439c40ff3.tar UXP-e3b7744bee37c3d4a026d2193bed5e9439c40ff3.tar.gz UXP-e3b7744bee37c3d4a026d2193bed5e9439c40ff3.tar.lz UXP-e3b7744bee37c3d4a026d2193bed5e9439c40ff3.tar.xz UXP-e3b7744bee37c3d4a026d2193bed5e9439c40ff3.zip |
Merge branch 'move-basilisk'
Diffstat (limited to 'application/basilisk/app/macversion.py')
-rw-r--r-- | application/basilisk/app/macversion.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/application/basilisk/app/macversion.py b/application/basilisk/app/macversion.py new file mode 100644 index 000000000..839aac1ff --- /dev/null +++ b/application/basilisk/app/macversion.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + + +from optparse import OptionParser +import sys +import re + +o = OptionParser() +o.add_option("--buildid", dest="buildid") +o.add_option("--version", dest="version") + +(options, args) = o.parse_args() + +if not options.buildid: + print >>sys.stderr, "--buildid is required" + sys.exit(1) + +if not options.version: + print >>sys.stderr, "--version is required" + sys.exit(1) + +# We want to build a version number that matches the format allowed for +# CFBundleVersion (nnnnn[.nn[.nn]]). We'll incorporate both the version +# number as well as the date, so that it changes at least daily (for nightly +# builds), but also so that newly-built older versions (e.g. beta build) aren't +# considered "newer" than previously-built newer versions (e.g. a trunk nightly) + +define, MOZ_BUILDID, buildid = open(options.buildid, 'r').read().split() + +# extract only the major version (i.e. "14" from "14.0b1") +majorVersion = re.match(r'^(\d+)[^\d].*', options.version).group(1) +# last two digits of the year +twodigityear = buildid[2:4] +month = buildid[4:6] +if month[0] == '0': + month = month[1] +day = buildid[6:8] +if day[0] == '0': + day = day[1] + +print '%s.%s.%s' % (majorVersion + twodigityear, month, day) |