mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-09 08:44:15 +02:00
[gems.arch] fix: not considering some conflict expressions when retrieving upgrade requirements
This commit is contained in:
@@ -5,7 +5,7 @@ import shutil
|
||||
import traceback
|
||||
from io import StringIO
|
||||
from threading import Thread
|
||||
from typing import List, Set, Tuple, Dict, Iterable, Optional, Any, Pattern
|
||||
from typing import List, Set, Tuple, Dict, Iterable, Optional, Any, Pattern, Collection
|
||||
|
||||
from colorama import Fore
|
||||
|
||||
@@ -1081,3 +1081,18 @@ def map_available_packages() -> Optional[Dict[str, Any]]:
|
||||
'r': package_data[0].strip(),
|
||||
'i': len(package_data) == 4 and 'installed' in package_data[3]}
|
||||
return res
|
||||
|
||||
|
||||
def map_installed(pkgs: Optional[Collection[str]] = None) -> Optional[Dict[str, str]]:
|
||||
output = run_cmd(f"pacman -Q {' '.join({*pkgs} if pkgs else '')}".strip(), print_error=False)
|
||||
|
||||
if output:
|
||||
res = dict()
|
||||
for raw_line in output.split("\n"):
|
||||
line = raw_line.strip()
|
||||
|
||||
if line:
|
||||
pkg_version = line.split(" ")
|
||||
if len(pkg_version) == 2:
|
||||
res[pkg_version[0]] = pkg_version[1]
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user