mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2024-12-31 10:26:39 +01:00
Updated for update repos
This commit is contained in:
parent
12ee3ad43c
commit
db93d14966
1 changed files with 6 additions and 7 deletions
|
@ -31,7 +31,6 @@ class UpdateRepository(Configs):
|
||||||
self.progress = ProgressBar()
|
self.progress = ProgressBar()
|
||||||
self.utils = Utilities()
|
self.utils = Utilities()
|
||||||
self.data = InstallData()
|
self.data = InstallData()
|
||||||
|
|
||||||
self.check_updates = CheckUpdates(flags, repository)
|
self.check_updates = CheckUpdates(flags, repository)
|
||||||
|
|
||||||
self.repos_for_update: dict = {}
|
self.repos_for_update: dict = {}
|
||||||
|
@ -625,10 +624,8 @@ class UpdateRepository(Configs):
|
||||||
}
|
}
|
||||||
|
|
||||||
with open(Path(path, sbo_txt), 'w') as sbo:
|
with open(Path(path, sbo_txt), 'w') as sbo:
|
||||||
|
|
||||||
for p in path.glob('**/*'):
|
for p in path.glob('**/*'):
|
||||||
if p.name.endswith('.info'):
|
if p.name.endswith('.info'):
|
||||||
|
|
||||||
sbo_path = Path('/'.join(str(p).split('/')[:-1]))
|
sbo_path = Path('/'.join(str(p).split('/')[:-1]))
|
||||||
|
|
||||||
name: str = str(p).split('/')[-2]
|
name: str = str(p).split('/')[-2]
|
||||||
|
@ -710,9 +707,13 @@ class UpdateRepository(Configs):
|
||||||
|
|
||||||
return info[begin:end]
|
return info[begin:end]
|
||||||
|
|
||||||
def check(self, queue) -> None:
|
def check_for_updates(self, queue) -> None:
|
||||||
compare: dict = self.check_updates.check_the_repositories()
|
compare: dict = self.check_updates.check_the_repositories()
|
||||||
|
self.print_the_messages(compare)
|
||||||
|
|
||||||
|
return queue.put(compare)
|
||||||
|
|
||||||
|
def print_the_messages(self, compare: dict) -> None:
|
||||||
print()
|
print()
|
||||||
for repo, comp in compare.items():
|
for repo, comp in compare.items():
|
||||||
if comp:
|
if comp:
|
||||||
|
@ -723,14 +724,12 @@ class UpdateRepository(Configs):
|
||||||
print(f'\n{self.endc}{self.yellow}No changes in ChangeLog.txt between your '
|
print(f'\n{self.endc}{self.yellow}No changes in ChangeLog.txt between your '
|
||||||
f'last update and now.{self.endc}')
|
f'last update and now.{self.endc}')
|
||||||
|
|
||||||
return queue.put(compare)
|
|
||||||
|
|
||||||
def repositories(self) -> None:
|
def repositories(self) -> None:
|
||||||
queue = Queue()
|
queue = Queue()
|
||||||
message = f'Checking for news, please wait...'
|
message = f'Checking for news, please wait...'
|
||||||
|
|
||||||
# Starting multiprocessing
|
# Starting multiprocessing
|
||||||
p1 = Process(target=self.check, args=(queue,))
|
p1 = Process(target=self.check_for_updates, args=(queue,))
|
||||||
p2 = Process(target=self.progress.bar, args=(message, ''))
|
p2 = Process(target=self.progress.bar, args=(message, ''))
|
||||||
|
|
||||||
p1.start()
|
p1.start()
|
||||||
|
|
Loading…
Reference in a new issue