| 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-2016 Eyeo GmbH | 4 # Copyright (C) 2006-2016 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 self.certificateID = packager.get_developer_identifier(certs) | 214 self.certificateID = packager.get_developer_identifier(certs) |
| 215 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self.
revision) | 215 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self.
revision) |
| 216 self.shortVersion = metadata.get("general", "version") | 216 self.shortVersion = metadata.get("general", "version") |
| 217 self.basename = metadata.get("general", "basename") | 217 self.basename = metadata.get("general", "basename") |
| 218 self.updatedFromGallery = False | 218 self.updatedFromGallery = False |
| 219 | 219 |
| 220 def writeUpdateManifest(self): | 220 def writeUpdateManifest(self): |
| 221 """ | 221 """ |
| 222 Writes update.rdf file for the current build | 222 Writes update.rdf file for the current build |
| 223 """ | 223 """ |
| 224 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
| 224 if self.config.type == 'safari': | 225 if self.config.type == 'safari': |
| 225 manifestPath = os.path.join(baseDir, "updates.plist") | 226 manifestPath = os.path.join(baseDir, "updates.plist") |
| 226 templateName = 'safariUpdateManifest' | 227 templateName = 'safariUpdateManifest' |
| 227 elif self.config.type == 'android': | 228 elif self.config.type == 'android': |
| 228 manifestPath = os.path.join(baseDir, "updates.xml") | 229 manifestPath = os.path.join(baseDir, "updates.xml") |
| 229 templateName = 'androidUpdateManifest' | 230 templateName = 'androidUpdateManifest' |
| 230 else: | 231 else: |
| 231 return | 232 return |
| 232 | 233 |
| 233 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) | |
| 234 if not os.path.exists(baseDir): | 234 if not os.path.exists(baseDir): |
| 235 os.makedirs(baseDir) | 235 os.makedirs(baseDir) |
| 236 | 236 |
| 237 # ABP for Android used to have its own update manifest format. We need to | 237 # ABP for Android used to have its own update manifest format. We need to |
| 238 # generate both that and the new one in the libadblockplus format as long | 238 # generate both that and the new one in the libadblockplus format as long |
| 239 # as a significant amount of users is on an old version. | 239 # as a significant amount of users is on an old version. |
| 240 if self.config.type == 'android': | 240 if self.config.type == 'android': |
| 241 newManifestPath = os.path.join(baseDir, "update.json") | 241 newManifestPath = os.path.join(baseDir, "update.json") |
| 242 writeAndroidUpdateManifest(newManifestPath, [{ | 242 writeAndroidUpdateManifest(newManifestPath, [{ |
| 243 'basename': self.basename, | 243 'basename': self.basename, |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 619 except Exception, ex: | 619 except Exception, ex: |
| 620 logging.error("The build for %s failed:", repo) | 620 logging.error("The build for %s failed:", repo) |
| 621 logging.exception(ex) | 621 logging.exception(ex) |
| 622 | 622 |
| 623 file = open(nightlyConfigFile, 'wb') | 623 file = open(nightlyConfigFile, 'wb') |
| 624 nightlyConfig.write(file) | 624 nightlyConfig.write(file) |
| 625 | 625 |
| 626 | 626 |
| 627 if __name__ == '__main__': | 627 if __name__ == '__main__': |
| 628 main() | 628 main() |
| OLD | NEW |