bug 475618, xulrunner's platform.ini should include repo and sourcestamp, r=bsmedberg
authorAxel Hecht <l10n@mozilla.com>
Mon, 16 Feb 2009 14:32:39 +0100
changeset 25036 566e513f5bcd1391d227611dc19c2871818020a2
parent 25035 5953efc48779883d396022e960cb60f4ef0f7fc6
child 25037 f39d15c0b15e7c9799b399734a9546e41f2eebc9
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs475618
milestone1.9.2a1pre
bug 475618, xulrunner's platform.ini should include repo and sourcestamp, r=bsmedberg
toolkit/xre/Makefile.in
toolkit/xre/make-platformini.py
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -248,18 +248,34 @@ DEFINES		+= -DWRAP_SYSTEM_INCLUDES
 endif
 
 ifeq ($(OS_ARCH),Linux)
 ifneq (,$(findstring lib64,$(libdir)))
 DEFINES     += -DHAVE_USR_LIB64_DIR
 endif
 endif
 
+SOURCE_STAMP := $(shell cd $(topsrcdir) && hg identify 2>/dev/null | cut -f1 -d' ')
+# strip a trailing slash from the repo URL because it's not always present,
+# and we want to construct a working URL in buildconfig.html
+# make+shell+sed = awful
+_dollar=$$
+SOURCE_REPO := $(shell cd $(topsrcdir) && hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" -e "s/\/$(_dollar)//" )
+
+ifdef SOURCE_STAMP
+INIARGS = --sourcestamp=$(SOURCE_STAMP)
+# extra sanity check for old versions of hg
+# that don't support showconfig
+ifeq (http,$(patsubst http%,http,$(SOURCE_REPO)))
+INIARGS += --sourcerepo=$(SOURCE_REPO)
+endif
+endif
+
 platform.ini: FORCE
-	$(PYTHON) $(srcdir)/make-platformini.py --buildid=$(shell cat $(DEPTH)/config/buildid) $(topsrcdir)/config/milestone.txt > $@
+	$(PYTHON) $(srcdir)/make-platformini.py --buildid=$(shell cat $(DEPTH)/config/buildid) $(INIARGS) $(topsrcdir)/config/milestone.txt > $@
 
 GARBAGE += platform.ini
 
 libs:: platform.ini
 	$(INSTALL) $^ $(DIST)/bin
 
 install::
 	$(INSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)
--- a/toolkit/xre/make-platformini.py
+++ b/toolkit/xre/make-platformini.py
@@ -3,16 +3,18 @@
 from optparse import OptionParser
 from datetime import datetime
 import sys
 import os
 
 o = OptionParser()
 o.add_option("--buildid", dest="buildid")
 o.add_option("--print-buildid", action="store_true", dest="print_buildid")
+o.add_option("--sourcestamp", dest="sourcestamp")
+o.add_option("--sourcerepo", dest="sourcerepo")
 
 (options, args) = o.parse_args()
 
 if options.print_buildid:
     print datetime.now().strftime('%Y%m%d%H%M%S')
     sys.exit(0)
 
 if not options.buildid:
@@ -28,8 +30,12 @@ for line in open(milestoneFile, 'r'):
     if line == '':
         continue
 
     milestone = line
 
 print """[Build]
 BuildID=%s
 Milestone=%s""" % (options.buildid, milestone)
+if options.sourcestamp:
+    print "SourceStamp=%s" % options.sourcestamp
+if options.sourcerepo:
+    print "SourceRepository=%s" % options.sourcerepo