Index: packagerGecko.py |
=================================================================== |
--- a/packagerGecko.py |
+++ b/packagerGecko.py |
@@ -187,30 +187,33 @@ def fixupLocales(params, files): |
else: |
files[path] = reference[file]['_origData'].encode('utf-8') |
def addMissingFiles(params, files): |
templateData = { |
'hasChrome': False, |
'hasChromeRequires': False, |
'hasShutdownHandlers': False, |
+ 'hasXMLHttpRequest': False, |
'hasVersionPref': False, |
'chromeWindows': [], |
'requires': {}, |
'metadata': params['metadata'], |
'multicompartment': params['multicompartment'], |
'applications': dict((v, k) for k, v in KNOWN_APPS.iteritems()), |
} |
def checkScript(name): |
content = files[name] |
for match in re.finditer(r'(?:^|\s)require\(\s*"([\w\-]+)"\s*\)', content): |
templateData['requires'][match.group(1)] = True |
if name.startswith('chrome/content/'): |
templateData['hasChromeRequires'] = True |
+ if name.startswith('lib/') and re.search(r'\bXMLHttpRequest\b', content): |
+ templateData['hasXMLHttpRequest'] = True |
if name == 'defaults/prefs.js': |
if re.search(r'\.currentVersion"', content): |
templateData['hasVersionPref'] = True |
if not '/' in name or name.startswith('lib/'): |
if re.search(r'(?:^|\s)onShutdown\.', content): |
templateData['hasShutdownHandlers'] = True |
for name, content in files.iteritems(): |