[arch] fix -> search: not able to find installed packages that were renamed on the repositories

This commit is contained in:
Vinicius Moreira
2020-11-12 11:42:17 -03:00
parent 7dae74e3d0
commit f6b0679fd7
3 changed files with 10 additions and 8 deletions

View File

@@ -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

View File

@@ -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 = []

View File

@@ -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]: