gather: Add fulltree-exclude flag to DNF backend

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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-08-14 16:01:21 +02:00
parent 23ca2fe5d2
commit a8cd78faf9
2 changed files with 4 additions and 1 deletions

View File

@ -137,7 +137,7 @@ def main(persistdir, cachedir):
def _get_flags(gather_obj, pkg): def _get_flags(gather_obj, pkg):
flags = gather_obj.result_package_flags.get(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 return flags

View File

@ -101,6 +101,7 @@ class PkgFlag(Enum):
fulltree = 64 fulltree = 64
multilib = 128 multilib = 128
langpack = 256 langpack = 256
fulltree_exclude = 512
class GatherBase(object): class GatherBase(object):
@ -277,6 +278,8 @@ class Gather(GatherBase):
# lookaside # lookaside
if i.repoid in self.opts.lookaside_repos: if i.repoid in self.opts.lookaside_repos:
self._set_flag(i, PkgFlag.lookaside) 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) self.result_binary_packages.update(added)