| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 # coding: utf-8 | 1 # coding: utf-8 |
| 2 | 2 |
| 3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
| 4 # Copyright (C) 2006-2014 Eyeo GmbH | 4 # Copyright (C) 2006-2014 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, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 with changelogs and documentation. | 24 with changelogs and documentation. |
| 25 | 25 |
| 26 """ | 26 """ |
| 27 | 27 |
| 28 import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib | 28 import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib |
| 29 import tempfile, shutil, urlparse, pipes, time, urllib2, struct | 29 import tempfile, shutil, urlparse, pipes, time, urllib2, struct |
| 30 from datetime import datetime | 30 from datetime import datetime |
| 31 from urllib import urlencode | 31 from urllib import urlencode |
| 32 from xml.dom.minidom import parse as parseXml | 32 from xml.dom.minidom import parse as parseXml |
| 33 from sitescripts.utils import get_config, setupStderr, get_template | 33 from sitescripts.utils import get_config, setupStderr, get_template |
| 34 from sitescripts.extensions.utils import ( | 34 from sitescripts.extensions.utils import compareVersions, Configuration, getSafa riCertificateID |
| 35 compareVersions, Configuration, getSafariCertificateID, writeIEUpdateManifest) | |
| 36 | 35 |
| 37 MAX_BUILDS = 50 | 36 MAX_BUILDS = 50 |
| 38 | 37 |
| 39 | 38 |
| 40 class NightlyBuild(object): | 39 class NightlyBuild(object): |
| 41 """ | 40 """ |
| 42 Performs the build process for an extension, | 41 Performs the build process for an extension, |
| 43 generating changelogs and documentation. | 42 generating changelogs and documentation. |
| 44 """ | 43 """ |
| 45 | 44 |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 Writes update.json file for the latest IE build | 212 Writes update.json file for the latest IE build |
| 214 """ | 213 """ |
| 215 if len(versions) == 0: | 214 if len(versions) == 0: |
| 216 return | 215 return |
| 217 | 216 |
| 218 version = versions[0] | 217 version = versions[0] |
| 219 packageName = self.basename + '-' + version + self.config.packageSuffix | 218 packageName = self.basename + '-' + version + self.config.packageSuffix |
| 220 updateURL = urlparse.urljoin(self.config.nightliesURL, self.basename + '/' + packageName + '?update') | 219 updateURL = urlparse.urljoin(self.config.nightliesURL, self.basename + '/' + packageName + '?update') |
| 221 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) | 220 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
| 222 manifestPath = os.path.join(baseDir, 'update.json') | 221 manifestPath = os.path.join(baseDir, 'update.json') |
| 223 writeIEUpdateManifest(manifestPath, [{ | 222 |
|
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.
| |
| 223 from sitescripts.extensions.utils import writeIEUpdateManifest as doWrite | |
| 224 doWrite(manifestPath, [{ | |
| 224 'basename': self.basename, | 225 'basename': self.basename, |
| 225 'version': version, | 226 'version': version, |
| 226 'updateURL': updateURL | 227 'updateURL': updateURL |
| 227 }]) | 228 }]) |
| 228 | 229 |
| 229 for suffix in (self.config.packageSuffix, self.config.packageSuffix.replace( "-x64", "-x86")): | 230 for suffix in (self.config.packageSuffix, self.config.packageSuffix.replace( "-x64", "-x86")): |
| 230 linkPath = os.path.join(baseDir, '00latest%s' % suffix) | 231 linkPath = os.path.join(baseDir, '00latest%s' % suffix) |
| 231 outputPath = os.path.join(baseDir, self.basename + '-' + version + suffix) | 232 outputPath = os.path.join(baseDir, self.basename + '-' + version + suffix) |
| 232 if hasattr(os, 'symlink'): | 233 if hasattr(os, 'symlink'): |
| 233 if os.path.exists(linkPath): | 234 if os.path.exists(linkPath): |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 491 except Exception, ex: | 492 except Exception, ex: |
| 492 print >>sys.stderr, "The build for %s failed:" % repo | 493 print >>sys.stderr, "The build for %s failed:" % repo |
| 493 traceback.print_exc() | 494 traceback.print_exc() |
| 494 | 495 |
| 495 file = open(nightlyConfigFile, 'wb') | 496 file = open(nightlyConfigFile, 'wb') |
| 496 nightlyConfig.write(file) | 497 nightlyConfig.write(file) |
| 497 | 498 |
| 498 | 499 |
| 499 if __name__ == '__main__': | 500 if __name__ == '__main__': |
| 500 main() | 501 main() |
| LEFT | RIGHT |