diff --git a/CHANGELOG.md b/CHANGELOG.md index e49d03a3..e5ca27f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [0.9.9] ### Fixes - Arch: + - search: not able to find installed packages that were renamed on the repositories (e.g: xapps -> xapp) - AUR: not able to find some repository dependencies when their names are not an exact match (e.g: sc-controller [0.4.7-1] relies on "pylibacl". This dependency now is called "python-pylibacl") ## [0.9.8] 2020-10-02 diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index 478e7c9f..3d768ca2 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -346,15 +346,15 @@ class ArchManager(SoftwareManager): def _search_in_repos_and_fill(self, words: str, disk_loader: DiskCacheLoader, read_installed: Thread, installed: List[ArchPackage], res: SearchResult): repo_search = pacman.search(words) + pkgname = words.split(' ')[0].strip() - if not repo_search: # the package may not be mapped on the databases anymore - pkgname = words.split(' ')[0].strip() + if not repo_search or pkgname not in repo_search: pkg_found = pacman.get_info_dict(pkgname, remote=False) - if pkg_found and pkg_found['validated by']: - repo_search = {pkgname: {'version': pkg_found.get('version'), - 'repository': 'unknown', - 'description': pkg_found.get('description')}} + if pkg_found and pkg_found['validated by'] and pkg_found['name'] not in repo_search: + repo_search[pkgname] = {'version': pkg_found.get('version'), + 'repository': 'unknown', + 'description': pkg_found.get('description')} if repo_search: repo_pkgs = [] diff --git a/bauh/gems/arch/pacman.py b/bauh/gems/arch/pacman.py index 0eb36791..0f475477 100644 --- a/bauh/gems/arch/pacman.py +++ b/bauh/gems/arch/pacman.py @@ -429,8 +429,9 @@ def get_build_date(pkgname: str) -> str: def search(words: str) -> Dict[str, dict]: output = run_cmd('pacman -Ss ' + words, print_error=False) + found = {} if output: - found, current = {}, {} + current = {} for l in output.split('\n'): if l: if l.startswith(' '): @@ -450,7 +451,7 @@ def search(words: str) -> Dict[str, dict]: version = data_split[1].split(':') current['version'] = version[0] if len(version) == 1 else version[1] - return found + return found def get_databases() -> Set[str]: