#3211 save modified .kiwi files per arch
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji issue3200  into  master

file modified
+8 -6
@@ -184,7 +184,7 @@ 

      Methods = ['createKiwiImage']

      _taskWeight = 2.0

  

-     def prepareDescription(self, desc_path, name, version, repos):

+     def prepareDescription(self, desc_path, name, version, repos, arch):

          kiwi_files = glob.glob('%s/*.kiwi' % desc_path)

          if len(kiwi_files) != 1:

              raise koji.GenericError("Repo must contain only one .kiwi file.")
@@ -234,14 +234,16 @@ 

                  # TODO: if type.getAttribute('primary') == 'true':

                  types.append(type.getAttribute('image'))

  

-         # write file back

-         with open(cfg, 'wt') as f:

+         # write new file

+         newcfg = f'{cfg[:-5]}.{arch}.kiwi'

+         with open(newcfg, 'wt') as f:

              s = newxml.toprettyxml()

              # toprettyxml adds too many whitespaces/newlines

              s = '\n'.join([x for x in s.splitlines() if x.strip()])

              f.write(s)

+         os.unlink(cfg)

  

-         return cfg, types

+         return newcfg, types

  

      def getImagePackagesFromCache(self, cachepath):

          """
@@ -353,7 +355,7 @@ 

                  raise koji.GenericError("Preparation step failed")

  

          path = os.path.join(scmsrcdir, desc_path)

-         desc, types = self.prepareDescription(path, name, version, repos)

+         desc, types = self.prepareDescription(path, name, version, repos, arch)

          self.uploadFile(desc)

  

          cmd = ['kiwi-ng']
@@ -396,7 +398,7 @@ 

          # build/image-root.log

          root_log_path = os.path.join(broot.tmpdir(), target_dir[1:], "build/image-root.log")

          if os.path.exists(root_log_path):

-             self.uploadFile(root_log_path, remoteName="image-root.log")

+             self.uploadFile(root_log_path, remoteName=f"image-root.{arch}.log")

  

          bundle_path = os.path.join(broot.rootdir(), bundle_dir[1:])

          for fname in os.listdir(bundle_path):

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready

2 years ago

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

2 years ago

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready

2 years ago

But this does not cover the hw_info.log, state.log, mock_output.log, build.log and root.log, does it?

If you got a tag with two archs the children will produce the same log files, which names collide when putting it together on the hub side.

This should be ok - these logs are not merged to parent task. They'll stay as part of per-arch task, so in different directories.

rebased onto 7feb94c

2 years ago

Metadata Update from @jcupova:
- Pull-request tagged with: testing-ready

2 years ago

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

2 years ago

Commit 355be92 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago