Skip to content

Commit

Permalink
Parse repo in pacman output (#766)
Browse files Browse the repository at this point in the history
Adds GitLab + Docker-based pacman test environment. Refs #561.
  • Loading branch information
dilawar authored Sep 25, 2022
1 parent 96f8d48 commit c4060a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pacman:
image: archlinux
script:
- pacman -Sy --noconfirm python-pip
- python -m pip install poetry
- poetry install
- python -m pip install .
- mpm --pacman -v DEBUG install vim
4 changes: 2 additions & 2 deletions meta_package_manager/managers/pacman.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ def search(self, query: str, extended: bool, exact: bool) -> Iterator[Package]:
output = self.run_cli("--sync", "--search", query)

regexp = re.compile(
r"(?P<package_id>\S+)\s+(?P<version>\S+).*\n\s+(?P<description>.+)",
r"(?P<repo_id>\S+?)/(?P<package_id>\S+)\s+(?P<version>\S+).*\n\s+(?P<description>.+)",
re.MULTILINE | re.VERBOSE,
)

for package_id, version, description in regexp.findall(output):
for repo_id, package_id, version, description in regexp.findall(output):
yield self.package(
id=package_id,
description=description,
Expand Down

0 comments on commit c4060a1

Please sign in to comment.