Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packagerGecko.py

Issue 9257092: More build tools improvements (Closed)
Patch Set: Created Jan. 25, 2013, 10:22 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packagerChrome.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerGecko.py
===================================================================
--- a/packagerGecko.py
+++ b/packagerGecko.py
@@ -120,30 +120,32 @@ def readLocaleMetadata(baseDir, locales)
data = SafeConfigParser()
data.optionxform = str
try:
result[locale] = localeTools.readFile(os.path.join(getLocalesDir(baseDir), locale, 'meta.properties'))
except:
result[locale] = {}
return result
-def getContributors(baseDir, metadata):
+def getContributors(metadata):
main = []
additional = set()
if metadata.has_section('contributors'):
options = metadata.options('contributors')
options.sort()
for option in options:
value = metadata.get('contributors', option)
if re.search(r'\D', option):
match = re.search(r'^\s*(\S+)\s+//([^/\s]+)/@(\S+)\s*$', value)
if not match:
print >>sys.stderr, 'Warning: unrecognized contributor location "%s"\n' % value
continue
- dom = minidom.parse(os.path.join(baseDir, match.group(1)))
+ baseDir = os.path.dirname(metadata.option_source('contributors', option))
+ parts = match.group(1).split('/')
+ dom = minidom.parse(os.path.join(baseDir, *parts))
tags = dom.getElementsByTagName(match.group(2))
for tag in tags:
if tag.hasAttribute(match.group(3)):
for name in re.split(r'\s*,\s*', tag.getAttribute(match.group(3))):
additional.add(name)
else:
main.append(value)
return main + sorted(additional, key=unicode.lower)
@@ -301,33 +303,33 @@ def createBuild(baseDir, outFile=None, l
locales = getLocales(baseDir, True)
metadata = readMetadata(baseDir)
version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum)
if outFile == None:
outFile = getDefaultFileName(baseDir, metadata, version, 'xpi')
- contributors = getContributors(baseDir, metadata)
+ contributors = getContributors(metadata)
params = {
'baseDir': baseDir,
'locales': locales,
'releaseBuild': releaseBuild,
'version': version.encode('utf-8'),
'metadata': metadata,
'contributors': contributors,
'multicompartment': multicompartment,
}
files = Files(getPackageFiles(params), getIgnoredFiles(params),
process=lambda path, data: processFile(path, data, params))
files['install.rdf'] = createManifest(params)
if metadata.has_section('mapping'):
- files.readMappedFiles(baseDir, metadata.items('mapping'))
+ files.readMappedFiles(metadata.items('mapping'))
files.read(baseDir, skip=('chrome'))
for name, path in getChromeSubdirs(baseDir, params['locales']).iteritems():
if os.path.isdir(path):
files.read(path, 'chrome/%s' % name)
fixupLocales(params, files)
if not 'bootstrap.js' in files:
addMissingFiles(params, files)
if keyFile:
« no previous file with comments | « packagerChrome.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld