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

Side by Side Diff: packager.py

Issue 29334723: Issue 3404 - Add platform name to devenv path (Closed)
Patch Set: Created Jan. 27, 2016, 1:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « build.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 Source Code Form is subject to the terms of the Mozilla Public 3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this 4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 6
7 # Note: These are the base functions common to all packagers, the actual 7 # Note: These are the base functions common to all packagers, the actual
8 # packagers are implemented in packagerGecko and packagerChrome. 8 # packagers are implemented in packagerGecko and packagerChrome.
9 9
10 import sys, os, re, codecs, subprocess, json, zipfile 10 import sys, os, re, codecs, subprocess, json, zipfile
11 from StringIO import StringIO 11 from StringIO import StringIO
12 from chainedconfigparser import ChainedConfigParser 12 from chainedconfigparser import ChainedConfigParser
13 13
14 import buildtools 14 import buildtools
15 15
16 def getDefaultFileName(metadata, version, ext): 16 def getDefaultFileName(metadata, version, ext):
17 return '%s-%s.%s' % (metadata.get('general', 'basename'), version, ext) 17 return '%s-%s.%s' % (metadata.get('general', 'basename'), version, ext)
18 18
19 def getMetadataPath(baseDir, type): 19 def getMetadataPath(baseDir, type):
20 return os.path.join(baseDir, 'metadata.%s' % type) 20 return os.path.join(baseDir, 'metadata.%s' % type)
21 21
22 def getDevEnvPath(baseDir): 22 def getDevEnvPath(baseDir, type):
23 return os.path.join(baseDir, 'devenv') 23 return os.path.join(baseDir, 'devenv.%s' % type)
Sebastian Noack 2016/01/27 14:16:49 Nit: We usually use + (instead %) if concatenating
kzar 2016/01/27 14:20:29 Done.
24 24
25 def readMetadata(baseDir, type): 25 def readMetadata(baseDir, type):
26 parser = ChainedConfigParser() 26 parser = ChainedConfigParser()
27 parser.optionxform = lambda option: option 27 parser.optionxform = lambda option: option
28 parser.read(getMetadataPath(baseDir, type)) 28 parser.read(getMetadataPath(baseDir, type))
29 return parser 29 return parser
30 30
31 def getBuildNum(baseDir): 31 def getBuildNum(baseDir):
32 try: 32 try:
33 from buildtools.ensure_dependencies import Mercurial, Git 33 from buildtools.ensure_dependencies import Mercurial, Git
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 names = self.keys() 128 names = self.keys()
129 names.sort(key=sortKey) 129 names.sort(key=sortKey)
130 for name in names: 130 for name in names:
131 zip.writestr(name, self[name]) 131 zip.writestr(name, self[name])
132 zip.close() 132 zip.close()
133 133
134 def zipToString(self, sortKey=None): 134 def zipToString(self, sortKey=None):
135 buffer = StringIO() 135 buffer = StringIO()
136 self.zip(buffer, sortKey=sortKey) 136 self.zip(buffer, sortKey=sortKey)
137 return buffer.getvalue() 137 return buffer.getvalue()
OLDNEW
« no previous file with comments | « build.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld