2021-10-10 03:01:21 +00:00
|
|
|
import os
|
|
|
|
|
2021-10-10 01:00:43 +00:00
|
|
|
ARCHIVE = '.tar.xz'
|
2021-10-10 02:50:28 +00:00
|
|
|
ARCHITECTURE = 'x86_64'
|
2021-10-10 01:57:52 +00:00
|
|
|
CATALOG = '.files'
|
2021-10-10 01:00:43 +00:00
|
|
|
CHARSET = 'u8'
|
2021-10-10 02:22:32 +00:00
|
|
|
CRT = 'mingw'
|
2021-10-10 02:01:32 +00:00
|
|
|
DISTRIBUTION = 'distrib'
|
2021-10-10 02:50:28 +00:00
|
|
|
REPOSITORY = 'https://repo.msys2.org'
|
2021-10-10 01:56:20 +00:00
|
|
|
SIGNATURE = '.sig'
|
2021-10-10 02:19:14 +00:00
|
|
|
SUBSYSTEM = 'msys'
|
2021-10-10 02:43:33 +00:00
|
|
|
|
2021-10-10 02:50:28 +00:00
|
|
|
ARCHITECTURES = [ARCHITECTURE, 'i686']
|
|
|
|
ARCHITECTURES_BITS = {
|
|
|
|
ARCHITECTURE: 64,
|
|
|
|
'i686': 32,
|
|
|
|
}
|
2021-10-10 02:43:33 +00:00
|
|
|
ARCHITECTURES_SUBSYSTEMS = {
|
2021-10-10 02:50:28 +00:00
|
|
|
ARCHITECTURE: [SUBSYSTEM, 'clang64', 'mingw64', 'ucrt64'],
|
2021-10-10 02:43:33 +00:00
|
|
|
'i686': [SUBSYSTEM, 'clang32', 'mingw32'],
|
|
|
|
}
|
2021-10-10 02:19:14 +00:00
|
|
|
SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt']
|
2021-10-10 02:43:33 +00:00
|
|
|
|
|
|
|
|
2021-10-10 03:04:35 +00:00
|
|
|
def get_distribution(architecture):
|
|
|
|
return os.path.join(DISTRIBUTION, architecture)
|
|
|
|
|
|
|
|
|
|
|
|
def get_subsystem(architecture, subsystem):
|
|
|
|
list = []
|
|
|
|
if subsystem != SUBSYSTEM:
|
|
|
|
list.append(CRT)
|
|
|
|
list.append(subsystem)
|
|
|
|
if subsystem == SUBSYSTEM:
|
|
|
|
list.append(architecture)
|
|
|
|
return os.sep.join(list)
|
|
|
|
|
|
|
|
|
2021-10-10 02:43:33 +00:00
|
|
|
def get_subsystems(architecture, families):
|
|
|
|
list = []
|
|
|
|
bits = ARCHITECTURES_BITS[architecture]
|
|
|
|
for family in families:
|
|
|
|
if family == SUBSYSTEM:
|
|
|
|
subsystem = family
|
|
|
|
else:
|
|
|
|
subsystem = f'{family}{bits}'
|
|
|
|
if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]:
|
|
|
|
list.append(subsystem)
|
|
|
|
return list
|