Rename product_* to release_*.

CHANGE: Rename product_* config options to release_* for consistency with productmd.
ACTION: Rename product_name, product_short, product_version, product_is_layered to release_* in config files.
        Rename //variant/product to //variant/release in variants XML.
This commit is contained in:
Daniel Mach 2015-07-09 06:58:30 -04:00
parent afa05021f0
commit 72302bd98e
14 changed files with 93 additions and 130 deletions

View File

@ -1,3 +1,8 @@
DATE: 2015-08-09
CHANGE: Rename product_* config options to release_* for consistency with productmd.
ACTION: Rename product_name, product_short, product_version, product_is_layered to release_* in config files.
Rename //variant/product to //variant/release in variants XML.
DATE: 2015-08-09 DATE: 2015-08-09
CHANGE: pkgset_koji_url and pkgset_koji_path_prefix config options replaced with koji_profile. CHANGE: pkgset_koji_url and pkgset_koji_path_prefix config options replaced with koji_profile.
ACTION: Add 'koji_profile = "<profile_name>"' (use "koji" for Fedora) to config files. ACTION: Add 'koji_profile = "<profile_name>"' (use "koji" for Fedora) to config files.

View File

@ -302,8 +302,8 @@ def run_compose(compose):
# create a latest symlink # create a latest symlink
compose_dir = os.path.basename(compose.topdir) compose_dir = os.path.basename(compose.topdir)
symlink_name = "latest-%s-%s" % (compose.conf["product_short"], ".".join(compose.conf["product_version"].split(".")[:-1])) symlink_name = "latest-%s-%s" % (compose.conf["release_short"], ".".join(compose.conf["release_version"].split(".")[:-1]))
if compose.conf["product_is_layered"]: if compose.conf["release_is_layered"]:
symlink_name += "-%s-%s" % (compose.conf["base_product_short"], compose.conf["base_product_version"]) symlink_name += "-%s-%s" % (compose.conf["base_product_short"], compose.conf["base_product_version"])
symlink = os.path.join(compose.topdir, "..", symlink_name) symlink = os.path.join(compose.topdir, "..", symlink_name)

View File

