 Issue 29322531:
  Issue 2797 - Add "Update From Gallery" key to the Safari extension update manifest  (Closed)
    
  
    Issue 29322531:
  Issue 2797 - Add "Update From Gallery" key to the Safari extension update manifest  (Closed) 
  | 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-2015 Eyeo GmbH | 4 # Copyright (C) 2006-2015 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, writeAn droidUpdateManifest | 34 from sitescripts.extensions.utils import ( | 
| 35 compareVersions, Configuration, | |
| 36 writeAndroidUpdateManifest | |
| 37 ) | |
| 35 | 38 | 
| 36 MAX_BUILDS = 50 | 39 MAX_BUILDS = 50 | 
| 37 | 40 | 
| 38 | 41 | 
| 39 class NightlyBuild(object): | 42 class NightlyBuild(object): | 
| 40 """ | 43 """ | 
| 41 Performs the build process for an extension, | 44 Performs the build process for an extension, | 
| 42 generating changelogs and documentation. | 45 generating changelogs and documentation. | 
| 43 """ | 46 """ | 
| 44 | 47 | 
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 | 193 | 
| 191 def readSafariMetadata(self): | 194 def readSafariMetadata(self): | 
| 192 import buildtools.packagerSafari as packager | 195 import buildtools.packagerSafari as packager | 
| 193 metadata = packager.readMetadata(self.tempdir, self.config.type) | 196 metadata = packager.readMetadata(self.tempdir, self.config.type) | 
| 194 certs = packager.get_certificates_and_key(self.config.keyFile)[0] | 197 certs = packager.get_certificates_and_key(self.config.keyFile)[0] | 
| 195 | 198 | 
| 196 self.certificateID = packager.get_developer_identifier(certs) | 199 self.certificateID = packager.get_developer_identifier(certs) | 
| 197 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self. revision) | 200 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self. revision) | 
| 198 self.shortVersion = metadata.get("general", "version") | 201 self.shortVersion = metadata.get("general", "version") | 
| 199 self.basename = metadata.get("general", "basename") | 202 self.basename = metadata.get("general", "basename") | 
| 200 self.updatedFromGallery = True | 203 self.updatedFromGallery = False | 
| 
Wladimir Palant
2015/07/16 19:13:26
What's the point having a flag if it is a constant
 
Sebastian Noack
2015/07/17 11:08:45
We use the same template to generate the update ma
 
Sebastian Noack
2015/07/17 11:34:52
Argh, I just realized that I got it the wrong way
 | |
| 201 | 204 | 
| 202 def writeUpdateManifest(self): | 205 def writeUpdateManifest(self): | 
| 203 """ | 206 """ | 
| 204 Writes update.rdf file for the current build | 207 Writes update.rdf file for the current build | 
| 205 """ | 208 """ | 
| 206 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) | 209 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) | 
| 207 if not os.path.exists(baseDir): | 210 if not os.path.exists(baseDir): | 
| 208 os.makedirs(baseDir) | 211 os.makedirs(baseDir) | 
| 209 if self.config.type == 'chrome' or self.config.type == 'opera': | 212 if self.config.type == 'chrome' or self.config.type == 'opera': | 
| 210 manifestPath = os.path.join(baseDir, "updates.xml") | 213 manifestPath = os.path.join(baseDir, "updates.xml") | 
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 510 except Exception, ex: | 513 except Exception, ex: | 
| 511 print >>sys.stderr, "The build for %s failed:" % repo | 514 print >>sys.stderr, "The build for %s failed:" % repo | 
| 512 traceback.print_exc() | 515 traceback.print_exc() | 
| 513 | 516 | 
| 514 file = open(nightlyConfigFile, 'wb') | 517 file = open(nightlyConfigFile, 'wb') | 
| 515 nightlyConfig.write(file) | 518 nightlyConfig.write(file) | 
| 516 | 519 | 
| 517 | 520 | 
| 518 if __name__ == '__main__': | 521 if __name__ == '__main__': | 
| 519 main() | 522 main() | 
| LEFT | RIGHT |