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):
|
||||
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):
|
||||
def do_OPTIONS(self):
|
||||
self.send_response(200, 'OK')
|
||||
|
@ -79,17 +91,20 @@ class Install(Thread):
|
|||
release = self.get_release()
|
||||
self.status["release"] = release
|
||||
self.status["progress"] = 0
|
||||
platform = get_platform()
|
||||
for module in sorted(release['modules']):
|
||||
package_tar = release['modules'][module]['name']
|
||||
url = self.release_url.replace('release.json', package_tar)
|
||||
self.download(url, package_tar)
|
||||
if release['modules'][module].get('platform', platform) == platform:
|
||||
package_tar = release['modules'][module]['name']
|
||||
url = self.release_url.replace('release.json', package_tar)
|
||||
self.download(url, package_tar)
|
||||
self.status["step"] = 'Installing...'
|
||||
for module in sorted(release['modules']):
|
||||
package_tar = release['modules'][module]['name']
|
||||
tar = tarfile.open(package_tar)
|
||||
tar.extractall()
|
||||
tar.close()
|
||||
os.unlink(package_tar)
|
||||
if release['modules'][module].get('platform', platform) == platform:
|
||||
package_tar = release['modules'][module]['name']
|
||||
tar = tarfile.open(package_tar)
|
||||
tar.extractall()
|
||||
tar.close()
|
||||
os.unlink(package_tar)
|
||||
os.symlink('openmedialibrary/ctl', 'ctl')
|
||||
makedirs('data')
|
||||
with open('data/release.json', 'w') as fd:
|
||||
|
|
Loading…
Reference in a new issue