Handle Requires(pre|post)

These requires are accessible from a separate attribute, but we want to
handle them the same ways as regular Requires.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-01-23 09:55:26 +01:00
parent 2f40a45708
commit fe026bb588
2 changed files with 8 additions and 6 deletions

View File

@ -278,8 +278,14 @@ class Gather(GatherBase):
assert pkg is not None
result = set()
q = self.q_binary_packages.filter(provides=pkg.requires).apply()
for req in pkg.requires:
# DNF package has the _pre and _post attributes only if they are not
# empty.
requires = (pkg.requires +
getattr(pkg, 'requires_pre', []) +
getattr(pkg, 'requires_post', []))
q = self.q_binary_packages.filter(provides=requires).apply()
for req in requires:
deps = self.finished_get_package_deps_reqs.setdefault(str(req), set())
if deps:
result.update(deps)

View File

@ -1709,10 +1709,6 @@ class DNFDepsolvingTestCase(DepsolvingBase, unittest.TestCase):
def test_bash_older(self):
pass
@unittest.skip('Not implemented yet')
def test_requires_pre_post(self):
pass
@unittest.skip('Not implemented yet')
def test_multilib_exclude_pattern_does_not_match_noarch(self):
pass