get_subsystem

This commit is contained in:
Marc Beninca 2021-10-10 05:01:21 +02:00 committed by Marc Beninca
parent 44e6cedaa4
commit b0ecc43961
2 changed files with 15 additions and 6 deletions

12
msys.py
View file

@ -1,3 +1,5 @@
import os
ARCHIVE = '.tar.xz' ARCHIVE = '.tar.xz'
ARCHITECTURE = 'x86_64' ARCHITECTURE = 'x86_64'
CATALOG = '.files' CATALOG = '.files'
@ -31,3 +33,13 @@ def get_subsystems(architecture, families):
if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]: if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]:
list.append(subsystem) list.append(subsystem)
return list return list
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)

View file

@ -25,12 +25,9 @@ class Remote:
# #
c[architecture] = {} c[architecture] = {}
for subsystem in subsystems: for subsystem in subsystems:
location = self.location location = os.path.join(self.location,
if subsystem == msys.SUBSYSTEM: msys.get_subsystem(architecture,
location = os.path.join(location, subsystem, architecture) subsystem),
else:
location = os.path.join(location, msys.CRT, subsystem)
location = os.path.join(location,
f'{subsystem}{msys.CATALOG}') f'{subsystem}{msys.CATALOG}')
binary = requests.get(location).content binary = requests.get(location).content
c[architecture][subsystem] = catalog.Catalog(binary) c[architecture][subsystem] = catalog.Catalog(binary)