| |
@@ -11,6 +11,12 @@
|
| |
from ..wrappers import kojiwrapper
|
| |
from .image_build import EXTENSIONS
|
| |
|
| |
+ KIWIEXTENSIONS = [
|
| |
+ ("vhd-compressed", ["vhdfixed.xz"], "vhd.xz"),
|
| |
+ ("vagrant-libvirt", ["vagrant.libvirt.box"], "vagrant-libvirt.box"),
|
| |
+ ("vagrant-virtualbox", ["vagrant.virtualbox.box"], "vagrant-virtualbox.box"),
|
| |
+ ]
|
| |
+
|
| |
|
| |
class KiwiBuildPhase(
|
| |
base.PhaseLoggerMixin, base.ImageConfigMixin, base.ConfigGuardedPhase
|
| |
@@ -175,9 +181,9 @@
|
| |
|
| |
for arch, paths in paths.items():
|
| |
for path in paths:
|
| |
- type_, suffix = _find_suffix(path)
|
| |
- if not suffix:
|
| |
- # Path doesn't match any know type.
|
| |
+ type_, format_ = _find_type_and_format(path)
|
| |
+ if not format_:
|
| |
+ # Path doesn't match any known type.
|
| |
continue
|
| |
|
| |
# image_dir is absolute path to which the image should be copied.
|
| |
@@ -203,7 +209,7 @@
|
| |
# Get the manifest type from the config if supplied, otherwise we
|
| |
# determine the manifest type based on the koji output
|
| |
img.type = type_
|
| |
- img.format = suffix
|
| |
+ img.format = format_
|
| |
img.path = os.path.join(rel_image_dir, filename)
|
| |
img.mtime = util.get_mtime(image_dest)
|
| |
img.size = util.get_file_size(image_dest)
|
| |
@@ -219,9 +225,14 @@
|
| |
self.pool.log_info("[DONE ] %s (task id: %s)" % (msg, task_id))
|
| |
|
| |
|
| |
- def _find_suffix(path):
|
| |
+ def _find_type_and_format(path):
|
| |
for type_, suffixes in EXTENSIONS.items():
|
| |
for suffix in suffixes:
|
| |
if path.endswith(suffix):
|
| |
return type_, suffix
|
| |
+ # these are our kiwi-exclusive mappings for images whose extensions
|
| |
+ # aren't quite the same as imagefactory
|
| |
+ for type_, suffixes, format_ in KIWIEXTENSIONS:
|
| |
+ if any(path.endswith(suffix) for suffix in suffixes):
|
| |
+ return type_, format_
|
| |
return None, None
|
| |
As discussed in
https://pagure.io/releng/failed-composes/issue/6047#comment-899622
the list of 'acceptable' types and formats (in productmd terms)
is locked down in productmd, we cannot just 'declare' new formats
in pungi as we kinda wound up doing by adding these Kiwi
extensions to the EXTENSIONS dict in image_build phase. So
instead, let's return the image_build phase to the way it was,
and add an additional layer of handling in kiwibuild phase for
these awkward cases, which 'translates' the file suffix to a
format productmd knows about already. This is actually how we
would rather behave anyway, because a Kiwi-produced
vagrant.libvirt.box
file really is the same kind of thing as anImageFactory-produced
vagrant-libvirt.box
file; we want them tohave compatible metadata, we don't want them to look like
different things.
Signed-off-by: Adam Williamson awilliam@redhat.com