Commit fd8cd62 Fix remaining productmd issues.

4 files Authored by dmach 2 years ago , Committed by Adam Miller 2 years ago ,
Fix remaining productmd issues.

    
 1 @@ -34,6 +34,7 @@
 2   from pungi.paths import Paths
 3   from pungi.wrappers.scm import get_file_from_scm
 4   from pungi.util import makedirs
 5 + from pungi.metadata import compose_to_composeinfo
 6   
 7   
 8   def get_compose_dir(topdir, conf, compose_type="production", compose_date=None, compose_respin=None, compose_label=None, already_exists_callbacks=None):
 9 @@ -199,7 +200,7 @@
10           ####FIXME - compose_to_composeinfo is no longer needed and has been
11           ####        removed, but I'm not entirely sure what this is needed for
12           ####        or if it is at all
13 -         #self.ci_base = compose_to_composeinfo(self)
14 +         self.ci_base = compose_to_composeinfo(self)
15   
16       def get_variants(self, types=None, arch=None, recursive=False):
17           result = []
 1 @@ -73,13 +73,13 @@
 2       ci.compose.label = compose.compose_label
 3   
 4       # product
 5 -     ci.product.name = compose.conf["product_name"]
 6 -     ci.product.version = compose.conf["product_version"]
 7 -     ci.product.short = compose.conf["product_short"]
 8 -     ci.product.is_layered = compose.conf.get("product_is_layered", False)
 9 +     ci.release.name = compose.conf["product_name"]
10 +     ci.release.version = compose.conf["product_version"]
11 +     ci.release.short = compose.conf["product_short"]
12 +     ci.release.is_layered = compose.conf.get("product_is_layered", False)
13   
14       # base product
15 -     if ci.product.is_layered:
16 +     if ci.release.is_layered:
17           ci.base_product.name = compose.conf["base_product_name"]
18           ci.base_product.version = compose.conf["base_product_version"]
19           ci.base_product.short = compose.conf["base_product_short"]
20 @@ -99,38 +99,38 @@
21           var.arches = set(variant.arches)
22   
23           if var.type == "layered-product":
24 -             var.product.name = variant.product_name
25 -             var.product.short = variant.product_short
26 -             var.product.version = variant.product_version
27 -             var.product.is_layered = True
28 +             var.release.name = variant.product_name
29 +             var.release.short = variant.product_short
30 +             var.release.version = variant.product_version
31 +             var.release.is_layered = True
32   
33           for arch in variant.arches:
34               # paths: binaries
35 -             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("/")
36 -             var.repository[arch] = relative_path(compose.paths.compose.repository(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
37 -             var.packages[arch] = relative_path(compose.paths.compose.packages(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
38 +             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("/")
39 +             var.paths.repository[arch] = relative_path(compose.paths.compose.repository(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
40 +             var.paths.packages[arch] = relative_path(compose.paths.compose.packages(arch=arch, variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
41               iso_dir = compose.paths.compose.iso_dir(arch=arch, variant=variant, create_dir=False) or ""
42               if iso_dir and os.path.isdir(os.path.join(compose.paths.compose.topdir(), iso_dir)):
43 -                 var.isos[arch] = relative_path(iso_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
44 +                 var.paths.isos[arch] = relative_path(iso_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
45               jigdo_dir = compose.paths.compose.jigdo_dir(arch=arch, variant=variant, create_dir=False) or ""
46               if jigdo_dir and os.path.isdir(os.path.join(compose.paths.compose.topdir(), jigdo_dir)):
47 -                 var.jigdos[arch] = relative_path(jigdo_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
48 +                 var.paths.jigdos[arch] = relative_path(jigdo_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
49   
50               # paths: sources
51 -             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("/")
52 -             var.source_repository[arch] = relative_path(compose.paths.compose.repository(arch="source", variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
53 -             var.source_packages[arch] = relative_path(compose.paths.compose.packages(arch="source", variant=variant, create_dir=False).rstrip("/") + "/", compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
54 +             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("/")
55 +             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("/")
56 +             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("/")
57               source_iso_dir = compose.paths.compose.iso_dir(arch="source", variant=variant, create_dir=False) or ""
58               if source_iso_dir and os.path.isdir(os.path.join(compose.paths.compose.topdir(), source_iso_dir)):
59 -                 var.source_isos[arch] = relative_path(source_iso_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
60 +                 var.paths.source_isos[arch] = relative_path(source_iso_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
61               source_jigdo_dir = compose.paths.compose.jigdo_dir(arch="source", variant=variant, create_dir=False) or ""
62               if source_jigdo_dir and os.path.isdir(os.path.join(compose.paths.compose.topdir(), source_jigdo_dir)):
63 -                 var.source_jigdos[arch] = relative_path(source_jigdo_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
64 +                 var.paths.source_jigdos[arch] = relative_path(source_jigdo_dir, compose.paths.compose.topdir().rstrip("/") + "/").rstrip("/")
65   
66               # paths: debug
67 -             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("/")
68 -             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("/")
69 -             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("/")
70 +             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("/")
71 +             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("/")
72 +             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("/")
73               '''
74               # XXX: not suported (yet?)
75               debug_iso_dir = compose.paths.compose.debug_iso_dir(arch=arch, variant=variant) or ""
1 @@ -299,7 +299,7 @@
2           img.volume_id = iso.get_volume_id(new_boot_iso_path)
3       except RuntimeError:
4           pass
5 -     compose.im.add(arch, variant.uid, img)
6 +     compose.im.add(variant.uid, arch, img)
7       compose.log_info("[DONE ] %s" % msg)
8   
9   
1 @@ -275,7 +275,7 @@
2               img.volume_id = iso.get_volume_id(cmd["iso_path"])
3           except RuntimeError:
4               pass
5 -         compose.im.add(cmd["arch"], cmd["variant"].uid, img)
6 +         compose.im.add(cmd["variant"].uid, cmd["arch"], img)
7           # TODO: supported_iso_bit
8           # add: boot.iso
9