mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 01:14:15 +02:00
fix: not checking provided package names when checking if a giving optional dependency is installed
This commit is contained in:
@@ -407,8 +407,7 @@ class ArchManager(SoftwareManager):
|
||||
if not odeps:
|
||||
return True
|
||||
|
||||
installed = pacman.list_installed()
|
||||
to_install = {d for d in odeps if d not in installed}
|
||||
to_install = {d for d in odeps if not pacman.check_installed(d)}
|
||||
|
||||
if not to_install:
|
||||
return True
|
||||
|
||||
@@ -61,6 +61,11 @@ def list_installed() -> Set[str]:
|
||||
return {out.decode().strip() for out in new_subprocess(['pacman', '-Qq']).stdout if out}
|
||||
|
||||
|
||||
def check_installed(pkg: str) -> bool:
|
||||
res = run_cmd('pacman -Qq ' + pkg, print_error=False)
|
||||
return bool(res)
|
||||
|
||||
|
||||
def list_and_map_installed() -> dict: # returns a dict with with package names as keys and versions as values
|
||||
installed = new_subprocess(['pacman', '-Qq']).stdout # retrieving all installed package names
|
||||
allinfo = new_subprocess(['pacman', '-Qi'], stdin=installed).stdout # retrieving all installed packages info
|
||||
|
||||
Reference in New Issue
Block a user