Index: sitescripts/extensions/bin/createNightlies.py |
=================================================================== |
--- a/sitescripts/extensions/bin/createNightlies.py |
+++ b/sitescripts/extensions/bin/createNightlies.py |
@@ -25,7 +25,7 @@ |
""" |
-import sys, os, os.path, codecs, subprocess, ConfigParser, traceback, json, hashlib |
+import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib |
import tempfile, shutil, urlparse, pipes, time, urllib2, struct |
from datetime import datetime |
from urllib import urlencode |
@@ -200,6 +200,9 @@ |
elif self.config.type == 'android': |
manifestPath = os.path.join(baseDir, "updates.xml") |
templateName = 'androidUpdateManifest' |
+ elif self.config.type == 'ie': |
+ manifestPath = os.path.join(baseDir, "update.json") |
+ templateName = 'ieUpdateManifest' |
Wladimir Palant
2014/07/29 11:25:18
libabpUpdateManifest please, this format isn't spe
Felix Dahlke
2014/07/29 11:37:17
As it is, the update manifest is IE specific, we w
|
else: |
manifestPath = os.path.join(baseDir, "update.rdf") |
templateName = 'geckoUpdateManifest' |
@@ -207,19 +210,6 @@ |
template = get_template(get_config().get('extensions', templateName)) |
template.stream({'extensions': [self]}).dump(manifestPath) |
- def writeLibabpUpdateManifest(self, updates): |
Wladimir Palant
2014/07/29 11:25:18
Why did you remove this function? Are you going to
Felix Dahlke
2014/07/29 11:37:17
Do we need special logic for Android here? How I s
|
- """ |
- Writes update.json file for libadblockplus |
- """ |
- baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
- if not os.path.exists(baseDir): |
- os.makedirs(baseDir) |
- manifestPath = os.path.join(baseDir, "update.json") |
- |
- handle = codecs.open(manifestPath, "wb", encoding="UTF-8") |
- json.dump(updates, handle, ensure_ascii=False, indent=2, separators=(",", ": ")) |
- handle.close() |
- |
def writeIEUpdateManifest(self, versions): |
""" |
Writes update.json file for the latest IE build |
@@ -227,24 +217,20 @@ |
if len(versions) == 0: |
return |
- version = versions[0] |
- packageName = self.basename + '-' + versions[0] + self.config.packageSuffix |
- updateURL = urlparse.urljoin(self.config.nightliesURL, self.basename + '/' + packageName + '?update') |
- self.writeLibabpUpdateManifest({ |
- "%s/%s" % (self.basename, "msie64"): { |
- "url": updateURL.replace(".exe", "-x64.msi"), |
- "version": version, |
- }, |
- "%s/%s" % (self.basename, "msie32"): { |
- "url": updateURL.replace(".exe", "-x86.msi"), |
- "version": version, |
- }, |
- }) |
+ baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
+ if not os.path.exists(baseDir): |
+ os.makedirs(baseDir) |
- baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
+ self.version = versions[0] |
Wladimir Palant
2014/07/29 11:25:18
This function shouldn't set any instance variables
Felix Dahlke
2014/07/29 11:37:17
True, it's a hack. How about I move this part to w
Wladimir Palant
2014/07/29 12:03:10
Yes, that would make sense.
|
+ packageName = self.basename + '-' + self.version + self.config.packageSuffix |
+ self.updateURL = urlparse.urljoin(self.config.nightliesURL, self.basename + |
+ '/' + packageName + '?update') |
+ self.name = self.basename |
+ self.writeUpdateManifest() |
+ |
for suffix in (self.config.packageSuffix, self.config.packageSuffix.replace("-x64", "-x86")): |
linkPath = os.path.join(baseDir, '00latest%s' % suffix) |
- outputPath = os.path.join(baseDir, self.basename + '-' + versions[0] + suffix) |
+ outputPath = os.path.join(baseDir, self.basename + '-' + self.version + suffix) |
if hasattr(os, 'symlink'): |
if os.path.exists(linkPath): |
os.remove(linkPath) |
@@ -252,7 +238,6 @@ |
else: |
shutil.copyfile(outputPath, linkPath) |
- |
def build(self): |
""" |
run the build command in the tempdir |