Fix remaining productmd issues.
This commit is contained in:
parent
6b34cb98d2
commit
fd8cd62e79
@ -34,6 +34,7 @@ from pungi.wrappers.variants import VariantsXmlParser
|
||||
from pungi.paths import Paths
|
||||
from pungi.wrappers.scm import get_file_from_scm
|
||||
from pungi.util import makedirs
|
||||
from pungi.metadata import compose_to_composeinfo
|
||||
|
||||
|
||||
def get_compose_dir(topdir, conf, compose_type="production", compose_date=None, compose_respin=None, compose_label=None, already_exists_callbacks=None):
|
||||
@ -199,7 +200,7 @@ class Compose(kobo.log.LoggingBase):
|
||||
####FIXME - compose_to_composeinfo is no longer needed and has been
|
||||
#### removed, but I'm not entirely sure what this is needed for
|
||||
#### or if it is at all
|
||||
#self.ci_base = compose_to_composeinfo(self)
|
||||
self.ci_base = compose_to_composeinfo(self)
|
||||
|
||||
def get_variants(self, types=None, arch=None, recursive=False):
|
||||
result = []
|
||||
|
@ -73,13 +73,13 @@ def compose_to_composeinfo(compose):
|
||||
ci.compose.label = compose.compose_label
|
||||
|
||||
# product
|
||||
ci.product.name = compose.conf["product_name"]
|
||||
ci.product.version = compose.conf["product_version"]
|
||||
ci.product.short = compose.conf["product_short"]
|
||||
ci.product.is_layered = compose.conf.get("product_is_layered", False)
|
||||
ci.release.name = compose.conf["product_name"]
|
||||
ci.release.version = compose.conf["product_version"]
|
||||
ci.release.short = compose.conf["product_short"]
|
||||
ci.release.is_layered = compose.conf.get("product_is_layered", False)
|
||||
|
||||
# base product
|
||||
if ci.product.is_layered:
|
||||
if ci.release.is_layered:
|
||||
ci.base_product.name = compose.conf["base_product_name"]
|
||||
ci.base_product.version = compose.conf["base_product_version"]
|
||||
ci.base_product.short = compose.conf["base_product_short"]
|
||||
@ -99,38 +99,38 @@ def compose_to_composeinfo(compose):
|
||||
var.arches = set(variant.arches)
|
||||
|
||||
if var.type == "layered-product":
|
||||
var.product.name = variant.product_name
|
||||
var.product.short = variant.product_short
|
||||
var.product.version = variant.product_version
|
||||
var.product.is_layered = True
|
||||
var.release.name = variant.product_name
|
||||
var.release.short = variant.product_short
|
||||
var.release.version = variant.product_version
|
||||
var.release.is_layered = True
|
||||
|
||||
for arch in variant.arches:
|
||||
# paths: binaries
|
||||
var.os_tree[arch] = relative_path(compose.paths.compose.os_tree(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.repository[arch] = relative_path(compose.paths.compose.repository(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.packages[arch] = relative_path(compose.paths.compose.packages(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.os_tree[arch] = relative_path(compose.paths.compose.os_tree(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.repository[arch] = relative_path(compose.paths.compose.repository(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.packages[arch] = relative_path(compose.paths.compose.packages(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
iso_dir = compose.paths.compose.iso_dir(arch=arch, variant=variant, create_dir=False) or ""
|
||||
if iso_dir and os.path.isdir(os.path.join(compose.paths.compose.topdir(), iso_dir)):
|
||||
var.isos[arch] = relative_path(iso_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.isos[arch] = relative_path(iso_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
jigdo_dir = compose.paths.compose.jigdo_dir(arch=arch, variant=variant, create_dir=False) or ""
|
||||
if jigdo_dir and os.path.isdir(os.path.join(compose.paths.compose.topdir(), jigdo_dir)):
|
||||
var.jigdos[arch] = relative_path(jigdo_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.jigdos[arch] = relative_path(jigdo_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
|
||||
# paths: sources
|
||||
var.source_tree[arch] = relative_path(compose.paths.compose.os_tree(arch="source", variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.source_repository[arch] = relative_path(compose.paths.compose.repository(arch="source", variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.source_packages[arch] = relative_path(compose.paths.compose.packages(arch="source", variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.source_tree[arch] = relative_path(compose.paths.compose.os_tree(arch="source", variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.source_repository[arch] = relative_path(compose.paths.compose.repository(arch="source", variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.source_packages[arch] = relative_path(compose.paths.compose.packages(arch="source", variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
source_iso_dir = compose.paths.compose.iso_dir(arch="source", variant=variant, create_dir=False) or ""
|
||||
if source_iso_dir and os.path.isdir(os.path.join(compose.paths.compose.topdir(), source_iso_dir)):
|
||||
var.source_isos[arch] = relative_path(source_iso_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.source_isos[arch] = relative_path(source_iso_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
source_jigdo_dir = compose.paths.compose.jigdo_dir(arch="source", variant=variant, create_dir=False) or ""
|
||||
if source_jigdo_dir and os.path.isdir(os.path.join(compose.paths.compose.topdir(), source_jigdo_dir)):
|
||||
var.source_jigdos[arch] = relative_path(source_jigdo_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.source_jigdos[arch] = relative_path(source_jigdo_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
|
||||
# paths: debug
|
||||
var.debug_tree[arch] = relative_path(compose.paths.compose.debug_tree(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.debug_repository[arch] = relative_path(compose.paths.compose.debug_repository(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.debug_packages[arch] = relative_path(compose.paths.compose.debug_packages(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.debug_tree[arch] = relative_path(compose.paths.compose.debug_tree(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.debug_repository[arch] = relative_path(compose.paths.compose.debug_repository(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
var.paths.debug_packages[arch] = relative_path(compose.paths.compose.debug_packages(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
|
||||
'''
|
||||
# XXX: not suported (yet?)
|
||||
debug_iso_dir = compose.paths.compose.debug_iso_dir(arch=arch, variant=variant) or ""
|
||||
|
@ -299,7 +299,7 @@ def symlink_boot_iso(compose, arch, variant):
|
||||
img.volume_id = iso.get_volume_id(new_boot_iso_path)
|
||||
except RuntimeError:
|
||||
pass
|
||||
compose.im.add(arch, variant.uid, img)
|
||||
compose.im.add(variant.uid, arch, img)
|
||||
compose.log_info("[DONE ] %s" % msg)
|
||||
|
||||
|
||||
|
@ -275,7 +275,7 @@ class CreateIsoThread(WorkerThread):
|
||||
img.volume_id = iso.get_volume_id(cmd["iso_path"])
|
||||
except RuntimeError:
|
||||
pass
|
||||
compose.im.add(cmd["arch"], cmd["variant"].uid, img)
|
||||
compose.im.add(cmd["variant"].uid, cmd["arch"], img)
|
||||
# TODO: supported_iso_bit
|
||||
# add: boot.iso
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user