#4156 kiwi: Add support for overriding image type attributes
Merged 8 months ago by tkopecek. Opened 8 months ago by ngompa.
ngompa/koji kiwi-type-attrs  into  master

file modified
+2
@@ -389,6 +389,8 @@ 

              '--description', os.path.join(os.path.basename(scmsrcdir), base_path),

              '--target-dir', target_dir,

          ])

+         for typeattr in self.opts.get('type_attr', [])::

+             cmd.extend(['--set-type-attr', typeattr])

          rv = broot.mock(['--cwd', broot.tmpdir(within=True), '--chroot', '--'] + cmd)

          if rv:

              raise koji.GenericError("Kiwi failed")

file modified
+5
@@ -28,6 +28,9 @@ 

      parser.add_option("--kiwi-profile", action="store", default=None,

                        help="Select profile from description file")

      parser.add_option("--type", help="Override default build type from description")

+     parser.add_option("--type-attr", action="append", default=[],

+                       help="Override default attributes for the build type from description. "

+                            "May be used multiple times.")

      parser.add_option("--make-prep", action="store_true", default=False,

                        help="Run 'make prep' in checkout before starting the build")

      parser.add_option("--can-fail", action="store", dest="optional_arches",
@@ -68,6 +71,8 @@ 

          kwargs['make_prep'] = True

      if options.type:

          kwargs['type'] = options.type

+     if options.type_attr:

+         kwargs['type_attr'] = options.type_attr

      if options.arches:

          kwargs['arches'] = [canonArch(arch) for arch in options.arches]

      if options.repo:

file modified
+5 -1
@@ -17,13 +17,15 @@ 

  @export

  def kiwiBuild(target, arches, desc_url, desc_path, optional_arches=None, profile=None,

                scratch=False, priority=None, make_prep=False, repos=None, release=None,

-               type=None):

+               type=None, type_attr=None):

      context.session.assertPerm('image')

      for i in [desc_url, desc_path, profile, release]:

          if i is not None:

              kojihub.convert_value(i, cast=str, check_only=True)

      if repos:

          kojihub.convert_value(repos, cast=list, check_only=True)

+     if type_attr:

+         kojihub.convert_value(type_attr, cast=list, check_only=True)

      kojihub.get_build_target(target, strict=True)

      if isinstance(arches, list):

          arches = " ".join(arches)
@@ -58,6 +60,8 @@ 

          opts['make_prep'] = True

      if type:

          opts['type'] = type

+     if type_attr:

+         opts['type_attr'] = type_attr

      return kojihub.make_task('kiwiBuild',

                               [target, arches, desc_url, desc_path, opts],

                               **taskOpts)

This allows setting things like the volume and application IDs for ISO builds.

Can we get this landed as part of koji 1.35?

rebased onto 8a6857f

8 months ago

rebased onto 8a6857f

8 months ago

Metadata Update from @tkopecek:
- Pull-request tagged with: no_qe

8 months ago

Commit bd21b60 fixes this pull-request

Pull-Request has been merged by tkopecek

8 months ago