Fix mac builddate-unifying logic from bug 383167
authorbenjamin@smedbergs.us
Mon, 25 Jun 2007 10:58:21 -0700
changeset 2762 37bda238f8dcee75933386c4399ab7c0d06eafc2
parent 2761 86b579570bb6c7ae1e6fb263977c95a4db5550be
child 2763 5a3de289ce7ffb72008cfca39a2f6728a042d23b
push idunknown
push userunknown
push dateunknown
bugs383167
milestone1.9a6pre
Fix mac builddate-unifying logic from bug 383167
client.mk
toolkit/xre/make-platformini.py
--- a/client.mk
+++ b/client.mk
@@ -452,16 +452,17 @@ endif
 
 AUTOCONF := autoconf
 MKDIR := mkdir
 SH := /bin/sh
 ifndef MAKE
 MAKE := gmake
 endif
 PERL ?= perl
+PYTHON ?= python
 
 CONFIG_GUESS_SCRIPT := $(wildcard $(TOPSRCDIR)/build/autoconf/config.guess)
 ifdef CONFIG_GUESS_SCRIPT
   CONFIG_GUESS = $(shell $(CONFIG_GUESS_SCRIPT))
 else
   _IS_FIRST_CHECKOUT := 1
 endif
 
@@ -935,17 +936,17 @@ else
 # After First Checkout
 
 #####################################################
 # Build date unification
 
 ifdef MOZ_UNIFY_BDATE
 ifndef MOZ_BUILD_DATE
 ifdef MOZ_BUILD_PROJECTS
-MOZ_BUILD_DATE = $(shell $(PERL) -I$(TOPSRCDIR)/config $(TOPSRCDIR)/config/bdate.pl)
+MOZ_BUILD_DATE = $(shell $(PYTHON) $(TOPSRCDIR)/toolkit/xre/make-platformini.py --print-buildid)
 export MOZ_BUILD_DATE
 endif
 endif
 endif
 
 #####################################################
 # Preflight, before building any project
 
--- a/toolkit/xre/make-platformini.py
+++ b/toolkit/xre/make-platformini.py
@@ -1,21 +1,31 @@
 #!/usr/bin/python
 
 from optparse import OptionParser
 from datetime import datetime
 import sys
+import os
 
-(milestoneFile,) = sys.argv[1:]
+o = OptionParser()
+o.add_option("--print-buildid", action="store_true", dest="print_buildid")
+
+(options, args) = o.parse_args()
+buildid = os.environ.get('MOZ_BUILD_DATE', datetime.now().strftime('%Y%m%d%H'))
 
+if options.print_buildid:
+    print buildid
+    sys.exit(0)
+
+(milestoneFile,) = args
 for line in open(milestoneFile, 'r'):
     if line[0] == '#':
         continue
 
     line = line.strip()
     if line == '':
         continue
 
     milestone = line
 
 print """[Build]
 BuildID=%s
-Milestone=%s""" % (datetime.now().strftime('%Y%m%d%H'), milestone)
+Milestone=%s""" % (buildid, milestone)