subsystems
This commit is contained in:
parent
7033a6189e
commit
e9e6994c62
4 changed files with 13 additions and 9 deletions
|
@ -1,18 +1,18 @@
|
|||
import os
|
||||
|
||||
import distribution
|
||||
import subsystem
|
||||
|
||||
X86 = 'x86_64'
|
||||
I86 = 'i686'
|
||||
|
||||
|
||||
class Architecture:
|
||||
def __init__(self, name, bits):
|
||||
def __init__(self, name, bits, subsystems):
|
||||
self.name = name
|
||||
self.bits = bits
|
||||
self.distribution = distribution.Distribution(self)
|
||||
# TODO subsystems
|
||||
self.subsystems = {}
|
||||
self.subsystems = {s: subsystem.SubSystem(self, s) for s in subsystems}
|
||||
|
||||
def __str__(self):
|
||||
lines = [
|
||||
|
@ -21,7 +21,12 @@ class Architecture:
|
|||
return os.linesep.join(lines)
|
||||
|
||||
|
||||
x86 = Architecture(X86, 64, [subsystem.MAIN,
|
||||
'clang64', 'mingw64', 'ucrt64'])
|
||||
i86 = Architecture(I86, 32, [subsystem.MAIN,
|
||||
'clang32', 'mingw32'])
|
||||
|
||||
ARCHITECTURES = {
|
||||
X86: Architecture(X86, 64),
|
||||
I86: Architecture(I86, 32),
|
||||
X86: x86,
|
||||
I86: i86,
|
||||
}
|
||||
|
|
|
@ -86,3 +86,4 @@ compression applying to archive
|
|||
D = parse()
|
||||
|
||||
architectures = D[ARCHITECTURES]
|
||||
subsystems = D[SUBSYSTEMS]
|
||||
|
|
|
@ -11,14 +11,13 @@ import repository
|
|||
class Remote(repository.Repository):
|
||||
def __init__(self, args):
|
||||
super().__init__(args[arguments.REMOTE])
|
||||
self.subsystems = args[arguments.SUBSYSTEMS]
|
||||
self.load()
|
||||
|
||||
def load(self):
|
||||
archives = {}
|
||||
c = {}
|
||||
for architecture in self.architectures:
|
||||
subsystems = msys.get_subsystems(architecture, self.subsystems)
|
||||
subsystems = architecture.subsystems.keys()
|
||||
location = os.path.join(self.location,
|
||||
msys.get_distribution(architecture))
|
||||
archives[architecture] = hypertext.HyperText(location).archive
|
||||
|
|
|
@ -17,8 +17,7 @@ class Synchronization:
|
|||
|
||||
def run(self):
|
||||
for architecture in self.remote.architectures:
|
||||
for subsystem in msys.get_subsystems(architecture,
|
||||
self.remote.subsystems):
|
||||
for subsystem in architecture.subsystems.keys():
|
||||
catalog = self.remote.catalogs[architecture][subsystem]
|
||||
path = msys.get_subsystem(architecture, subsystem)
|
||||
for _, package in sorted(catalog.packages.items()):
|
||||
|
|
Loading…
Reference in a new issue