From 3130d837c064588d7942e0f5973d9e59792587bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 17 May 2017 13:52:39 +0200 Subject: [PATCH] gather: Don't resolve dependencies in lookaside MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When looking at a package in a lookaside repo, it does not make much sense to process its dependencies. We should just assume that the lookaside can satisfy them. In the worst case, this could result in packages being pulled into the compose just so that they could satisfy a dep of something in lookaside. Signed-off-by: Lubomír Sedlář --- pungi/gather.py | 6 ++++++ pungi/gather_dnf.py | 4 ++++ tests/test_gather.py | 7 +------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/pungi/gather.py b/pungi/gather.py index f11d4bc7..bf95cf99 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -606,6 +606,9 @@ class Pungi(PungiBase): """Add the dependencies for a given package to the transaction info""" added = set() + if po.repoid in self.lookaside_repos: + # Don't resolve deps for stuff in lookaside. + return added if po in self.completed_depsolve: return added self.completed_depsolve.add(po) @@ -1111,6 +1114,9 @@ class Pungi(PungiBase): added = set() for srpm_po in srpms: + if srpm_po.repoid in self.lookaside_repos: + # Don't run fulltree on packages in lookaside + continue include_native = False include_multilib = False has_native = False diff --git a/pungi/gather_dnf.py b/pungi/gather_dnf.py index 2eafdbf5..1b030be8 100644 --- a/pungi/gather_dnf.py +++ b/pungi/gather_dnf.py @@ -289,6 +289,10 @@ class Gather(GatherBase): assert pkg is not None result = set() + if pkg.repoid in self.opts.lookaside_repos: + # Don't resolve deps for stuff in lookaside. + return result + # DNF package has the _pre and _post attributes only if they are not # empty. requires = (pkg.requires + diff --git a/tests/test_gather.py b/tests/test_gather.py index f532837b..ffa990de 100644 --- a/tests/test_gather.py +++ b/tests/test_gather.py @@ -617,7 +617,6 @@ class DepsolvingBase(object): self.assertNotIn("dummy-krb5-1.10-5.src.rpm", pkg_map["srpm"]) self.assertItemsEqual(pkg_map["rpm"], [ - "dummy-bash-4.2.37-6.x86_64.rpm", "dummy-basesystem-10.0-6.noarch.rpm", "dummy-filesystem-4.2.37-6.x86_64.rpm", "Dummy-firefox-16.0.1-1.x86_64.rpm", # Important @@ -626,7 +625,6 @@ class DepsolvingBase(object): "Dummy-xulrunner-16.0.1-1.x86_64.rpm", ]) self.assertItemsEqual(pkg_map["srpm"], [ - "dummy-bash-4.2.37-6.src.rpm", "dummy-basesystem-10.0-6.src.rpm", "dummy-filesystem-4.2.37-6.src.rpm", "Dummy-firefox-16.0.1-1.src.rpm", @@ -634,7 +632,6 @@ class DepsolvingBase(object): "Dummy-xulrunner-16.0.1-1.src.rpm", ]) self.assertItemsEqual(pkg_map["debuginfo"], [ - "dummy-bash-debuginfo-4.2.37-6.x86_64.rpm", "Dummy-firefox-debuginfo-16.0.1-1.x86_64.rpm", "dummy-glibc-debuginfo-2.14-5.x86_64.rpm", "dummy-glibc-debuginfo-common-2.14-5.x86_64.rpm", @@ -1713,10 +1710,8 @@ class DNFDepsolvingTestCase(DepsolvingBase, unittest.TestCase): def test_firefox_selfhosting_with_krb5_lookaside(self): super(DNFDepsolvingTestCase, self).test_firefox_selfhosting_with_krb5_lookaside() - self.assertFlags("dummy-krb5-1.10-5.x86_64", [PkgFlag.lookaside]) self.assertFlags("dummy-krb5-devel-1.10-5.x86_64", [PkgFlag.lookaside]) - self.assertFlags("dummy-krb5-libs-1.10-5.x86_64", [PkgFlag.lookaside]) - self.assertFlags("dummy-krb5-1.10-5.src", [PkgFlag.lookaside, PkgFlag.self_hosting]) + self.assertFlags("dummy-krb5-1.10-5.src", [PkgFlag.lookaside]) self.assertFlags("dummy-krb5-debuginfo-1.10-5.x86_64", [PkgFlag.lookaside]) if __name__ == "__main__":