| OLD | NEW |
| 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 compareVersions, Configuration, getSafa
riCertificateID | 34 from sitescripts.extensions.utils import ( |
| 35 compareVersions, Configuration, getSafariCertificateID, |
| 36 writeAndroidUpdateManifest) |
| 35 | 37 |
| 36 MAX_BUILDS = 50 | 38 MAX_BUILDS = 50 |
| 37 | 39 |
| 38 | 40 |
| 39 class NightlyBuild(object): | 41 class NightlyBuild(object): |
| 40 """ | 42 """ |
| 41 Performs the build process for an extension, | 43 Performs the build process for an extension, |
| 42 generating changelogs and documentation. | 44 generating changelogs and documentation. |
| 43 """ | 45 """ |
| 44 | 46 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 os.makedirs(baseDir) | 195 os.makedirs(baseDir) |
| 194 if self.config.type == 'chrome' or self.config.type == 'opera': | 196 if self.config.type == 'chrome' or self.config.type == 'opera': |
| 195 manifestPath = os.path.join(baseDir, "updates.xml") | 197 manifestPath = os.path.join(baseDir, "updates.xml") |
| 196 templateName = 'chromeUpdateManifest' | 198 templateName = 'chromeUpdateManifest' |
| 197 elif self.config.type == 'safari': | 199 elif self.config.type == 'safari': |
| 198 manifestPath = os.path.join(baseDir, "updates.plist") | 200 manifestPath = os.path.join(baseDir, "updates.plist") |
| 199 templateName = 'safariUpdateManifest' | 201 templateName = 'safariUpdateManifest' |
| 200 elif self.config.type == 'android': | 202 elif self.config.type == 'android': |
| 201 manifestPath = os.path.join(baseDir, "updates.xml") | 203 manifestPath = os.path.join(baseDir, "updates.xml") |
| 202 templateName = 'androidUpdateManifest' | 204 templateName = 'androidUpdateManifest' |
| 205 |
| 206 # ABP for Android used to have its own update manifest format. We need to |
| 207 # generate both that and the new one in the libadblockplus format as long |
| 208 # as a significant amount of users is on an old version. |
| 209 newManifestPath = os.path.join(baseDir, "update.json") |
| 210 writeAndroidUpdateManifest(newManifestPath, [{ |
| 211 'basename': self.basename, |
| 212 'version': self.version, |
| 213 'updateURL': self.updateURL |
| 214 }]) |
| 203 else: | 215 else: |
| 204 manifestPath = os.path.join(baseDir, "update.rdf") | 216 manifestPath = os.path.join(baseDir, "update.rdf") |
| 205 templateName = 'geckoUpdateManifest' | 217 templateName = 'geckoUpdateManifest' |
| 206 | 218 |
| 207 template = get_template(get_config().get('extensions', templateName)) | 219 template = get_template(get_config().get('extensions', templateName)) |
| 208 template.stream({'extensions': [self]}).dump(manifestPath) | 220 template.stream({'extensions': [self]}).dump(manifestPath) |
| 209 | 221 |
| 210 def writeIEUpdateManifest(self, versions): | 222 def writeIEUpdateManifest(self, versions): |
| 211 """ | 223 """ |
| 212 Writes update.json file for the latest IE build | 224 Writes update.json file for the latest IE build |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 except Exception, ex: | 504 except Exception, ex: |
| 493 print >>sys.stderr, "The build for %s failed:" % repo | 505 print >>sys.stderr, "The build for %s failed:" % repo |
| 494 traceback.print_exc() | 506 traceback.print_exc() |
| 495 | 507 |
| 496 file = open(nightlyConfigFile, 'wb') | 508 file = open(nightlyConfigFile, 'wb') |
| 497 nightlyConfig.write(file) | 509 nightlyConfig.write(file) |
| 498 | 510 |
| 499 | 511 |
| 500 if __name__ == '__main__': | 512 if __name__ == '__main__': |
| 501 main() | 513 main() |
| OLD | NEW |