[Pkg-mozext-commits] [adblock-plus] 43/74: Issue 2744 - Fetch correct Linux build of JS shell.
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 12:07:09 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository adblock-plus.
commit fd2605c2f0b1e4eb230166a8ca7078d62b83c922
Author: Dave Barker <kzar at kzar.co.uk>
Date: Mon Jul 6 12:19:52 2015 +0200
Issue 2744 - Fetch correct Linux build of JS shell.
---
utils.py | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/utils.py b/utils.py
index 6fdd8b4..ac3014a 100644
--- a/utils.py
+++ b/utils.py
@@ -4,8 +4,12 @@
# version 2.0 (the "License"). You can obtain a copy of the License at
# http://mozilla.org/MPL/2.0/.
-import sys, os, urllib, zipfile
+import os
+import platform
from StringIO import StringIO
+import sys
+import urllib
+import zipfile
def ensureJSShell():
baseDir = os.path.dirname(__file__)
@@ -19,15 +23,24 @@ def ensureJSShell():
if os.path.exists(path):
return path
- platform_map = {
+ supported_platforms = {
'win32': 'win32',
- 'linux2': 'linux-i686',
+ 'linux2': {
+ 'i686': 'linux-i686',
+ 'x86_64': 'linux-x86_64'
+ },
'darwin': 'mac',
}
- if sys.platform not in platform_map:
- raise Exception('Unknown platform, is there a JS shell version for it?')
-
- download_url = 'https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2015/02/2015-02-25-00-22-19-mozilla-esr31/jsshell-%s.zip' % platform_map[sys.platform]
+ try:
+ build = supported_platforms[sys.platform]
+ if isinstance(build, dict):
+ build = build[platform.machine()]
+ except KeyError:
+ raise Exception('Platform %s (%s) not supported by JS shell' % (
+ sys.platform, platform.machine()
+ ))
+
+ download_url = 'https://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2015/02/2015-02-25-00-22-19-mozilla-esr31/jsshell-%s.zip' % build
data = StringIO(urllib.urlopen(download_url).read())
zip = zipfile.ZipFile(data)
zip.extractall(shell_dir)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git
More information about the Pkg-mozext-commits
mailing list