Updated for binaries

This commit is contained in:
Dimitris Zlatanidis 2023-03-18 22:10:27 +02:00
parent ee8f02307c
commit 49ad027056
2 changed files with 55 additions and 13 deletions

View file

@ -89,27 +89,68 @@ class CreateData(Configs):
print('Creating the database... ', end='', flush=True)
# repo: str = Column(Text)
# name: str = Column(Text)
# version: str = Column(Text)
# package: str = Column(Text)
# mirror: str = Column(Text)
# location: str = Column(Text)
# size_comp: str = Column(Text)
# size_uncomp: str = Column(Text)
# requires: str = Column(Text)
# conflicts: str = Column(Text)
# suggests: str = Column(Text)
# description: str = Column(Text)
for i, line in enumerate(pkg_txt, 1):
for tag in pkg_tags:
if line.startswith(pkg_tags[0]):
cache.append(repo)
line = line.replace(tag, '').strip()
cache.append(self.utils.split_binary_pkg(line)[0])
cache.append(self.utils.split_binary_pkg(line)[1])
cache.append(line)
if line.startswith(tag):
if line.startswith(pkg_tags[0]):
line = line.replace(tag, '').strip()
cache.append(self.utils.split_binary_pkg(line)[0])
cache.append(self.utils.split_binary_pkg(line)[1])
line = line.replace(tag, '').strip()
cache.append(line)
for line in cache:
if not line.startswith(pkg_tags[5]):
line = line.replace(tag, '').strip()
cache.append('a')
if not line.startswith(pkg_tags[6]):
line = line.replace(tag, '').strip()
cache.append('b')
if not line.startswith(pkg_tags[7]):
line = line.replace(tag, '').strip()
cache.append('c')
if not line.startswith(pkg_tags[8]):
line = line.replace(tag, '').strip()
cache.append('d')
for i, line in enumerate(cache):
print(line)
# if (i % 11) == 0:
# data: str = BinariesTable(name=cache[0], location=cache[1].split('/')[1],
# files=cache[2], version=cache[3],
# download=cache[4], download64=cache[5],
# md5sum=cache[6], md5sum64=cache[7],
# requires=cache[8], short_description=cache[9])
if i == 12:
break
# data: str = BinariesTable(repo=,
# name=,
# version=,
# package=,
# mirror=,
# location=,
# size_comp=,
# size_uncomp=,
# requires=,
# conflicts=,
# suggests=,
# description=)
# self.session.add(data)
#
# cache: list = [] # reset cache after 11 lines

View file

@ -89,6 +89,7 @@ class UpdateRepository(Configs):
self.data.install_sbo_table()
else:
print()
self.make_dirs()
urls: list = []
for repo in self.repositories: