summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-01-11 08:45:26 -0500
committerMatt A. Tobin <email@mattatobin.com>2020-01-11 08:45:26 -0500
commit92aa5942f31ebb0acb61e1b33e0e99a440e1e279 (patch)
tree6b0692074313c8d89bf2ad5ce6716f990c733619 /build
parent0f5fa59607b2cd65adafa8894c665f6db60eb060 (diff)
downloadaura-central-92aa5942f31ebb0acb61e1b33e0e99a440e1e279.tar.gz
Add the ability to get an msbuild from an arbitrary date to version2k
Diffstat (limited to 'build')
-rw-r--r--build/version2k.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/build/version2k.py b/build/version2k.py
index 8ecbd60eb..7e2e3f30b 100644
--- a/build/version2k.py
+++ b/build/version2k.py
@@ -7,6 +7,7 @@ import argparse
moduleOptionParser = argparse.ArgumentParser()
moduleOptionParser.add_argument("--version", "-v", dest="version", nargs="*")
moduleOptionParser.add_argument("--msbuild", "-b", dest="msbuild", action="store_true")
+moduleOptionParser.add_argument("--msbuilddate", "-bd", dest="msbuilddate")
moduleOptionParser.add_argument("--msdate", "-d", dest="msdate", type=int)
moduleOptionParser.add_argument("--edate", "-e", dest="edate", action="store_true")
moduleOptionParser.add_argument("--edateonly", "-ed", dest="edateonly", action="store_true")
@@ -44,6 +45,16 @@ if args.msdate:
print date(2000,01,01)+timedelta(days=args.msdate)
sys.exit(0)
+if args.msbuilddate:
+ if '-' in args.msbuilddate:
+ print (datetime.strptime(args.msbuilddate, '%Y-%m-%d').date()-date(2000,01,01)).days
+ elif '/' in args.msbuilddate:
+ print (datetime.strptime(args.msbuilddate, '%Y/%m/%d').date()-date(2000,01,01)).days
+ else:
+ print (datetime.strptime(args.msbuilddate, '%Y%m%d').date()-date(2000,01,01)).days
+ sys.exit(0)
+
+
if args.edate:
print datetime.utcnow().strftime('%Y%m%d.%H%M')
sys.exit(0)