Updated for slack and salixos repo

This commit is contained in:
Dimitris Zlatanidis 2024-03-24 18:55:58 +02:00
parent 4b301b5761
commit 5897966807

View file

@ -24,12 +24,21 @@ class Upgrade(Configs):
def packages(self) -> Generator:
""" Returns the upgradable packages. """
installed_packages: list = []
if self.repository in [self.repos.slack_repo_name, self.repos.salixos_repo_name]:
installed: Generator = self.log_packages.glob('*')
for package in installed:
tag: str = self.utils.split_package(package.name)['tag']
if not tag:
installed_packages.append(package)
else:
repo_tag: str = self.repos.repositories[self.repository]['repo_tag']
installed_packages: Generator = self.log_packages.glob(f'*{repo_tag}')
for installed in installed_packages:
name: str = self.utils.split_package(installed.name)['name']
if self.is_package_upgradeable(installed.name):
for inst in installed_packages:
name: str = self.utils.split_package(inst.name)['name']
if self.is_package_upgradeable(inst.name):
yield name
def is_package_upgradeable(self, installed: str) -> bool: