Replace skip_extra_repos -> with_extra_repos (MR 2480)

Replace the boolean skip_extra_repos with a new with_extra_repos
argument that can be default, enabled or disabled.

This will be used to explicitly enable extra repos in a package search
even if systemd is currently disabled, so we can display a hint when a
package was not found because systemd is disabled in a follow-up patch.
This commit is contained in:
Oliver Smith 2024-11-07 18:04:06 +01:00
parent 444d9e256f
commit 0a0f6ead33
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
6 changed files with 51 additions and 28 deletions

View file

@ -19,6 +19,7 @@ def test_pkgrepo_pmaports(pmaports, monkeypatch):
# Disable results caching
pkgrepo_paths.cache_disable()
pkgrepo_default_path.cache_disable()
paths = pkgrepo_paths()
print(f"[master] pkgrepo_paths: {paths}")
@ -37,7 +38,10 @@ def test_pkgrepo_pmaports(pmaports, monkeypatch):
== 0
)
paths = pkgrepo_paths()
paths = pkgrepo_paths(with_extra_repos="disabled")
assert len(paths) == 1
paths = pkgrepo_paths(with_extra_repos="enabled")
assert len(paths) == 2
# systemd is the first path, since we want packages there to take priority