mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
[arch] fix -> AUR: not able to find some repository dependencies when their names are not an exact match
This commit is contained in:
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## [0.9.9]
|
||||
### Fixes
|
||||
- Arch:
|
||||
- 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
|
||||
### Fixes
|
||||
- Arch
|
||||
|
||||
@@ -185,12 +185,25 @@ class DependenciesAnalyser:
|
||||
|
||||
if dep_name == dep_exp:
|
||||
providers = remote_provided_map.get(dep_name)
|
||||
|
||||
if not providers: # try to find the package through the pacman's search mechanism
|
||||
match = pacman.find_one_match(dep_name)
|
||||
|
||||
if match:
|
||||
providers = {match}
|
||||
|
||||
else: # handling cases when the dep has an expression ( e.g: xpto>=0.12 )
|
||||
providers = remote_provided_map.get(dep_exp)
|
||||
|
||||
if providers is None:
|
||||
providers = remote_provided_map.get(dep_name)
|
||||
|
||||
if not providers: # try to find the package through the pacman's search mechanism
|
||||
match = pacman.find_one_match(dep_name)
|
||||
|
||||
if match:
|
||||
providers = {match}
|
||||
|
||||
if providers and len(providers) > 1:
|
||||
no_mapped_data = {p for p in providers if
|
||||
p not in deps_data} # checking providers with no mapped data
|
||||
|
||||
@@ -50,7 +50,7 @@ def check(pkgdir: str, optimize: bool, missing_deps: bool, handler: ProcessHandl
|
||||
|
||||
|
||||
def make(pkgdir: str, optimize: bool, handler: ProcessHandler, custom_pkgbuild: Optional[str] = None) -> Tuple[bool, str]:
|
||||
cmd = ['makepkg', '-ALcsmf', '--skipchecksums']
|
||||
cmd = ['makepkg', '-ALcsmf', '--skipchecksums', '--nodeps']
|
||||
|
||||
if custom_pkgbuild:
|
||||
cmd.append('-p')
|
||||
|
||||
@@ -151,6 +151,7 @@ def install_as_process(pkgpaths: Iterable[str], root_password: str, file: bool,
|
||||
|
||||
if not simulate:
|
||||
cmd.append('--noconfirm')
|
||||
cmd.append('-dd')
|
||||
|
||||
if overwrite_conflicting_files:
|
||||
cmd.append('--overwrite=*')
|
||||
@@ -1172,3 +1173,13 @@ def list_post_uninstall_unneeded_packages(names: Set[str]) -> Set[str]:
|
||||
reqs.add(line_strip)
|
||||
|
||||
return reqs
|
||||
|
||||
|
||||
def find_one_match(name: str) -> Optional[str]:
|
||||
output = run_cmd('pacman -Ssq {}'.format(name), print_error=False)
|
||||
|
||||
if output:
|
||||
matches = [l.strip() for l in output.split('\n') if l.strip()]
|
||||
|
||||
if matches and len(matches) == 1:
|
||||
return matches[0]
|
||||
|
||||
Reference in New Issue
Block a user