@ -42,14 +42,11 @@ def get_compose_dir(topdir, conf, compose_type="production", compose_date=None,
# create an incomplete composeinfo to generate compose ID # create an incomplete composeinfo to generate compose ID
ci = ComposeInfo() ci = ComposeInfo()
ci.compose.name = conf["product_name"] ci.release.name = conf["release_name"]
ci.release.name = conf["product_name"] ci.release.short = conf["release_short"]
ci.compose.short = conf["product_short"] ci.release.version = conf["release_version"]
ci.release.short = conf["product_short"] ci.release.is_layered = bool(conf.get("release_is_layered", False))
ci.compose.version = conf["product_version"] if ci.release.is_layered:
ci.release.version = conf["product_version"]
ci.compose.is_layered = bool(conf.get("product_is_layered", False))
if ci.compose.is_layered:
ci.base_product.name = conf["base_product_name"] ci.base_product.name = conf["base_product_name"]
ci.base_product.short = conf["base_product_short"] ci.base_product.short = conf["base_product_short"]
ci.base_product.version = conf["base_product_version"] ci.base_product.version = conf["base_product_version"]

View File

@ -28,14 +28,14 @@ from pungi.compose_metadata.discinfo import write_media_repo as create_media_rep
def get_description(compose, variant, arch): def get_description(compose, variant, arch):
if "product_discinfo_description" in compose.conf: if "release_discinfo_description" in compose.conf:
result = compose.conf["product_discinfo_description"] result = compose.conf["release_discinfo_description"]
elif variant.type == "layered-product": elif variant.type == "layered-product":
# we need to make sure the layered product behaves as it was composed separately # we need to make sure the layered product behaves as it was composed separately
result = "%s %s for %s %s" % (variant.product_name, variant.product_version, compose.conf["product_name"], get_major_version(compose.conf["product_version"])) result = "%s %s for %s %s" % (variant.release_name, variant.release_version, compose.conf["release_name"], get_major_version(compose.conf["release_version"]))
else: else:
result = "%s %s" % (compose.conf["product_name"], compose.conf["product_version"]) result = "%s %s" % (compose.conf["release_name"], compose.conf["release_version"])
if compose.conf.get("product_is_layered", False): if compose.conf.get("release_is_layered", False):
result += "for %s %s" % (compose.conf["base_product_name"], compose.conf["base_product_version"]) result += "for %s %s" % (compose.conf["base_product_name"], compose.conf["base_product_version"])
result = result % {"variant_name": variant.name, "arch": arch} result = result % {"variant_name": variant.name, "arch": arch}
@ -73,10 +73,10 @@ def compose_to_composeinfo(compose):
ci.compose.label = compose.compose_label ci.compose.label = compose.compose_label
# product # product
ci.release.name = compose.conf["product_name"] ci.release.name = compose.conf["release_name"]
ci.release.version = compose.conf["product_version"] ci.release.version = compose.conf["release_version"]
ci.release.short = compose.conf["product_short"] ci.release.short = compose.conf["release_short"]
ci.release.is_layered = compose.conf.get("product_is_layered", False) ci.release.is_layered = compose.conf.get("release_is_layered", False)
# base product # base product
if ci.release.is_layered: if ci.release.is_layered:
@ -99,9 +99,9 @@ def compose_to_composeinfo(compose):
var.arches = set(variant.arches) var.arches = set(variant.arches)
if var.type == "layered-product": if var.type == "layered-product":
var.release.name = variant.product_name var.release.name = variant.release_name
var.release.short = variant.product_short var.release.short = variant.release_short
var.release.version = variant.product_version var.release.version = variant.release_version
var.release.is_layered = True var.release.is_layered = True
for arch in variant.arches: for arch in variant.arches:
@ -184,27 +184,27 @@ def write_tree_info(compose, arch, variant, timestamp=None):
if variant.type == "layered-product": if variant.type == "layered-product":
# we need to make sure the layered product behaves as it was composed separately # we need to make sure the layered product behaves as it was composed separately
# product # release
# TODO: read from variants.xml # TODO: read from variants.xml
ti.release.name = variant.product_name ti.release.name = variant.release_name
ti.release.version = variant.product_version ti.release.version = variant.release_version
ti.release.short = variant.product_short ti.release.short = variant.release_short
ti.release.is_layered = True ti.release.is_layered = True
# base product # base product
ti.base_product.name = compose.conf["product_name"] ti.base_product.name = compose.conf["release_name"]
if "." in compose.conf["product_version"]: if "." in compose.conf["release_version"]:
# remove minor version if present # remove minor version if present
ti.base_product.version = get_major_version(compose.conf["product_version"]) ti.base_product.version = get_major_version(compose.conf["release_version"])
else: else:
ti.base_product.version = compose.conf["product_version"] ti.base_product.version = compose.conf["release_version"]
ti.base_product.short = compose.conf["product_short"] ti.base_product.short = compose.conf["release_short"]
else: else:
# product # release
ti.release.name = compose.conf["product_name"] ti.release.name = compose.conf["release_name"]
ti.release.version = compose.conf["product_version"] ti.release.version = compose.conf["release_version"]
ti.release.short = compose.conf["product_short"] ti.release.short = compose.conf["release_short"]
ti.release.is_layered = compose.conf.get("product_is_layered", False) ti.release.is_layered = compose.conf.get("release_is_layered", False)
# base product # base product
if ti.release.is_layered: if ti.release.is_layered:
@ -257,7 +257,7 @@ def write_tree_info(compose, arch, variant, timestamp=None):
def _check_short(self): def _check_short(self):
# HACK: set self.short so .treeinfo produced by lorax can be read # HACK: set self.short so .treeinfo produced by lorax can be read
if not self.short: if not self.short:
self.short = compose.conf["product_short"] self.short = compose.conf["release_short"]
class LoraxTreeInfo(productmd.treeinfo.TreeInfo): class LoraxTreeInfo(productmd.treeinfo.TreeInfo):
def clear(self): def clear(self):

View File

@ -80,9 +80,9 @@ class BuildinstallPhase(PhaseBase):
def run(self): def run(self):
lorax = LoraxWrapper() lorax = LoraxWrapper()
product = self.compose.conf["product_name"] product = self.compose.conf["release_name"]
version = self.compose.conf["product_version"] version = self.compose.conf["release_version"]
release = self.compose.conf["product_version"] release = self.compose.conf["release_version"]
noupgrade = not self.compose.conf.get("buildinstall_upgrade_image", False) noupgrade = not self.compose.conf.get("buildinstall_upgrade_image", False)
buildinstall_method = self.compose.conf["buildinstall_method"] buildinstall_method = self.compose.conf["buildinstall_method"]

View File

@ -105,7 +105,7 @@ class GatherPhase(PhaseBase):
def check_config(self): def check_config(self):
errors = [] errors = []
for i in ["product_name", "product_short", "product_version"]: for i in ["release_name", "release_short", "release_version"]:
errors.append(self.conf_assert_str(i)) errors.append(self.conf_assert_str(i))
def run(self): def run(self):

View File

@ -35,25 +35,25 @@ class InitPhase(PhaseBase):
config_options = ( config_options = (
# PRODUCT INFO # PRODUCT INFO
{ {
"name": "product_name", "name": "release_name",
"expected_types": [str], "expected_types": [str],
}, },
{ {
"name": "product_short", "name": "release_short",
"expected_types": [str], "expected_types": [str],
}, },
{ {
"name": "product_version", "name": "release_version",
"expected_types": [str], "expected_types": [str],
}, },
{ {
# override description in .discinfo; accepts %(variant_name)s and %(arch)s variables # override description in .discinfo; accepts %(variant_name)s and %(arch)s variables
"name": "product_discinfo_description", "name": "release_discinfo_description",
"expected_types": [str], "expected_types": [str],
"optional": True, "optional": True,
}, },
{ {
"name": "product_is_layered", "name": "release_is_layered",
"expected_types": [bool], "expected_types": [bool],
"requires": ( "requires": (
(lambda x: bool(x), ["base_product_name", "base_product_short", "base_product_version"]), (lambda x: bool(x), ["base_product_name", "base_product_short", "base_product_version"]),

View File

@ -55,7 +55,7 @@ def create_global_repo(compose, path_prefix):
old_compose_path = None old_compose_path = None
update_md_path = None update_md_path = None
if compose.old_composes: if compose.old_composes:
old_compose_path = find_old_compose(compose.old_composes, compose.conf["product_short"], compose.conf["product_version"], compose.conf.get("base_product_short", None), compose.conf.get("base_product_version", None)) old_compose_path = find_old_compose(compose.old_composes, compose.conf["release_short"], compose.conf["release_version"], compose.conf.get("base_product_short", None), compose.conf.get("base_product_version", None))
if old_compose_path is None: if old_compose_path is None:
compose.log_info("No suitable old compose found in: %s" % compose.old_composes) compose.log_info("No suitable old compose found in: %s" % compose.old_composes)
else: else:
@ -93,7 +93,7 @@ def create_arch_repos(compose, arch, path_prefix):
compose.log_info("[DONE ] %s" % msg) compose.log_info("[DONE ] %s" % msg)
def find_old_compose(old_compose_dirs, product_short, product_version, base_product_short=None, base_product_version=None): def find_old_compose(old_compose_dirs, release_short, release_version, base_product_short=None, base_product_version=None):
composes = [] composes = []
for compose_dir in force_list(old_compose_dirs): for compose_dir in force_list(old_compose_dirs):
@ -104,7 +104,7 @@ def find_old_compose(old_compose_dirs, product_short, product_version, base_prod
for i in os.listdir(compose_dir): for i in os.listdir(compose_dir):
# TODO: read .composeinfo # TODO: read .composeinfo
pattern = "%s-%s" % (product_short, product_version) pattern = "%s-%s" % (release_short, release_version)
if base_product_short: if base_product_short:
pattern += "-%s" % base_product_short pattern += "-%s" % base_product_short
if base_product_version: if base_product_version:

View File

@ -60,7 +60,7 @@ def run_repoclosure(compose):
repo_dir = compose.paths.compose.repository(arch=arch, variant=variant) repo_dir = compose.paths.compose.repository(arch=arch, variant=variant)
repos[repo_id] = repo_dir repos[repo_id] = repo_dir
if compose.conf.get("product_is_layered", False): if compose.conf.get("release_is_layered", False):
for i, lookaside_url in enumerate(get_lookaside_repos(compose, arch, variant)): for i, lookaside_url in enumerate(get_lookaside_repos(compose, arch, variant)):
lookaside["lookaside-%s.%s-%s" % (variant.uid, arch, i)] = lookaside_url lookaside["lookaside-%s.%s-%s" % (variant.uid, arch, i)] = lookaside_url

View File

@ -262,31 +262,31 @@ def get_volid(compose, arch, variant=None, escape_spaces=False):
return None return None
if variant and variant.type == "layered-product": if variant and variant.type == "layered-product":
product_short = variant.product_short release_short = variant.release_short
product_version = variant.product_version release_version = variant.release_version
product_is_layered = True release_is_layered = True
base_product_short = compose.conf["product_short"] base_product_short = compose.conf["release_short"]
base_product_version = get_major_version(compose.conf["product_version"]) base_product_version = get_major_version(compose.conf["release_version"])
variant_uid = variant.parent.uid variant_uid = variant.parent.uid
else: else:
product_short = compose.conf["product_short"] release_short = compose.conf["release_short"]
product_version = compose.conf["product_version"] release_version = compose.conf["release_version"]
product_is_layered = compose.conf["product_is_layered"] release_is_layered = compose.conf["release_is_layered"]
base_product_short = compose.conf.get("base_product_short", "") base_product_short = compose.conf.get("base_product_short", "")
base_product_version = compose.conf.get("base_product_version", "") base_product_version = compose.conf.get("base_product_version", "")
variant_uid = variant and variant.uid or None variant_uid = variant and variant.uid or None
products = [ products = [
"%(product_short)s-%(product_version)s %(variant_uid)s.%(arch)s", "%(release_short)s-%(release_version)s %(variant_uid)s.%(arch)s",
"%(product_short)s-%(product_version)s %(arch)s", "%(release_short)s-%(release_version)s %(arch)s",
] ]
layered_products = [ layered_products = [
"%(product_short)s-%(product_version)s %(base_product_short)s-%(base_product_version)s %(variant_uid)s.%(arch)s", "%(release_short)s-%(release_version)s %(base_product_short)s-%(base_product_version)s %(variant_uid)s.%(arch)s",
"%(product_short)s-%(product_version)s %(base_product_short)s-%(base_product_version)s %(arch)s", "%(release_short)s-%(release_version)s %(base_product_short)s-%(base_product_version)s %(arch)s",
] ]
volid = None volid = None
if product_is_layered: if release_is_layered:
all_products = layered_products + products all_products = layered_products + products
else: else:
all_products = products all_products = products

View File

@ -109,10 +109,10 @@ class VariantsXmlParser(object):
variant = Variant(**variant_dict) variant = Variant(**variant_dict)
if variant.type == "layered-product": if variant.type == "layered-product":
product_node = variant_node.xpath("product")[0] release_node = variant_node.xpath("release")[0]
variant.product_name = str(product_node.attrib["name"]) variant.release_name = str(release_node.attrib["name"])
variant.product_version = str(product_node.attrib["version"]) variant.release_version = str(release_node.attrib["version"])
variant.product_short = str(product_node.attrib["short"]) variant.release_short = str(release_node.attrib["short"])
contains_optional = False contains_optional = False
for child_node in variant_node.xpath("variants/variant"): for child_node in variant_node.xpath("variants/variant"):

View File

@ -1,6 +1,6 @@
<!ELEMENT variants (ref*,variant*)> <!ELEMENT variants (ref*,variant*)>
<!ELEMENT variant (product?,arches,groups,environments*,variants*)?> <!ELEMENT variant (release?,arches,groups,environments*,variants*)?>
<!ATTLIST variant <!ATTLIST variant
id ID #REQUIRED id ID #REQUIRED
name CDATA #REQUIRED name CDATA #REQUIRED
@ -8,8 +8,8 @@
has_optional (true|false) #IMPLIED has_optional (true|false) #IMPLIED
> >
<!ELEMENT product (#PCDATA)> <!ELEMENT release (#PCDATA)>
<!ATTLIST product <!ATTLIST release
name CDATA #IMPLIED name CDATA #IMPLIED
short CDATA #IMPLIED short CDATA #IMPLIED
version CDATA #IMPLIED version CDATA #IMPLIED

View File

@ -1,40 +1,23 @@
# PRODUCT (RELEASE) INFO # RELEASE
product_name = "Dummy Product" release_name = "Dummy Product"
product_short = "DP" release_short = "DP"
product_version = "1.0" release_version = "1.0"
product_is_layered = False release_is_layered = False
product_type = "ga" release_type = "ga"
# GENERAL SETTINGS # GENERAL SETTINGS
bootable = False
comps_file = "dummy-comps.xml" comps_file = "dummy-comps.xml"
variants_file = "dummy-variants.xml" variants_file = "dummy-variants.xml"
sigkeys = [None] # None = unsigned
# limit tree architectures
# if undefined, all architectures from variants.xml will be included
atree_arches = ["x86_64"]
# limit tree variants
# if undefined, all variants from variants.xml will be included
#tree_variants = ["Server"]
multilib_arches = ["ppc64", "x86_64", "s390x"]
multilib_methods = ["devel", "runtime"] # devel (recommended), all, base, file, kernel, none, runtime
# RUNROOT settings # KOJI SETTINGS
runroot = False runroot = False
#runroot_channel = ""
#runroot_tag = ""
# PKGSET # PKGSET
pkgset_source = "repos" # koji, repos sigkeys = [None]
pkgset_source = "repos"
# PKGSET - REPOS
# pkgset_repos format: {arch: [repo1_url, repo2_url, ...]}
pkgset_repos = { pkgset_repos = {
"i386": [ "i386": [
"repo", "repo",
@ -47,45 +30,23 @@ pkgset_repos = {
], ],
} }
# PKGSET - KOJI
#pkgset_koji_path_prefix = "/mnt/koji"
#pkgset_koji_url = ""
#pkgset_koji_tag = ""
# GATHER
gather_source = "comps"
gather_method = "deps"
check_deps = False
greedy_method = "build"
# fomat: [(variant_uid_regex, {arch|*: [repos]})]
# gather_lookaside_repos = []
# GATHER - JSON
# format: {variant_uid: {arch: package: [arch1, arch2, None (for any arch)]}}
#gather_source_mapping = "/path/to/mapping.json"
# CREATEREPO # CREATEREPO
createrepo_checksum = "sha256" createrepo_checksum = "sha256"
# BUILDINSTALL # GATHER
gather_source = "comps"
gather_method = "deps"
greedy_method = "build"
check_deps = False
multilib_arches = ["ppc64", "x86_64", "s390x"]
multilib_methods = ["devel", "runtime"]
# PRODUCTIMG
# CREATEISO
symlink_isos_to = None
# fomat: [(variant_uid_regex, {arch|*: [packages]})]
additional_packages = [ additional_packages = [
('^Server$', { ('^Server$', {
'*': [ '*': [
# 'dummy-lvm2-devel',
'dummy-libtool', 'dummy-libtool',
], ],
}), }),
@ -119,14 +80,10 @@ filter_packages = [
}), }),
] ]
# format: {arch|*: [packages]}
multilib_blacklist = { multilib_blacklist = {
"*": [ "*": [
"kernel-devel", "kernel-devel",
"httpd-devel", "httpd-devel",
"*",
# "dummy-glibc",
], ],
} }
@ -135,3 +92,7 @@ multilib_whitelist = {
"dummy-glibc", "dummy-glibc",
], ],
} }
# BUILDINSTALL
bootable = False

View File

@ -12,7 +12,7 @@
</variant> </variant>
<variant id="Gluster" name="Gluster Layered Product" type="layered-product"> <variant id="Gluster" name="Gluster Layered Product" type="layered-product">
<product name="Gluster" version="2.3" short="Gluster" /> <release name="Gluster" version="2.3" short="Gluster" />
<arches> <arches>
<arch>x86_64</arch> <arch>x86_64</arch>
</arches> </arches>