From 21464b003586853bdff4d14b02da8fccb19e652b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sun, 10 Oct 2021 04:19:14 +0200 Subject: [PATCH] subsystems,bits --- msys.py | 11 ++++++++++- remote.py | 12 ++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/msys.py b/msys.py index f88c6a1..91a942e 100644 --- a/msys.py +++ b/msys.py @@ -1,7 +1,16 @@ ARCHIVE = '.tar.xz' ARCHITECTURES = ['x86_64', 'i686'] +ARCHITECTURES_BITS = { + 'x86_64': 64, + 'i686': 32, +} +ARCHITECTURES_SUBSYSTEMS = { + 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], + 'i686': ['msys', 'clang32', 'mingw32'], +} CATALOG = '.files' CHARSET = 'u8' DISTRIBUTION = 'distrib' SIGNATURE = '.sig' -SUBSYSTEMS = ['msys', 'clang', 'mingw', 'ucrt'] +SUBSYSTEM = 'msys' +SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt'] diff --git a/remote.py b/remote.py index e90fe6e..d90ad91 100644 --- a/remote.py +++ b/remote.py @@ -7,14 +7,6 @@ import hypertext import msys -ARCHITECTURES_BITS = { - 'x86_64': 64, - 'i686': 32, -} -ARCHITECTURES_SUBSYSTEMS = { - 'x86_64': ['msys', 'clang64', 'mingw64', 'ucrt64'], - 'i686': ['msys', 'clang32', 'mingw32'], -} MINGW = 'mingw' @@ -40,9 +32,9 @@ class Remote: subsystem = ss location = os.path.join(location, subsystem, architecture) else: - subsystem = f'{ss}{ARCHITECTURES_BITS[architecture]}' + subsystem = f'{ss}{msys.ARCHITECTURES_BITS[architecture]}' location = os.path.join(location, MINGW, subsystem) - if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: + if subsystem in msys.ARCHITECTURES_SUBSYSTEMS[architecture]: location = os.path.join(location, f'{subsystem}{msys.CATALOG}') binary = requests.get(location).content