get_subsystem
This commit is contained in:
parent
44e6cedaa4
commit
b0ecc43961
2 changed files with 15 additions and 6 deletions
12
msys.py
12
msys.py
|
@ -1,3 +1,5 @@
|
|||
import os
|
||||
|
||||
ARCHIVE = '.tar.xz'
|
||||
ARCHITECTURE = 'x86_64'
|
||||
CATALOG = '.files'
|
||||
|
@ -31,3 +33,13 @@ def get_subsystems(architecture, families):
|
|||
if subsystem in ARCHITECTURES_SUBSYSTEMS[architecture]:
|
||||
list.append(subsystem)
|
||||
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)
|
||||
|
|
|
@ -25,12 +25,9 @@ class Remote:
|
|||
#
|
||||
c[architecture] = {}
|
||||
for subsystem in subsystems:
|
||||
location = self.location
|
||||
if subsystem == msys.SUBSYSTEM:
|
||||
location = os.path.join(location, subsystem, architecture)
|
||||
else:
|
||||
location = os.path.join(location, msys.CRT, subsystem)
|
||||
location = os.path.join(location,
|
||||
location = os.path.join(self.location,
|
||||
msys.get_subsystem(architecture,
|
||||
subsystem),
|
||||
f'{subsystem}{msys.CATALOG}')
|
||||
binary = requests.get(location).content
|
||||
c[architecture][subsystem] = catalog.Catalog(binary)
|
||||
|
|
Loading…
Reference in a new issue