#1375 Fix name s2nsvc in MMDResolver.solve
Merged 4 years ago by cqi. Opened 4 years ago by cqi.
cqi/fm-orchestrator fix-name-s2nsvc  into  master

@@ -447,7 +447,7 @@ 

          self.pool.createwhatprovides()

  

          # "solvable to n:s:v:c"

-         s2nsvc = lambda s: "%s:%s" % (s.name, s.arch)

+         s2nsvca = lambda s: "%s:%s" % (s.name, s.arch)

          # "solvable to n:s"

          s2ns = lambda s: ":".join(s.name.split(":", 2)[:2])

  
@@ -474,7 +474,7 @@ 

              elif len(requires) == 0:

                  # Return early in case the requires is empty, because it basically means

                  # the module has no buildrequires section.

-                 return set([frozenset([s2nsvc(src)])])

+                 return set([frozenset([s2nsvca(src)])])

  

              requires = requires[0]

              src_alternatives = alternatives[src] = collections.OrderedDict()
@@ -521,7 +521,7 @@ 

                  # This will allow us to group alternatives for single NS in case of First

                  # policy and later return just the first alternative.

                  if policy == MMDResolverPolicy.All:

-                     kfunc = s2nsvc

+                     kfunc = s2nsvca

                  elif policy == MMDResolverPolicy.First:

                      kfunc = s2ns

                  # `key` contains tuple similar to "('gtk:1', 'foo:1')"
@@ -620,7 +620,7 @@ 

  

          # Convert the solvables in alternatives to nsvc and return them as set of frozensets.

          return set(

-             frozenset(s2nsvc(s) for s in transactions[0])

+             frozenset(s2nsvca(s) for s in transactions[0])

              for src_alternatives in alternatives.values()

              for transactions in src_alternatives.values()

          )

The original name s2nsvc does not contain the name of arch.

Signed-off-by: Chenxiong Qi cqi@redhat.com

Build #319 failed (commit: 3c5c29739fb382719e9d1ff84cca60951dda23e5).
Rebase or make new commits to rebuild.

rebased onto 5457e03d3cefcd2372ac90cdb7aa7b95dca3784c

4 years ago

rebased onto 3b95b09

4 years ago

Commit b185b51 fixes this pull-request

Pull-Request has been merged by cqi

4 years ago

Pull-Request has been merged by cqi

4 years ago