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

Side by Side Diff: packagerGecko.py

Issue 9259023: Use platform-dependent metadata files to allow multiple builds from the same repository (Closed)
Patch Set: Created Jan. 25, 2013, 7:13 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« packagerChrome.py ('K') | « packagerChrome.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus build tools, 3 # This file is part of the Adblock Plus build tools,
4 # Copyright (C) 2006-2012 Eyeo GmbH 4 # Copyright (C) 2006-2012 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details. 13 # GNU General Public License for more details.
14 # 14 #
15 # You should have received a copy of the GNU General Public License 15 # You should have received a copy of the GNU General Public License
16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
17 17
18 import os, sys, re, hashlib, base64, urllib, json 18 import os, sys, re, hashlib, base64, urllib, json
19 from ConfigParser import SafeConfigParser 19 from ConfigParser import SafeConfigParser
20 from StringIO import StringIO 20 from StringIO import StringIO
21 import xml.dom.minidom as minidom 21 import xml.dom.minidom as minidom
22 import buildtools.localeTools as localeTools 22 import buildtools.localeTools as localeTools
23 23
24 from packager import getDefaultFileName, readMetadata, getBuildVersion, getTempl ate, Files 24 import packager
25 from packager import getDefaultFileName, getBuildVersion, getTemplate, Files
25 26
26 KNOWN_APPS = { 27 KNOWN_APPS = {
27 'conkeror': '{a79fe89b-6662-4ff4-8e88-09950ad4dfde}', 28 'conkeror': '{a79fe89b-6662-4ff4-8e88-09950ad4dfde}',
28 'emusic': 'dlm@emusic.com', 29 'emusic': 'dlm@emusic.com',
29 'fennec': '{a23983c0-fd0e-11dc-95ff-0800200c9a66}', 30 'fennec': '{a23983c0-fd0e-11dc-95ff-0800200c9a66}',
30 'fennec2': '{aa3c5121-dab2-40e2-81ca-7ea25febc110}', 31 'fennec2': '{aa3c5121-dab2-40e2-81ca-7ea25febc110}',
31 'firefox': '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}', 32 'firefox': '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}',
32 'midbrowser': '{aa5ca914-c309-495d-91cf-3141bbb04115}', 33 'midbrowser': '{aa5ca914-c309-495d-91cf-3141bbb04115}',
33 'prism': 'prism@developer.mozilla.org', 34 'prism': 'prism@developer.mozilla.org',
34 'seamonkey': '{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}', 35 'seamonkey': '{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}',
35 'songbird': 'songbird@songbirdnest.com', 36 'songbird': 'songbird@songbirdnest.com',
36 'thunderbird': '{3550f703-e582-4d05-9a08-453d09bdfdc6}', 37 'thunderbird': '{3550f703-e582-4d05-9a08-453d09bdfdc6}',
37 'toolkit': 'toolkit@mozilla.org', 38 'toolkit': 'toolkit@mozilla.org',
38 } 39 }
39 40
40 defaultLocale = 'en-US' 41 defaultLocale = 'en-US'
41 42
43 def getMetadataPath(baseDir):
44 return packager.getMetadataPath(baseDir, 'gecko')
45
46 def readMetadata(baseDir):
47 return packager.readMetadata(baseDir, 'gecko')
48
42 def getChromeDir(baseDir): 49 def getChromeDir(baseDir):
43 return os.path.join(baseDir, 'chrome') 50 return os.path.join(baseDir, 'chrome')
44 51
45 def getLocalesDir(baseDir): 52 def getLocalesDir(baseDir):
46 return os.path.join(getChromeDir(baseDir), 'locale') 53 return os.path.join(getChromeDir(baseDir), 'locale')
47 54
48 def getChromeSubdirs(baseDir, locales): 55 def getChromeSubdirs(baseDir, locales):
49 result = {} 56 result = {}
50 chromeDir = getChromeDir(baseDir) 57 chromeDir = getChromeDir(baseDir)
51 for subdir in ('content', 'skin'): 58 for subdir in ('content', 'skin'):
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 if not 'bootstrap.js' in files: 331 if not 'bootstrap.js' in files:
325 addMissingFiles(params, files) 332 addMissingFiles(params, files)
326 if keyFile: 333 if keyFile:
327 signFiles(files, keyFile) 334 signFiles(files, keyFile)
328 files.zip(outFile, sortKey=lambda x: '!' if x == 'META-INF/zigbert.rsa' else x ) 335 files.zip(outFile, sortKey=lambda x: '!' if x == 'META-INF/zigbert.rsa' else x )
329 336
330 def autoInstall(baseDir, host, port, multicompartment=False): 337 def autoInstall(baseDir, host, port, multicompartment=False):
331 fileBuffer = StringIO() 338 fileBuffer = StringIO()
332 createBuild(baseDir, outFile=fileBuffer, multicompartment=multicompartment) 339 createBuild(baseDir, outFile=fileBuffer, multicompartment=multicompartment)
333 urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue()) 340 urllib.urlopen('http://%s:%s/' % (host, port), data=fileBuffer.getvalue())
OLDNEW
« packagerChrome.py ('K') | « packagerChrome.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld