trim version from provides list

Closes #87
This commit is contained in:
Evgenii Alekseev 2023-01-30 17:27:34 +02:00
parent 25eee9ca5e
commit 9d7f63e549
2 changed files with 6 additions and 2 deletions

View File

@ -25,6 +25,7 @@ from typing import Any, Callable, Generator, Set
from ahriman.core.configuration import Configuration
from ahriman.core.log import LazyLogging
from ahriman.core.util import trim_package
from ahriman.models.repository_paths import RepositoryPaths
@ -175,8 +176,10 @@ class Pacman(LazyLogging):
result: Set[str] = set()
for database in self.handle.get_syncdbs():
for package in database.pkgcache:
result.add(package.name) # package itself
result.update(package.provides) # provides list for meta-packages
# package itself
result.add(package.name)
# provides list for meta-packages
result.update(trim_package(provides) for provides in package.provides)
return result

View File

@ -207,3 +207,4 @@ def test_packages_with_provides(pacman: Pacman) -> None:
package list must contain provides packages
"""
assert "sh" in pacman.packages()
assert "mysql" in pacman.packages() # mariadb