mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-13 21:29:57 +08:00
Require non-devel module in -devel module. Clear API list and profiles for -devel.
This commit is contained in:
@@ -618,8 +618,17 @@ class KojiContentGenerator(object):
|
||||
"""
|
||||
mmd = self._sanitize_mmd(self.module.mmd())
|
||||
if self.devel:
|
||||
# Depend on the actual module
|
||||
for dep in mmd.get_dependencies():
|
||||
dep.add_requires_single(mmd.get_name(), mmd.get_stream())
|
||||
|
||||
# Set the new name
|
||||
mmd.set_name(mmd.get_name() + "-devel")
|
||||
|
||||
# Delete API and profiles
|
||||
mmd.set_rpm_api(Modulemd.SimpleSet())
|
||||
mmd.clear_profiles()
|
||||
|
||||
# Set the "Arch" field in mmd.
|
||||
mmd.set_arch(pungi.arch.tree_arch_to_yum_arch(arch))
|
||||
# Fill in the list of built RPMs.
|
||||
|
||||
@@ -644,3 +644,19 @@ class TestBuild:
|
||||
file_dir = self.cg._prepare_file_directory()
|
||||
with open(path.join(file_dir, "modulemd.src.txt")) as mmd:
|
||||
assert len(mmd.read()) == 1337
|
||||
|
||||
def test_finalize_mmd_devel(self):
|
||||
self.cg.devel = True
|
||||
mmd = self.cg.module.mmd()
|
||||
new_mmd = Modulemd.Module.new_from_string(self.cg._finalize_mmd("x86_64"))
|
||||
|
||||
# Check that -devel suffix is set.
|
||||
assert new_mmd.get_name().endswith("-devel")
|
||||
|
||||
# Check that -devel requires non-devel.
|
||||
for dep in new_mmd.get_dependencies():
|
||||
requires = []
|
||||
for name, streams in dep.get_requires().items():
|
||||
for stream in streams.get():
|
||||
requires.append("%s:%s" % (name, stream))
|
||||
assert "%s:%s" % (mmd.get_name(), mmd.get_stream()) in requires
|
||||
|
||||
Reference in New Issue
Block a user