#1000 Copy the buildrequires which are not in requires list to expanded MMD.
Merged 11 months ago by mprahl. Opened 11 months ago by jkaluza.
jkaluza/fm-orchestrator mse-missin-buildrequires  into  master

@@ -338,6 +338,14 @@ 

                  # 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 @@ 

                   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 @@ 

                   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 @@ 

                   frozenset(['app:1:0:c6', 'platform:f29:0:c11'])

               ]),

               set([

-                  frozenset([])

+                  frozenset(['app:1'])

               ])),

          ])

      def test_generate_expanded_mmds_buildrequires(

This fixes issues with missing buildrequires in expanded MMD in case the buildrequired module appeared only in buildrequires section but not in requires section.

rebased onto dad03d3

11 months ago

Pull-Request has been merged by mprahl

11 months ago