Bugfixes for check custom packages

This commit is contained in:
Dimitris Zlatanidis 2024-03-30 20:56:01 +02:00
parent 664869539b
commit 400a92f7c8
2 changed files with 10 additions and 7 deletions

View file

@ -1,9 +1,12 @@
## slpkg - ChangeLog
### 5.0.2 - 29/03/2024
### 5.0.2 - 30/03/2024
- Updated:
* Updated for coding style
- Bugfixes:
* Check for custom upgrade packages (Thanks to Marav)
### 5.0.1 - 29/03/2024
- Updated:
* Updated to check upgrade packages against all repositories (slpkg upgrade --repository='*' --check)

View file

@ -27,8 +27,8 @@ class Upgrade(Configs):
self.installed_names: list = []
self.installed_packages: list = []
def load_installed_packages(self):
if self.repository in [self.repos.slack_repo_name, self.repos.salixos_repo_name]:
def load_installed_packages(self, repository: str) -> None:
if repository in [self.repos.slack_repo_name, self.repos.salixos_repo_name]:
installed: dict = self.utils.all_installed()
for name, package in installed.items():
@ -37,12 +37,12 @@ class Upgrade(Configs):
self.installed_packages.append(Path(package))
self.installed_names.append(name)
else:
repo_tag: str = self.repos.repositories[self.repository]['repo_tag']
repo_tag: str = self.repos.repositories[repository]['repo_tag']
self.installed_packages: list = list(self.log_packages.glob(f'*{repo_tag}'))
def packages(self) -> Generator:
""" Returns the upgradable packages. """
self.load_installed_packages()
self.load_installed_packages(self.repository)
for inst in self.installed_packages:
name: str = self.utils.split_package(inst.name)['name']
@ -82,12 +82,12 @@ class Upgrade(Configs):
if self.repository == '*':
repo_data: dict = self.data
self.installed_packages: list = list(self.log_packages.glob('*'))
else:
self.load_installed_packages()
repo_data[self.repository] = self.data
for repo, data in repo_data.items():
self.load_installed_packages(repo)
for installed in self.installed_packages:
name: str = self.utils.split_package(installed.name)['name']