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

Unified Diff: sitescripts/extensions/bin/createNightlies.py

Issue 9044061: Nightly builds: prepared for the change in the Chrome build process (Closed)
Patch Set: Replaced hg archive by hg clone Created Jan. 2, 2013, 7:36 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 | « .hgsubstate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/extensions/bin/createNightlies.py
===================================================================
--- a/sitescripts/extensions/bin/createNightlies.py
+++ b/sitescripts/extensions/bin/createNightlies.py
@@ -81,18 +81,20 @@ class NightlyBuild(object):
if change:
date, author, revision, description = change.split('\0')
yield {'date': date, 'author': author, 'revision': revision, 'description': description}
def copyRepository(self):
'''
Create a repository copy in a temporary directory
'''
+ # We cannot use hg archive here due to
+ # http://bz.selenic.com/show_bug.cgi?id=3747, have to clone properly :-(
self.tempdir = tempfile.mkdtemp(prefix=self.config.repositoryName)
- command = ['hg', 'archive', '-R', self.config.repository, '-r', 'default', self.tempdir]
+ command = ['hg', 'clone', '-q', self.config.repository, '-u', 'default', self.tempdir]
Felix Dahlke 2013/01/02 07:47:33 Are you sure "-u default" is necessary? Don't thin
Wladimir Palant 2013/01/02 08:13:04 Yes, it is absolutely necessary - otherwise Mercur
subprocess.Popen(command).communicate()
def writeChangelog(self, changes):
"""
write the changelog file into the cloned repository
"""
baseDir = os.path.join(self.config.nightliesDirectory, self.basename)
if not os.path.exists(baseDir):
@@ -144,45 +146,42 @@ class NightlyBuild(object):
self.version = '%s.%s' % (self.version, self.revision)
usesSdk = manifest.getElementsByTagName('uses-sdk')[0]
self.minSdkVersion = usesSdk.attributes["android:minSdkVersion"].value
self.basename = os.path.basename(self.config.repository)
def readChromeMetadata(self):
"""
- Read Chrome-specific metadata from manifest.json file. It will also
+ Read Chrome-specific metadata from metadata file. This will also
calculate extension ID from the private key.
"""
# Calculate extension ID from public key
# (see http://supercollider.dk/2010/01/calculating-chrome-extension-id-from-your-private-key-233)
import buildtools.packagerChrome as packager
Felix Dahlke 2013/01/02 07:47:33 Shouldn't this be "buildtools.packagerPorts" or so
Wladimir Palant 2013/01/02 08:13:04 No, not really. I doubt that we will ever have the
publicKey = packager.getPublicKey(self.config.keyFile)
hash = hashlib.sha256()
hash.update(publicKey)
self.extensionID = hash.hexdigest()[0:32]
self.extensionID = ''.join(map(lambda c: chr(97 + int(c, 16)), self.extensionID))
- # Now read manifest.json
- manifestFile = open(os.path.join(self.tempdir, 'manifest.json'), 'rb')
- manifest = json.load(manifestFile)
- manifestFile.close()
-
- self.version = manifest['version']
+ # Now read metadata file
+ metadata = packager.readMetadata(self.tempdir)
+ self.version = metadata.get("general", "version")
while self.version.count('.') < 2:
self.version += '.0'
self.version = '%s.%s' % (self.version, self.revision)
- self.basename = os.path.basename(self.config.repository)
+ self.basename = metadata.get("general", "basename")
if self.config.experimental:
self.basename += '-experimental'
self.compat = []
- if 'minimum_chrome_version' in manifest:
- self.compat.append({'id': 'chrome', 'minVersion': manifest['minimum_chrome_version']})
+ if metadata.has_section('compat') and metadata.has_option('compat', 'chrome'):
+ self.compat.append({'id': 'chrome', 'minVersion': metadata.get('compat', 'chrome')})
def writeUpdateManifest(self):
"""
Writes update.rdf file for the current build
"""
baseDir = os.path.join(self.config.nightliesDirectory, self.basename)
if not os.path.exists(baseDir):
os.makedirs(baseDir)
« no previous file with comments | « .hgsubstate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld