mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-05-12 19:07:12 +08:00
Fix filters generation
This commit is contained in:
@@ -1071,6 +1071,17 @@ chmod 644 %buildroot/etc/rpm/macros.zz-modules
|
||||
|
||||
return weights
|
||||
|
||||
@classmethod
|
||||
def get_built_rpms_in_module_build(cls, build):
|
||||
"""
|
||||
:param ModuleBuild build: Module build to get the built RPMs from.
|
||||
:return: list of NVRs
|
||||
"""
|
||||
koji_session = KojiModuleBuilder.get_session(conf, None)
|
||||
rpms = koji_session.listTaggedRPMS(build.koji_tag, latest=True)[0]
|
||||
nvrs = set(kobo.rpmlib.make_nvr(rpm, force_epoch=True) for rpm in rpms)
|
||||
return list(nvrs)
|
||||
|
||||
def finalize(self):
|
||||
# Only import to koji CG if the module is "done".
|
||||
if self.config.koji_enable_content_generator and self.module.state == 3:
|
||||
|
||||
@@ -336,6 +336,14 @@ class GenericBuilder(six.with_metaclass(ABCMeta)):
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@classmethod
|
||||
def get_built_rpms_in_module_build(cls, build):
|
||||
"""
|
||||
:param ModuleBuild build: Module build to get the built RPMs from.
|
||||
:return: list of NVRs
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
@classmethod
|
||||
def recover_orphaned_artifact(cls, component_build):
|
||||
"""
|
||||
|
||||
@@ -20,6 +20,9 @@
|
||||
# SOFTWARE.
|
||||
#
|
||||
# Written by Matt Prahl <mprahl@redhat.com>
|
||||
# Jan Kaluza <jkaluza@redhat.com>
|
||||
|
||||
import kobo.rpmlib
|
||||
|
||||
from module_build_service import log
|
||||
from module_build_service.resolver.base import GenericResolver
|
||||
@@ -177,6 +180,7 @@ class DBResolver(GenericResolver):
|
||||
:param requires: a dictionary with the module name as the key and the stream as the value
|
||||
:return: a dictionary
|
||||
"""
|
||||
from module_build_service.builder import GenericBuilder
|
||||
new_requires = {}
|
||||
with models.make_session(self.config) as session:
|
||||
for nsvc in requires:
|
||||
@@ -236,9 +240,12 @@ class DBResolver(GenericResolver):
|
||||
# Find out the particular NVR of filtered packages
|
||||
rpm_filter = mmd.get_rpm_filter()
|
||||
if rpm_filter and rpm_filter.get():
|
||||
for rpm in build.component_builds:
|
||||
if rpm.package in rpm_filter.get():
|
||||
filtered_rpms.append(rpm.nvr)
|
||||
rpm_filter = rpm_filter.get()
|
||||
built_nvrs = GenericBuilder.get_built_rpms_in_module_build(build)
|
||||
for nvr in built_nvrs:
|
||||
parsed_nvr = kobo.rpmlib.parse_nvr(nvr)
|
||||
if parsed_nvr["name"] in rpm_filter:
|
||||
filtered_rpms.append(nvr)
|
||||
|
||||
new_requires[module_name] = {
|
||||
'ref': commit_hash,
|
||||
|
||||
Reference in New Issue
Block a user