From a8cd78faf95101f80dc27d02efa10eb66611a41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Mon, 14 Aug 2017 16:01:21 +0200 Subject: [PATCH] gather: Add fulltree-exclude flag to DNF backend MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed for correct trimming of addons and optional. A package pulled in as a dependency but that matches something on fulltree exclude list should have this flag. It will then be moved from addon to base variant and therefore excluded from optional. Signed-off-by: Lubomír Sedlář --- bin/pungi-gather | 2 +- pungi/gather_dnf.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/pungi-gather b/bin/pungi-gather index 9bbda922..a497edfd 100755 --- a/bin/pungi-gather +++ b/bin/pungi-gather @@ -137,7 +137,7 @@ def main(persistdir, cachedir): def _get_flags(gather_obj, pkg): flags = gather_obj.result_package_flags.get(pkg, []) - flags = "(%s)" % ",".join(sorted(f.name for f in flags)) + flags = "(%s)" % ",".join(sorted(f.name.replace('_', '-') for f in flags)) return flags diff --git a/pungi/gather_dnf.py b/pungi/gather_dnf.py index 44f5efda..01983f4c 100644 --- a/pungi/gather_dnf.py +++ b/pungi/gather_dnf.py @@ -101,6 +101,7 @@ class PkgFlag(Enum): fulltree = 64 multilib = 128 langpack = 256 + fulltree_exclude = 512 class GatherBase(object): @@ -277,6 +278,8 @@ class Gather(GatherBase): # lookaside if i.repoid in self.opts.lookaside_repos: self._set_flag(i, PkgFlag.lookaside) + if i.sourcerpm.rsplit('-', 2)[0] in self.opts.fulltree_excludes: + self._set_flag(i, PkgFlag.fulltree_exclude) self.result_binary_packages.update(added)