diff options
author | Ruben Pollan <meskio@sindominio.net> | 2014-09-10 12:53:33 -0500 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2014-09-10 12:56:06 -0500 |
commit | 6f82fe5991d616bad0e0caf9340544ed7cdc2099 (patch) | |
tree | d159f52156f52fb672f38216b30c231574261007 | |
parent | a1f8bd242a88c10b229794fb7f11b19c42ad2dd7 (diff) |
Add support for multiple archs in one platform
-rw-r--r-- | changes/feature_6044_diferenciate_linux32_64 | 2 | ||||
-rw-r--r-- | src/launcher.py | 18 |
2 files changed, 15 insertions, 5 deletions
diff --git a/changes/feature_6044_diferenciate_linux32_64 b/changes/feature_6044_diferenciate_linux32_64 new file mode 100644 index 0000000..6aa8d12 --- /dev/null +++ b/changes/feature_6044_diferenciate_linux32_64 @@ -0,0 +1,2 @@ +- Add support for multiple archs in the same platform. Closes #6044 +- Stop updater if platform is not defined. Closes #6052 diff --git a/src/launcher.py b/src/launcher.py index 614101b..fbd0368 100644 --- a/src/launcher.py +++ b/src/launcher.py @@ -12,9 +12,8 @@ from leap.common.events import events_pb2 as proto import tuf.client.updater bundles_per_platform = { - "Windows": "windows", - "Darwin": "darwin", - "Linux": "linux", + "Linux-i386": "linux-i368", + "Linux-x86_64": "linux-x86_64", } GENERAL_SECTION = "General" @@ -75,6 +74,9 @@ class TUF(threading.Thread): signal(proto.UPDATER_NEW_UPDATES, content=", ".join(filepath)) return + except NotImplemented as e: + print "NotImplemented: ", e + return except Exception as e: print "ERROR:", e finally: @@ -86,8 +88,8 @@ class TUF(threading.Thread): if section[:6] != 'Mirror': continue url_prefix = config.get(section, 'url_prefix') - metadata_path = bundles_per_platform[platform.system()] + '/metadata' - targets_path = bundles_per_platform[platform.system()] + '/targets' + metadata_path = self._repo_path() + '/metadata' + targets_path = self._repo_path() + '/targets' self.mirrors[section[7:]] = {'url_prefix': url_prefix, 'metadata_path': metadata_path, 'targets_path': targets_path, @@ -102,6 +104,12 @@ class TUF(threading.Thread): file_path = os.path.join(self.dest_path, filepath) os.chmod(file_path, file_permissions) + def _repo_path(self): + system = platform.system() + "-" + platform.machine() + if system not in bundles_per_platform: + raise NotImplemented("Platform %s not supported" % (system,)) + return bundles_per_platform[system] + if __name__ == "__main__": server.ensure_server(port=8090) |