mirror of
https://gitlab.com/dslackw/slpkg.git
synced 2025-01-19 10:27:07 +01:00
Updated for slack and salixos repo
This commit is contained in:
parent
4b301b5761
commit
5897966807
1 changed files with 14 additions and 5 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue