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}')])