Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/extensions/bin/createNightlies.py

Issue 6103027194789888: Integrated ABP for Safari into the nightly builds (Closed)
Patch Set: Added safari extension to .sitescripts.example Created Nov. 13, 2013, 1:34 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .sitescripts.example ('k') | sitescripts/extensions/template/updates.plist » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/extensions/bin/createNightlies.py
===================================================================
--- a/sitescripts/extensions/bin/createNightlies.py
+++ b/sitescripts/extensions/bin/createNightlies.py
@@ -174,6 +174,33 @@
if metadata.has_section('compat') and metadata.has_option('compat', 'chrome'):
self.compat.append({'id': 'chrome', 'minVersion': metadata.get('compat', 'chrome')})
+ def readSafariMetadata(self):
+ # get the certificate ID from the developer certificate's common name
+ import M2Crypto
+ bio = M2Crypto.BIO.openfile(self.config.keyFile)
+ try:
+ while not hasattr(self, 'certificateID'):
+ try:
+ cert = M2Crypto.X509.load_cert_bio(bio)
+ except M2Crypto.X509.X509Error:
+ raise Exception('No safari developer certificate found in chain')
+
+ subject = cert.get_subject()
+ for entry in subject.get_entries_by_nid(subject.nid['CN']):
+ m = re.match(r'Safari Developer: \((.*?)\)', entry.get_data().as_text())
+ if m:
+ self.certificateID = m.group(1)
+ break
+ finally:
+ bio.close()
+
+ # read metadata file
+ import buildtools.packagerSafari as packager
+ metadata = packager.readMetadata(self.tempdir, self.config.type)
+ self.version = packager.getBuildVersion(self.tempdir, metadata, False, self.revision)
+ self.shortVersion = metadata.get("general", "version")
+ self.basename = metadata.get("general", "basename")
+
def writeUpdateManifest(self):
"""
Writes update.rdf file for the current build
@@ -184,6 +211,9 @@
if self.config.type == 'chrome' or self.config.type == 'opera':
manifestPath = os.path.join(baseDir, "updates.xml")
templateName = 'chromeUpdateManifest'
+ elif self.config.type == 'safari':
+ manifestPath = os.path.join(baseDir, "updates.plist")
+ templateName = 'safariUpdateManifest'
elif self.config.type == 'android':
manifestPath = os.path.join(baseDir, "updates.xml")
templateName = 'androidUpdateManifest'
@@ -278,6 +308,9 @@
elif self.config.type == 'chrome' or self.config.type == 'opera':
import buildtools.packagerChrome as packager
packager.createBuild(self.tempdir, type=self.config.type, outFile=outputPath, buildNum=self.revision, keyFile=self.config.keyFile, experimentalAPI=self.config.experimental)
+ elif self.config.type == 'safari':
+ import buildtools.packagerSafari as packager
+ packager.createBuild(self.tempdir, type=self.config.type, outFile=outputPath, buildNum=self.revision, keyFile=self.config.keyFile)
else:
import buildtools.packagerGecko as packager
packager.createBuild(self.tempdir, outFile=outputPath, buildNum=self.revision, keyFile=self.config.keyFile)
@@ -377,6 +410,8 @@
self.readAndroidMetadata()
elif self.config.type == 'chrome' or self.config.type == 'opera':
self.readChromeMetadata()
+ elif self.config.type == 'safari':
+ self.readSafariMetadata()
else:
self.readMetadata()
« no previous file with comments | « .sitescripts.example ('k') | sitescripts/extensions/template/updates.plist » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld