mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 23:24:15 +02:00
[aur] mapping known search key words to the specific package name
This commit is contained in:
@@ -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
|
- 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 )
|
- 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 )
|
- 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:
|
- Snap:
|
||||||
- not waiting for the categories file to be retrieved from the cloud during application boot ( reduces boot time )
|
- 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 )
|
- 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 )
|
||||||
|
|||||||
@@ -35,6 +35,12 @@ RE_SPLIT_VERSION = re.compile(r'(=|>|<)')
|
|||||||
SOURCE_FIELDS = ('source', 'source_x86_64')
|
SOURCE_FIELDS = ('source', 'source_x86_64')
|
||||||
RE_PRE_DOWNLOADABLE_FILES = re.compile(r'(https?|ftp)://.+\.\w+[^gpg|git]$')
|
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):
|
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 = Thread(target=lambda: installed.update(pacman.list_and_map_installed()), daemon=True)
|
||||||
read_installed.start()
|
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'):
|
if api_res and api_res.get('results'):
|
||||||
read_installed.join()
|
read_installed.join()
|
||||||
|
|||||||
Reference in New Issue
Block a user