Bug 911154 - Better handle missing variables in application.ini when creating the corresponding header. r=gps

This commit is contained in:
Mike Hommey 2013-08-31 10:20:37 +09:00
parent ab59271e68
commit d64662a2b0

View File

@ -27,6 +27,16 @@ def main(file):
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 = {