From ba3935fc077036ba415991b208e3db4166e017db Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 24 Sep 2022 14:07:33 +0530 Subject: [PATCH 1/6] feat (ci): gitlab ci for pacman --- .gitlab-ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .gitlab-ci.yaml diff --git a/.gitlab-ci.yaml b/.gitlab-ci.yaml new file mode 100644 index 000000000..a1a366fce --- /dev/null +++ b/.gitlab-ci.yaml @@ -0,0 +1,8 @@ +pacman: + image: archlinux + script: + - pacman -Sy --noconfirm python + - python -m pip install poetry + - poetry run pytest + - python -m pip install . + - mpm --pacman install vim From 72eac871eca52f75b0cdf204334d285e2db19041 Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 24 Sep 2022 14:08:13 +0530 Subject: [PATCH 2/6] chore: renames --- .gitlab-ci.yaml => .gitlab-ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .gitlab-ci.yaml => .gitlab-ci.yml (100%) diff --git a/.gitlab-ci.yaml b/.gitlab-ci.yml similarity index 100% rename from .gitlab-ci.yaml rename to .gitlab-ci.yml From 84d2daa5cda6e83a283de54519b6702e4b93807f Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 24 Sep 2022 14:27:56 +0000 Subject: [PATCH 3/6] ci: gitlab pipeline for pacman `gitlab-runner exec docker pacman` runs the pipeline. And it fails. --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a1a366fce..401c64830 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,8 @@ pacman: image: archlinux script: - - pacman -Sy --noconfirm python + - pacman -Sy --noconfirm python-pip - python -m pip install poetry - - poetry run pytest + - poetry install - python -m pip install . - mpm --pacman install vim From 797646e67e7f1aebbcaa79ccf8292c18a264ecc6 Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 24 Sep 2022 14:47:50 +0000 Subject: [PATCH 4/6] temp: --- .gitlab-ci.yml | 2 +- meta_package_manager/base.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 401c64830..509675e7b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,4 +5,4 @@ pacman: - python -m pip install poetry - poetry install - python -m pip install . - - mpm --pacman install vim + - mpm --pacman -v DEBUG install vim diff --git a/meta_package_manager/base.py b/meta_package_manager/base.py index 415970343..dd79041c6 100644 --- a/meta_package_manager/base.py +++ b/meta_package_manager/base.py @@ -757,6 +757,7 @@ def refiltered_search( capabilities of the package manager CLI. """ for match in self.search(query, extended, exact): + logger.debug(f" match {match} for query {query}") # Look by default into package ID and name. search_content = {match.id, match.name} From 2ab1e3b3fec628df500cb57e41db63b193664367 Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 24 Sep 2022 20:37:56 +0530 Subject: [PATCH 5/6] feat: `mpm --pacman install neovim` works now. --- meta_package_manager/base.py | 3 ++- meta_package_manager/managers/pacman.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meta_package_manager/base.py b/meta_package_manager/base.py index dd79041c6..d2faaaaff 100644 --- a/meta_package_manager/base.py +++ b/meta_package_manager/base.py @@ -757,10 +757,11 @@ def refiltered_search( capabilities of the package manager CLI. """ for match in self.search(query, extended, exact): - logger.debug(f" match {match} for query {query}") # Look by default into package ID and name. search_content = {match.id, match.name} + logger.debug(f"111 match for query {query}: {search_content}. {exact=} {extended=}") + # Rejects fuzzy results: only keep packages strictly matching on ID or name. if exact and query not in search_content: continue diff --git a/meta_package_manager/managers/pacman.py b/meta_package_manager/managers/pacman.py index 16cc0db0b..3d874a5a4 100644 --- a/meta_package_manager/managers/pacman.py +++ b/meta_package_manager/managers/pacman.py @@ -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\S+)\s+(?P\S+).*\n\s+(?P.+)", + r"(?P\S+?)/(?P\S+)\s+(?P\S+).*\n\s+(?P.+)", 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, From c7eb863345947bf6f0cdd0bd5995368422dd0414 Mon Sep 17 00:00:00 2001 From: Dilawar Singh Date: Sat, 24 Sep 2022 20:38:57 +0530 Subject: [PATCH 6/6] chore: removed stray debug message --- meta_package_manager/base.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/meta_package_manager/base.py b/meta_package_manager/base.py index d2faaaaff..415970343 100644 --- a/meta_package_manager/base.py +++ b/meta_package_manager/base.py @@ -760,8 +760,6 @@ def refiltered_search( # Look by default into package ID and name. search_content = {match.id, match.name} - logger.debug(f"111 match for query {query}: {search_content}. {exact=} {extended=}") - # Rejects fuzzy results: only keep packages strictly matching on ID or name. if exact and query not in search_content: continue