Bug 911154 - Better handle missing variables in application.ini when creating the corresponding header. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Sat, 31 Aug 2013 10:20:37 +0900
changeset 145146 c59d6e7fdee5310c270e82ecde0ed62fb8de1e80
parent 145145 7973c4b7cfd0678a8cd1b61c631bb65d725b943a
child 145147 587ec77a2373eb139f94141d76b6229f602ae5e4
push id33168
push usermh@glandium.org
push dateSat, 31 Aug 2013 01:23:55 +0000
treeherdermozilla-inbound@c59d6e7fdee5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs911154
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 911154 - Better handle missing variables in application.ini when creating the corresponding header. r=gps
build/appini_header.py
--- a/build/appini_header.py
+++ b/build/appini_header.py
@@ -22,16 +22,26 @@ def main(file):
     except: pass
     try:
         if config.getint('Crash Reporter', 'Enabled') == 1:
             flags.add('NS_XRE_ENABLE_CRASH_REPORTER')
     except: pass
     appdata = dict(("%s:%s" % (s, o), config.get(s, o)) for s in config.sections() for o in config.options(s))
     appdata['flags'] = ' | '.join(flags) if flags else '0'
     appdata['App:profile'] = '"%s"' % appdata['App:profile'] if 'App:profile' in appdata else 'NULL'
+    expected = ('App:vendor', 'App:name', 'App:version', 'App:buildid',
+                'App:id', 'Gecko:minversion', 'Gecko:maxversion')
+    missing = [var for var in expected if var not in appdata]
+    if missing:
+        print >>sys.stderr, \
+            "Missing values in %s: %s" % (file, ', '.join(missing))
+        sys.exit(1)
+
+    if not 'Crash Reporter:serverurl' in appdata:
+        appdata['Crash Reporter:serverurl'] = ''
 
     print '''#include "nsXREAppData.h"
              static const nsXREAppData sAppData = {
                  sizeof(nsXREAppData),
                  NULL, // directory
                  "%(App:vendor)s",
                  "%(App:name)s",
                  "%(App:version)s",