only install packages for platform
This commit is contained in:
parent
639a0bcd24
commit
d4f26df196
1 changed files with 23 additions and 8 deletions
|
@ -20,6 +20,18 @@ def makedirs(dirname):
|
||||||
if not os.path.exists(dirname):
|
if not os.path.exists(dirname):
|
||||||
os.makedirs(dirname)
|
os.makedirs(dirname)
|
||||||
|
|
||||||
|
def get_platform():
|
||||||
|
name = sys.platform
|
||||||
|
if name.startswith('darwin'):
|
||||||
|
name = 'darwin64'
|
||||||
|
elif name.startswith('linux'):
|
||||||
|
import platform
|
||||||
|
if platform.architecture()[0] == '64bit':
|
||||||
|
name = 'linux64'
|
||||||
|
else:
|
||||||
|
name = 'linux32'
|
||||||
|
return name
|
||||||
|
|
||||||
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
||||||
def do_OPTIONS(self):
|
def do_OPTIONS(self):
|
||||||
self.send_response(200, 'OK')
|
self.send_response(200, 'OK')
|
||||||
|
@ -79,12 +91,15 @@ class Install(Thread):
|
||||||
release = self.get_release()
|
release = self.get_release()
|
||||||
self.status["release"] = release
|
self.status["release"] = release
|
||||||
self.status["progress"] = 0
|
self.status["progress"] = 0
|
||||||
|
platform = get_platform()
|
||||||
for module in sorted(release['modules']):
|
for module in sorted(release['modules']):
|
||||||
|
if release['modules'][module].get('platform', platform) == platform:
|
||||||
package_tar = release['modules'][module]['name']
|
package_tar = release['modules'][module]['name']
|
||||||
url = self.release_url.replace('release.json', package_tar)
|
url = self.release_url.replace('release.json', package_tar)
|
||||||
self.download(url, package_tar)
|
self.download(url, package_tar)
|
||||||
self.status["step"] = 'Installing...'
|
self.status["step"] = 'Installing...'
|
||||||
for module in sorted(release['modules']):
|
for module in sorted(release['modules']):
|
||||||
|
if release['modules'][module].get('platform', platform) == platform:
|
||||||
package_tar = release['modules'][module]['name']
|
package_tar = release['modules'][module]['name']
|
||||||
tar = tarfile.open(package_tar)
|
tar = tarfile.open(package_tar)
|
||||||
tar.extractall()
|
tar.extractall()
|
||||||
|
|
Loading…
Reference in a new issue