Commit 5fa5fcd Update compose, phases{buildinstall,createiso,gather/__ini__} to use correct productmd API calls

4 files Authored and Committed by Adam Miller 2 years ago
Update compose, phases{buildinstall,createiso,gather/__ini__} to use correct productmd API calls

    
 1 @@ -27,27 +27,28 @@
 2   import shutil
 3   
 4   import kobo.log
 5 - from productmd.composeinfo import Compose
 6 + from productmd.composeinfo import ComposeInfo
 7   from productmd.images import Images
 8   
 9   from pungi.wrappers.variants import VariantsXmlParser
10   from pungi.paths import Paths
11   from pungi.wrappers.scm import get_file_from_scm
12   from pungi.util import makedirs
13 - from pungi.metadata import compose_to_composeinfo
14   
15   
16   def get_compose_dir(topdir, conf, compose_type="production", compose_date=None, compose_respin=None, compose_label=None, already_exists_callbacks=None):
17 -     topdir = os.path.abspath(topdir)
18       already_exists_callbacks = already_exists_callbacks or []
19   
20       # create an incomplete composeinfo to generate compose ID
21 -     ci = Compose()
22 -     ci.product.name = conf["product_name"]
23 -     ci.product.short = conf["product_short"]
24 -     ci.product.version = conf["product_version"]
25 -     ci.product.is_layered = bool(conf.get("product_is_layered", False))
26 -     if ci.product.is_layered:
27 +     ci = ComposeInfo()
28 +     ci.compose.name = conf["product_name"]
29 +     ci.release.name = conf["product_name"]
30 +     ci.compose.short = conf["product_short"]
31 +     ci.release.short = conf["product_short"]
32 +     ci.compose.version = conf["product_version"]
33 +     ci.release.version = conf["product_version"]
34 +     ci.compose.is_layered = bool(conf.get("product_is_layered", False))
35 +     if ci.compose.is_layered:
36           ci.base_product.name = conf["base_product_name"]
37           ci.base_product.short = conf["base_product_short"]
38           ci.base_product.version = conf["base_product_version"]
39 @@ -57,9 +58,6 @@
40       ci.compose.date = compose_date or time.strftime("%Y%m%d", time.localtime())
41       ci.compose.respin = compose_respin or 0
42   
43 -     # HACK - add topdir for callbacks
44 -     ci.topdir = topdir
45 - 
46       while 1:
47           ci.compose.id = ci.create_compose_id()
48   
49 @@ -113,7 +111,7 @@
50           self.paths = Paths(self)
51   
52           # to provide compose_id, compose_date and compose_respin
53 -         self.ci_base = Compose()
54 +         self.ci_base = ComposeInfo()
55           self.ci_base.load(os.path.join(self.paths.work.topdir(arch="global"), "composeinfo-base.json"))
56   
57           self.supported = supported
58 @@ -121,7 +119,7 @@
59               self.log_info("Automatically setting 'supported' flag for a Release Candidate (%s) compose." % self.compose_label)
60               self.supported = True
61   
62 -         self.im = ImageManifest()
63 +         self.im = Images()
64           if self.DEBUG:
65               try:
66                   self.im.load(self.paths.compose.metadata("images.json"))
67 @@ -198,7 +196,10 @@
68           self.variants = VariantsXmlParser(file_obj, tree_arches).parse()
69   
70           # populate ci_base with variants - needed for layered-products (compose_id)
71 -         self.ci_base = compose_to_composeinfo(self)
72 +         ####FIXME - compose_to_composeinfo is no longer needed and has been
73 +         ####        removed, but I'm not entirely sure what this is needed for
74 +         ####        or if it is at all
75 +         #self.ci_base = compose_to_composeinfo(self)
76   
77       def get_variants(self, types=None, arch=None, recursive=False):
78           result = []
1 @@ -26,7 +26,7 @@
2   
3   from kobo.threads import ThreadPool, WorkerThread
4   from kobo.shortcuts import run, read_checksum_file, relative_path
5 - from productmd.imagemanifest import Image
6 + from productmd.images import Image
7   
8   from pungi.util import get_buildroot_rpms, get_volid
9   from pungi.wrappers.lorax import LoraxWrapper
1 @@ -23,7 +23,7 @@
2   
3   import koji
4   import productmd.treeinfo
5 - from productmd.imagemanifest import Image
6 + from productmd.images import Image
7   from kobo.threads import ThreadPool, WorkerThread
8   from kobo.shortcuts import run, read_checksum_file, relative_path
9   
 1 @@ -21,7 +21,7 @@
 2   import json
 3   
 4   from kobo.rpmlib import parse_nvra
 5 - from productmd import RpmManifest
 6 + from productmd.rpms import Rpms
 7   
 8   from pungi.wrappers.scm import get_file_from_scm
 9   from link import link_files
10 @@ -112,7 +112,7 @@
11           pkg_map = gather_wrapper(self.compose, self.pkgset_phase.package_sets, self.pkgset_phase.path_prefix)
12   
13           manifest_file = self.compose.paths.compose.metadata("rpms.json")
14 -         manifest = RpmManifest()
15 +         manifest = Rpms()
16           manifest.compose.id = self.compose.compose_id
17           manifest.compose.type = self.compose.compose_type
18           manifest.compose.date = self.compose.compose_date