diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c023e7d..59768601 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - showing a "user-friendly" popup when there are integrity issues with the source-files of a building package - not waiting for the categories file to be retrieved from the cloud during application boot ( reduces boot time ) - caching cloud categories to the disk so they can be used in scenarios when it is not possible to retrieve them ( e.g: internet is off ) + - mapping known search key words to the specific package name ( e.g:"google chrome" will become "google-chrome" ) - Snap: - not waiting for the categories file to be retrieved from the cloud during application boot ( reduces boot time ) - caching cloud categories to the disk so they can be used in scenarios when it is not possible to retrieve them ( e.g: internet is off ) diff --git a/bauh/gems/arch/controller.py b/bauh/gems/arch/controller.py index e3f811be..6bc68437 100644 --- a/bauh/gems/arch/controller.py +++ b/bauh/gems/arch/controller.py @@ -35,6 +35,12 @@ RE_SPLIT_VERSION = re.compile(r'(=|>|<)') SOURCE_FIELDS = ('source', 'source_x86_64') RE_PRE_DOWNLOADABLE_FILES = re.compile(r'(https?|ftp)://.+\.\w+[^gpg|git]$') +SEARCH_OPTIMIZED_MAP = { + 'google chrome': 'google-chrome', + 'chrome google': 'google-chrome', + 'googlechrome': 'google-chrome' +} + class ArchManager(SoftwareManager): @@ -81,7 +87,9 @@ class ArchManager(SoftwareManager): read_installed = Thread(target=lambda: installed.update(pacman.list_and_map_installed()), daemon=True) read_installed.start() - api_res = self.aur_client.search(words) + mapped_words = SEARCH_OPTIMIZED_MAP.get(words) + + api_res = self.aur_client.search(mapped_words if mapped_words else words) if api_res and api_res.get('results'): read_installed.join()