Updated for remove

This commit is contained in:
Dimitris Zlatanidis 2024-03-31 20:17:22 +03:00
parent af754e90d9
commit 20f9e0e955

View file

@ -79,7 +79,6 @@ class Upgrade(Configs):
def check_packages(self) -> None:
repo_data: dict = {}
found_packages: dict = {}
removed_packages: dict = {}
if self.repository == '*':
repo_data: dict = self.data
@ -114,20 +113,19 @@ class Upgrade(Configs):
}
if repo == self.repos.slack_repo_name and self.removed_packages:
if name not in data.keys():
tag: str = self.utils.split_package(installed.name)['tag']
if not tag and name not in data.keys():
self.id += 1
self.sum_removed += 1
inst_version: str = self.utils.split_package(installed.name)['version']
inst_build: str = self.utils.split_package(installed.name)['build']
repo_version: str = ''
repo_build: str = ''
removed_packages[self.id]: dict = {
found_packages[self.id]: dict = {
'name': name,
'inst_version': inst_version,
'inst_build': inst_build,
'repo_version': repo_version,
'repo_build': repo_build,
'repo_version': '',
'repo_build': '',
'repo': repo,
'type': 'remove'
}
@ -138,31 +136,27 @@ class Upgrade(Configs):
if name not in self.installed_names:
self.id += 1
self.sum_added += 1
inst_version: str = ''
inst_build: str = ''
repo_version: str = data[name]['version']
repo_build: str = data[name]['build']
found_packages[self.id]: dict = {
'name': name,
'inst_version': inst_version,
'inst_build': inst_build,
'inst_version': '',
'inst_build': '',
'repo_version': repo_version,
'repo_build': repo_build,
'repo': self.repos.slack_repo_name,
'type': 'add'
}
if found_packages or removed_packages:
if found_packages:
print()
title: str = f"{'packages':<18} {'Repository':<15} {'Build':<6} {'Installed':<15} {'Build':<5} {'Repo':>15}"
print(len(title) * '=')
print(f'{self.bgreen}{title}{self.endc}')
print(len(title) * '=')
all_founded: dict = found_packages | removed_packages
for data in all_founded.values():
for data in found_packages.values():
name: str = data['name']
repo_version: str = data['repo_version']
repo_build: str = data['repo_build']