Add support for top-level variant IDs with dashes.
This is for layered products that have a variant mapped to multiple variants in a base product, for example: * Foo-Tools (id: FooTools, uid: Foo-Tools, name: Tools) * Bar-Tools (id: BarTools, uid: Bar-Tools, name: Tools) Requires productmd >= 1.2. Signed-off-by: Daniel Mach <dmach@redhat.com>
This commit is contained in:
parent
4582e635f6
commit
f0aecf6744
3 changed files with 29 additions and 4 deletions
|
|
@ -94,7 +94,8 @@ def compose_to_composeinfo(compose):
|
|||
return None
|
||||
|
||||
# variant details
|
||||
var.id = variant.id
|
||||
# remove dashes from variant ID, rely on productmd verification
|
||||
var.id = variant.id.replace("-", "")
|
||||
var.uid = variant.uid
|
||||
var.name = variant.name
|
||||
var.type = variant.type
|
||||
|
|
@ -230,7 +231,8 @@ def write_tree_info(compose, arch, variant, timestamp=None):
|
|||
var.name = variant.parent.name
|
||||
var.type = "variant"
|
||||
else:
|
||||
var.id = variant.id
|
||||
# remove dashes from variant ID, rely on productmd verification
|
||||
var.id = variant.id.replace("-", "")
|
||||
var.uid = variant.uid
|
||||
var.name = variant.name
|
||||
var.type = variant.type
|
||||
|
|
|
|||
|
|
@ -198,8 +198,6 @@ class VariantsXmlParser(object):
|
|||
class Variant(object):
|
||||
def __init__(self, id, name, type, arches, groups, environments=None,
|
||||
buildinstallpackages=None, is_empty=False, parent=None):
|
||||
if not id.isalnum():
|
||||
raise ValueError("Variant ID must contain only alphanumeric characters: %s" % id)
|
||||
|
||||
environments = environments or []
|
||||
buildinstallpackages = buildinstallpackages or []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue