mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-04 19:28:49 +08:00
Copy the buildrequires which are not in requires list to expanded MMD.
This commit is contained in:
@@ -338,6 +338,14 @@ def generate_expanded_mmds(session, mmd, raise_if_stream_ambigous=False, default
|
||||
# really used in this resolved variant.
|
||||
new_dep.add_requires(req_name, [req_name_stream[req_name]])
|
||||
new_dep.add_buildrequires(req_name, [req_name_stream[req_name]])
|
||||
|
||||
# There might be buildrequires which are not in runtime requires list.
|
||||
# Such buildrequires must be copied to expanded MMD.
|
||||
for req_name, req_streams in dep_buildrequires.items():
|
||||
if req_name not in dep_requires:
|
||||
new_dep.add_buildrequires(req_name, [req_name_stream[req_name]])
|
||||
|
||||
# Set the new dependencies.
|
||||
mmd_copy.set_dependencies((new_dep, ))
|
||||
|
||||
# The Modulemd.Dependencies() stores only streams, but to really build this
|
||||
|
||||
@@ -160,6 +160,16 @@ class TestUtilsModuleStreamExpansion:
|
||||
frozenset(['gtk:2']),
|
||||
])),
|
||||
|
||||
({"foo": ["1"]}, {"foo": ["1"], "gtk": ["1", "2"]}, True,
|
||||
set([
|
||||
frozenset(['foo:1:0:c2', 'gtk:1:0:c2', 'platform:f28:0:c10']),
|
||||
frozenset(['foo:1:0:c2', 'gtk:2:0:c4', 'platform:f28:0:c10'])
|
||||
]),
|
||||
set([
|
||||
frozenset(['foo:1', 'gtk:1']),
|
||||
frozenset(['foo:1', 'gtk:2'])
|
||||
])),
|
||||
|
||||
({"gtk": ["1"], "foo": ["1"]}, {"gtk": ["1"], "foo": ["1"]}, False,
|
||||
set([
|
||||
frozenset(['foo:1:0:c2', 'gtk:1:0:c2', 'platform:f28:0:c10'])
|
||||
@@ -173,7 +183,7 @@ class TestUtilsModuleStreamExpansion:
|
||||
frozenset(['foo:1:0:c2', 'gtk:1:0:c2', 'platform:f28:0:c10'])
|
||||
]),
|
||||
set([
|
||||
frozenset(['foo:1', 'gtk:1'])
|
||||
frozenset(['foo:1', 'gtk:1', 'platform:f28'])
|
||||
])),
|
||||
|
||||
({"gtk": ["-2"], "foo": ["-2"]}, {"gtk": ["-2"], "foo": ["-2"]}, True,
|
||||
@@ -213,7 +223,7 @@ class TestUtilsModuleStreamExpansion:
|
||||
frozenset(['app:1:0:c6', 'platform:f29:0:c11'])
|
||||
]),
|
||||
set([
|
||||
frozenset([])
|
||||
frozenset(['app:1'])
|
||||
])),
|
||||
])
|
||||
def test_generate_expanded_mmds_buildrequires(
|
||||
|
||||
Reference in New Issue
Block a user