From 30a64121159ee6593e3c675d51f20862022e541d Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sun, 17 Mar 2024 23:14:36 +0200 Subject: [PATCH] Fix for all repos data --- slpkg/choose_packages.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/slpkg/choose_packages.py b/slpkg/choose_packages.py index b8b6c3ec..c4917918 100644 --- a/slpkg/choose_packages.py +++ b/slpkg/choose_packages.py @@ -81,10 +81,19 @@ class Choose(Configs): def choose_for_others(self, data: dict, packages: list): """ Choose packages for others methods like install, tracking etc. """ - for pkg in packages: - for package in data.keys(): + if self.repository == '*': + for pkg in packages: + for name, repo in data.items(): + for package in repo.keys(): + if pkg in package or pkg == '*': + version: str = repo[package]['version'] + self.choices.extend([(package, version, False, f'Package: {package}-{version} ' + f'> {name}')]) - if pkg in package or pkg == '*': - version: str = data[package]['version'] - self.choices.extend([(package, version, False, f'Package: {package}-{version} ' - f'> {self.repository}')]) + else: + for pkg in packages: + for package in data.keys(): + if pkg in package or pkg == '*': + version: str = data[package]['version'] + self.choices.extend([(package, version, False, f'Package: {package}-{version} ' + f'> {self.repository}')])