architectures
This commit is contained in:
parent
28369f5813
commit
68c15d9c39
3 changed files with 11 additions and 10 deletions
|
@ -1,6 +1,7 @@
|
|||
import argparse
|
||||
import os
|
||||
|
||||
import architecture
|
||||
import msys
|
||||
import subsystem
|
||||
|
||||
|
@ -48,7 +49,8 @@ action to perform onto msys repository
|
|||
msys remote repository's location
|
||||
''')
|
||||
sync.add_argument(f'-{ARCHITECTURES[0]}', f'--{ARCHITECTURES}', type=str,
|
||||
nargs='+', choices=msys.ARCHITECTURES, help='''\
|
||||
nargs='+', choices=architecture.ARCHITECTURES.keys(),
|
||||
help='''\
|
||||
list of architectures to sync
|
||||
''')
|
||||
sync.add_argument(f'-{SUBSYSTEMS[0]}', f'--{SUBSYSTEMS}', type=str,
|
||||
|
|
15
local.py
15
local.py
|
@ -1,7 +1,8 @@
|
|||
import arguments
|
||||
import datetime
|
||||
import os
|
||||
|
||||
import architecture
|
||||
import arguments
|
||||
import distribution
|
||||
import msys
|
||||
import repository
|
||||
|
@ -18,14 +19,14 @@ class Local(repository.Repository):
|
|||
self.location, distribution.DISTRIBUTION)
|
||||
d = {}
|
||||
_, architectures, _ = next(os.walk(distro))
|
||||
for architecture in [a for a in architectures
|
||||
if a in msys.ARCHITECTURES]:
|
||||
directory = os.path.join(distro, architecture)
|
||||
for arch in [a for a in architectures
|
||||
if a in architecture.ARCHITECTURES.keys()]:
|
||||
directory = os.path.join(distro, arch)
|
||||
_, _, files = next(os.walk(directory))
|
||||
archives = sorted([file for file in files
|
||||
if file.endswith(msys.ARCHIVE)])
|
||||
archive = archives[-1]
|
||||
d[architecture] = archive
|
||||
d[arch] = archive
|
||||
self.archives = d
|
||||
|
||||
def get_temporary(self):
|
||||
|
@ -38,6 +39,6 @@ class Local(repository.Repository):
|
|||
super().__str__(),
|
||||
'Archives:',
|
||||
]
|
||||
for architecture, archive in reversed(sorted(self.archives.items())):
|
||||
lines.append(f'{architecture} → {archive}')
|
||||
for arch, archive in reversed(sorted(self.archives.items())):
|
||||
lines.append(f'{arch} → {archive}')
|
||||
return os.linesep.join(lines)
|
||||
|
|
2
msys.py
2
msys.py
|
@ -3,5 +3,3 @@ ARCHITECTURE = 'x86_64'
|
|||
CATALOG = '.files'
|
||||
CHARSET = 'u8'
|
||||
REPOSITORY = 'https://repo.msys2.org'
|
||||
|
||||
ARCHITECTURES = [ARCHITECTURE, 'i686']
|
||||
|
|
Loading…
Reference in a new issue