path/distribution
This commit is contained in:
parent
bb36a79cbf
commit
27ce3ca25c
4 changed files with 10 additions and 12 deletions
|
@ -1,12 +1,16 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
DISTRIBUTION = 'distrib'
|
||||||
|
|
||||||
|
|
||||||
class Distribution:
|
class Distribution:
|
||||||
def __init__(self, architecture):
|
def __init__(self, architecture):
|
||||||
self.architecture = architecture
|
self.architecture = architecture
|
||||||
|
self.path = os.sep.join([DISTRIBUTION, self.architecture.name])
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
lines = [
|
lines = [
|
||||||
f'Architecture: {self.architecture.name}',
|
f'Architecture: {self.architecture.name}',
|
||||||
|
f' Path: {self.path}',
|
||||||
]
|
]
|
||||||
return os.linesep.join(lines)
|
return os.linesep.join(lines)
|
||||||
|
|
9
local.py
9
local.py
|
@ -2,6 +2,7 @@ import arguments
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import distribution
|
||||||
import msys
|
import msys
|
||||||
import repository
|
import repository
|
||||||
|
|
||||||
|
@ -13,13 +14,13 @@ class Local(repository.Repository):
|
||||||
self.load()
|
self.load()
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
distribution = os.path.join(
|
distro = os.path.join(
|
||||||
self.location, msys.DISTRIBUTION)
|
self.location, distribution.DISTRIBUTION)
|
||||||
d = {}
|
d = {}
|
||||||
_, architectures, _ = next(os.walk(distribution))
|
_, architectures, _ = next(os.walk(distro))
|
||||||
for architecture in [a for a in architectures
|
for architecture in [a for a in architectures
|
||||||
if a in msys.ARCHITECTURES]:
|
if a in msys.ARCHITECTURES]:
|
||||||
directory = os.path.join(distribution, architecture)
|
directory = os.path.join(distro, architecture)
|
||||||
_, _, files = next(os.walk(directory))
|
_, _, files = next(os.walk(directory))
|
||||||
archives = sorted([file for file in files
|
archives = sorted([file for file in files
|
||||||
if file.endswith(msys.ARCHIVE)])
|
if file.endswith(msys.ARCHIVE)])
|
||||||
|
|
7
msys.py
7
msys.py
|
@ -1,10 +1,7 @@
|
||||||
import os
|
|
||||||
|
|
||||||
ARCHIVE = '.tar.xz'
|
ARCHIVE = '.tar.xz'
|
||||||
ARCHITECTURE = 'x86_64'
|
ARCHITECTURE = 'x86_64'
|
||||||
CATALOG = '.files'
|
CATALOG = '.files'
|
||||||
CHARSET = 'u8'
|
CHARSET = 'u8'
|
||||||
DISTRIBUTION = 'distrib'
|
|
||||||
REPOSITORY = 'https://repo.msys2.org'
|
REPOSITORY = 'https://repo.msys2.org'
|
||||||
SIGNATURE = '.sig'
|
SIGNATURE = '.sig'
|
||||||
SUBSYSTEM = 'msys'
|
SUBSYSTEM = 'msys'
|
||||||
|
@ -21,10 +18,6 @@ ARCHITECTURES_SUBSYSTEMS = {
|
||||||
SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt']
|
SUBSYSTEMS = [SUBSYSTEM, 'clang', 'mingw', 'ucrt']
|
||||||
|
|
||||||
|
|
||||||
def get_distribution(architecture):
|
|
||||||
return os.path.join(DISTRIBUTION, architecture.name)
|
|
||||||
|
|
||||||
|
|
||||||
def get_subsystems(architecture, families):
|
def get_subsystems(architecture, families):
|
||||||
list = []
|
list = []
|
||||||
for family in families:
|
for family in families:
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Remote(repository.Repository):
|
||||||
for architecture in self.architectures:
|
for architecture in self.architectures:
|
||||||
subsystems = architecture.subsystems.keys()
|
subsystems = architecture.subsystems.keys()
|
||||||
location = os.path.join(self.location,
|
location = os.path.join(self.location,
|
||||||
msys.get_distribution(architecture))
|
architecture.distribution.path)
|
||||||
archives[architecture] = hypertext.HyperText(location).archive
|
archives[architecture] = hypertext.HyperText(location).archive
|
||||||
#
|
#
|
||||||
c[architecture] = {}
|
c[architecture] = {}
|
||||||
|
|
Loading…
Reference in a new issue