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,17 +91,20 @@ 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']):
|
||||||
package_tar = release['modules'][module]['name']
|
if release['modules'][module].get('platform', platform) == platform:
|
||||||
url = self.release_url.replace('release.json', package_tar)
|
package_tar = release['modules'][module]['name']
|
||||||
self.download(url, package_tar)
|
url = self.release_url.replace('release.json', 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']):
|
||||||
package_tar = release['modules'][module]['name']
|
if release['modules'][module].get('platform', platform) == platform:
|
||||||
tar = tarfile.open(package_tar)
|
package_tar = release['modules'][module]['name']
|
||||||
tar.extractall()
|
tar = tarfile.open(package_tar)
|
||||||
tar.close()
|
tar.extractall()
|
||||||
os.unlink(package_tar)
|
tar.close()
|
||||||
|
os.unlink(package_tar)
|
||||||
os.symlink('openmedialibrary/ctl', 'ctl')
|
os.symlink('openmedialibrary/ctl', 'ctl')
|
||||||
makedirs('data')
|
makedirs('data')
|
||||||
with open('data/release.json', 'w') as fd:
|
with open('data/release.json', 'w') as fd:
|
||||||
|
|
Loading…
Reference in a new issue