Don't filter RPMs of reused components from a module that depends on itself

If a module has filters set and it buildrequires itself, issues occur
during component reuse. In that event, the filtered RPMs from the
previous module build will not be available in the buildroot because the NVRs
in the filters will match the RPMs from the reused component.

Co-authored-by: Jan Kaluza <jkaluza@redhat.com>
This commit is contained in:
mprahl
2018-08-09 19:37:17 -04:00
parent f422b82ce7
commit d54422adeb
3 changed files with 154 additions and 5 deletions

View File

@@ -167,7 +167,7 @@ def attempt_to_reuse_all_components(builder, session, module):
return True
def get_reusable_components(session, module, component_names):
def get_reusable_components(session, module, component_names, previous_module_build=None):
"""
Returns the list of ComponentBuild instances belonging to previous module
build which can be reused in the build of module `module`.
@@ -181,6 +181,9 @@ def get_reusable_components(session, module, component_names):
:param session: SQLAlchemy database session
:param module: the ModuleBuild object of module being built.
:param component_names: List of component names to be reused.
:kwarg previous_module_build: the ModuleBuild instance of a module build
which contains the components to reuse. If not passed, get_reusable_module
is called to get the ModuleBuild instance.
:return: List of ComponentBuild instances to reuse in the same
order as `component_names`
"""
@@ -188,7 +191,8 @@ def get_reusable_components(session, module, component_names):
if conf.system not in ['koji', 'test']:
return [None] * len(component_names)
previous_module_build = get_reusable_module(session, module)
if not previous_module_build:
previous_module_build = get_reusable_module(session, module)
if not previous_module_build:
return [None] * len(component_names)