| Index: sitescripts/extensions/bin/createNightlies.py |
| =================================================================== |
| --- a/sitescripts/extensions/bin/createNightlies.py |
| +++ b/sitescripts/extensions/bin/createNightlies.py |
| @@ -25,13 +25,14 @@ |
| """ |
| -import sys, os, os.path, codecs, subprocess, ConfigParser, traceback, json, hashlib |
| +import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib |
| import tempfile, shutil, urlparse, pipes, time, urllib2, struct |
| from datetime import datetime |
| from urllib import urlencode |
| from xml.dom.minidom import parse as parseXml |
| from sitescripts.utils import get_config, setupStderr, get_template |
| -from sitescripts.extensions.utils import compareVersions, Configuration, getSafariCertificateID |
| +from sitescripts.extensions.utils import ( |
| + compareVersions, Configuration, getSafariCertificateID, writeIEUpdateManifest) |
| MAX_BUILDS = 50 |
| @@ -207,19 +208,6 @@ |
| template = get_template(get_config().get('extensions', templateName)) |
| template.stream({'extensions': [self]}).dump(manifestPath) |
| - def writeLibabpUpdateManifest(self, updates): |
| - """ |
| - Writes update.json file for libadblockplus |
| - """ |
| - baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
| - if not os.path.exists(baseDir): |
| - os.makedirs(baseDir) |
| - manifestPath = os.path.join(baseDir, "update.json") |
| - |
| - handle = codecs.open(manifestPath, "wb", encoding="UTF-8") |
| - json.dump(updates, handle, ensure_ascii=False, indent=2, separators=(",", ": ")) |
| - handle.close() |
| - |
| def writeIEUpdateManifest(self, versions): |
| """ |
| Writes update.json file for the latest IE build |
| @@ -228,23 +216,19 @@ |
| return |
| version = versions[0] |
| - packageName = self.basename + '-' + versions[0] + self.config.packageSuffix |
| + packageName = self.basename + '-' + version + self.config.packageSuffix |
| updateURL = urlparse.urljoin(self.config.nightliesURL, self.basename + '/' + packageName + '?update') |
| - self.writeLibabpUpdateManifest({ |
| - "%s/%s" % (self.basename, "msie64"): { |
| - "url": updateURL.replace(".exe", "-x64.msi"), |
| - "version": version, |
| - }, |
| - "%s/%s" % (self.basename, "msie32"): { |
| - "url": updateURL.replace(".exe", "-x86.msi"), |
| - "version": version, |
| - }, |
| - }) |
| + baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
| + manifestPath = os.path.join(baseDir, 'update.json') |
| + writeIEUpdateManifest(manifestPath, [{ |
|
Felix Dahlke
2014/07/29 15:10:27
Not brilliant that this function has the same name
Wladimir Palant
2014/07/30 14:02:23
Don't import the function globally but only in thi
Felix Dahlke
2014/07/30 14:22:36
Yeah, I like that. Done.
|
| + 'basename': self.basename, |
| + 'version': version, |
| + 'updateURL': updateURL |
| + }]) |
| - baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
| for suffix in (self.config.packageSuffix, self.config.packageSuffix.replace("-x64", "-x86")): |
| linkPath = os.path.join(baseDir, '00latest%s' % suffix) |
| - outputPath = os.path.join(baseDir, self.basename + '-' + versions[0] + suffix) |
| + outputPath = os.path.join(baseDir, self.basename + '-' + version + suffix) |
| if hasattr(os, 'symlink'): |
| if os.path.exists(linkPath): |
| os.remove(linkPath) |
| @@ -252,7 +236,6 @@ |
| else: |
| shutil.copyfile(outputPath, linkPath) |
| - |
| def build(self): |
| """ |
| run the build command in the tempdir |