#84 Fix libmodulemd usage for changes in libmodulemd-1.5
Closed a year ago by nphilipp. Opened a year ago by otaylor.
modularity/ otaylor/fedmod libmodulemd-peek  into  master

@@ -27,7 +27,7 @@ 

      mmd_str = build['extra']['typeinfo']['module']['modulemd_str']

      mmd = Modulemd.Module.new_from_string(mmd_str)

  

-     return set(mmd.props.profiles['runtime'].props.rpms.get())

+     return set(mmd.peek_profiles()['runtime'].peek_rpms().get())

  

  

  class FlatpakGenerator(ModuleGenerator):

@@ -66,7 +66,7 @@ 

          are information taken from SPEC file.

          :return:

          """

-         self.mmd.props.module_licenses.add("MIT")

+         self.mmd.peek_module_licenses().add("MIT")

  

          # FIXME: This and:

          # https://fedoraproject.org/wiki/Module:Guidelines?rd=Fedora_Packaging_Guidelines_for_Modules

@@ -87,7 +87,7 @@ 

  

          # Declare the public API

          for pkg in self.api_srpms:

-             self.mmd.props.rpm_api.add(pkg)

+             self.mmd.peek_rpm_api().add(pkg)

  

              component = Modulemd.ComponentRpm(name=pkg,

                                                rationale="Package in api",

@@ -114,7 +114,7 @@ 

  

  

      def _get_build_order(self, pkg):

-         if self.mmd.props.rpm_api.contains(pkg):

+         if self.mmd.peek_rpm_api().contains(pkg):

              return 10

          else:

              return 0

From libmodulemd 1.4 to 1.5, many mmd.props.X were changed to copy
X rather than returning a pointer to X - this means that something
like mmd.props.rpm_api.add(pkg) no longer works as expected. Change
these usages to mmd.props.peek_rpm_api().add(pkg).

Metadata Update from @nphilipp:
- Request assigned

a year ago

LGTM, I'll rebase and apply.

applied in commit 106e464

Pull-Request has been closed by nphilipp

a year ago