Skip to content

Commit

Permalink
Fix pacman interaction with new realtime output
Browse files Browse the repository at this point in the history
  • Loading branch information
k4z4n0v4 committed Apr 1, 2024
1 parent 354f629 commit 4cee32c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
rpm/
pkgs/

__pycache__/
10 changes: 5 additions & 5 deletions vmupdate/agent/source/pacman/pacman_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.

from typing import List
from typing import List,Dict

from source.common.package_manager import PackageManager
from source.common.process_result import ProcessResult
Expand All @@ -28,7 +28,7 @@
class PACMANCLI(PackageManager):
def __init__(self, log_handler, log_level):
super().__init__(log_handler, log_level)
self.package_manager: str = "pacman"
self.package_manager = "pacman"

def refresh(self, hard_fail: bool) -> ProcessResult:
"""
Expand All @@ -40,17 +40,17 @@ def refresh(self, hard_fail: bool) -> ProcessResult:
cmd = [self.package_manager, "-Sy"]
return self.run_cmd(cmd)

def get_packages(self):
def get_packages(self) -> Dict[str, List[str]]:
"""
Use pacman to return the installed packages and their versions.
"""

cmd = [self.package_manager, "-Q"]
# EXAMPLE OUTPUT:
# qubes-vm-core 4.2.25-1
result = self.run_cmd(cmd)
result = self.run_cmd(cmd, realtime=False)

packages = {}
packages: Dict[str, List[str]] = {}
for line in result.out.splitlines():
cols = line.split()
package, version = cols
Expand Down

0 comments on commit 4cee32c

Please sign in to comment.