forked from sig_core/toolkit
Metadata updates (part 3)
* Allow multiple repos in a single command with comma separation * Add metadata paths for pungi-like composeinfo.json
This commit is contained in:
parent
dea32e0fd0
commit
da3901d742
@ -10,9 +10,13 @@ from empanadas.util import RepoSync
|
|||||||
parser = argparse.ArgumentParser(description="Peridot Sync and Compose")
|
parser = argparse.ArgumentParser(description="Peridot Sync and Compose")
|
||||||
|
|
||||||
# All of our options
|
# All of our options
|
||||||
parser.add_argument('--release', type=str, help="Major Release Version or major-type (eg 9-beta)", required=True)
|
parser.add_argument('--release',
|
||||||
parser.add_argument('--repo', type=str, help="Repository name")
|
type=str,
|
||||||
parser.add_argument('--arch', type=str, help="Architecture")
|
help="Major Release Version or major-type (eg 9-beta)",
|
||||||
|
required=True
|
||||||
|
)
|
||||||
|
parser.add_argument('--repo', type=str, help="Repository name (comma separated list allowed)")
|
||||||
|
parser.add_argument('--arch', type=str, help="Architecture (comma separated list allowed)")
|
||||||
parser.add_argument('--ignore-debug', action='store_true')
|
parser.add_argument('--ignore-debug', action='store_true')
|
||||||
parser.add_argument('--ignore-source', action='store_true')
|
parser.add_argument('--ignore-source', action='store_true')
|
||||||
parser.add_argument('--repoclosure', action='store_true')
|
parser.add_argument('--repoclosure', action='store_true')
|
||||||
|
@ -354,13 +354,13 @@ class RepoSync:
|
|||||||
arches_to_sync = self.arches
|
arches_to_sync = self.arches
|
||||||
if arch:
|
if arch:
|
||||||
sync_single_arch = True
|
sync_single_arch = True
|
||||||
arches_to_sync = [arch]
|
arches_to_sync = arch.split(',')
|
||||||
|
|
||||||
sync_single_repo = False
|
sync_single_repo = False
|
||||||
repos_to_sync = self.repos
|
repos_to_sync = self.repos
|
||||||
if repo and not self.fullrun:
|
if repo and not self.fullrun:
|
||||||
sync_single_repo = True
|
sync_single_repo = True
|
||||||
repos_to_sync = [repo]
|
repos_to_sync = repo.split(',')
|
||||||
|
|
||||||
for r in repos_to_sync:
|
for r in repos_to_sync:
|
||||||
entry_name_list = []
|
entry_name_list = []
|
||||||
@ -907,7 +907,7 @@ class RepoSync:
|
|||||||
# TODO: Add in each repo and their corresponding arch.
|
# TODO: Add in each repo and their corresponding arch.
|
||||||
productmd_date = self.date_stamp.split('.')[0]
|
productmd_date = self.date_stamp.split('.')[0]
|
||||||
Shared.composeinfo_write(
|
Shared.composeinfo_write(
|
||||||
metadata_dir + '/composeinfo',
|
sync_root,
|
||||||
self.distname,
|
self.distname,
|
||||||
self.shortname,
|
self.shortname,
|
||||||
self.fullversion,
|
self.fullversion,
|
||||||
@ -941,11 +941,11 @@ class RepoSync:
|
|||||||
|
|
||||||
arches_to_tree = self.arches
|
arches_to_tree = self.arches
|
||||||
if arch:
|
if arch:
|
||||||
arches_to_tree = [arch]
|
arches_to_tree = arch.split(',')
|
||||||
|
|
||||||
repos_to_tree = self.repos
|
repos_to_tree = self.repos
|
||||||
if repo and not self.fullrun:
|
if repo and not self.fullrun:
|
||||||
repos_to_tree = [repo]
|
repos_to_tree = repo.split(',')
|
||||||
|
|
||||||
# If a treeinfo or discinfo file exists, it should be skipped.
|
# If a treeinfo or discinfo file exists, it should be skipped.
|
||||||
for r in repos_to_tree:
|
for r in repos_to_tree:
|
||||||
@ -1270,11 +1270,11 @@ class RepoSync:
|
|||||||
|
|
||||||
arches_to_tree = self.arches
|
arches_to_tree = self.arches
|
||||||
if arch:
|
if arch:
|
||||||
arches_to_tree = [arch]
|
arches_to_tree = arch.split(',')
|
||||||
|
|
||||||
repos_to_tree = self.repos
|
repos_to_tree = self.repos
|
||||||
if repo and not self.fullrun:
|
if repo and not self.fullrun:
|
||||||
repos_to_tree = [repo]
|
repos_to_tree = repo.split(',')
|
||||||
|
|
||||||
for r in repos_to_tree:
|
for r in repos_to_tree:
|
||||||
entry_name_list = []
|
entry_name_list = []
|
||||||
@ -1976,7 +1976,7 @@ class SigRepoSync:
|
|||||||
|
|
||||||
repos_to_sync = self.sigrepos
|
repos_to_sync = self.sigrepos
|
||||||
if repo and not self.fullrun:
|
if repo and not self.fullrun:
|
||||||
repos_to_sync = [repo]
|
repos_to_sync = repo.split(',')
|
||||||
|
|
||||||
for r in repos_to_sync:
|
for r in repos_to_sync:
|
||||||
entry_name_list = []
|
entry_name_list = []
|
||||||
@ -1987,7 +1987,7 @@ class SigRepoSync:
|
|||||||
# we have to pass it with a warning.
|
# we have to pass it with a warning.
|
||||||
arch_sync = self.sigvars['repo'][r]['allowed_arches'].copy()
|
arch_sync = self.sigvars['repo'][r]['allowed_arches'].copy()
|
||||||
if arch:
|
if arch:
|
||||||
arch_sync = [arch]
|
arch_sync = arch.split(',')
|
||||||
|
|
||||||
for a in arch_sync:
|
for a in arch_sync:
|
||||||
entry_name = '{}-{}'.format(r, a)
|
entry_name = '{}-{}'.format(r, a)
|
||||||
@ -2304,7 +2304,7 @@ class SigRepoSync:
|
|||||||
# TODO: Add in each repo and their corresponding arch.
|
# TODO: Add in each repo and their corresponding arch.
|
||||||
productmd_date = self.date_stamp.split('.')[0]
|
productmd_date = self.date_stamp.split('.')[0]
|
||||||
Shared.composeinfo_write(
|
Shared.composeinfo_write(
|
||||||
metadata_dir + '/composeinfo',
|
sync_root,
|
||||||
self.distname,
|
self.distname,
|
||||||
self.shortname,
|
self.shortname,
|
||||||
self.fullversion,
|
self.fullversion,
|
||||||
|
@ -950,7 +950,7 @@ class Shared:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def composeinfo_write(
|
def composeinfo_write(
|
||||||
file_path,
|
compose_path,
|
||||||
distname,
|
distname,
|
||||||
shortname,
|
shortname,
|
||||||
release,
|
release,
|
||||||
@ -965,8 +965,10 @@ class Shared:
|
|||||||
arches and repos may be better suited for a dictionary. that is a
|
arches and repos may be better suited for a dictionary. that is a
|
||||||
future thing we will work on for 0.5.0.
|
future thing we will work on for 0.5.0.
|
||||||
"""
|
"""
|
||||||
cijson = file_path + '.json'
|
metadata_dir = compose_path + '/metadata'
|
||||||
ciyaml = file_path + '.yaml'
|
composeinfo_path = metadata_dir + '/composeinfo'
|
||||||
|
cijson = composeinfo_path + '.json'
|
||||||
|
ciyaml = composeinfo_path + '.yaml'
|
||||||
ci = productmd.composeinfo.ComposeInfo()
|
ci = productmd.composeinfo.ComposeInfo()
|
||||||
ci.release.name = distname
|
ci.release.name = distname
|
||||||
ci.release.short = shortname
|
ci.release.short = shortname
|
||||||
@ -985,6 +987,24 @@ class Shared:
|
|||||||
variant_repo.name = repo
|
variant_repo.name = repo
|
||||||
variant_repo.type = "variant"
|
variant_repo.type = "variant"
|
||||||
variant_repo.arches = set(arches)
|
variant_repo.arches = set(arches)
|
||||||
|
# directories...
|
||||||
|
# if the repo is BaseOS, set the "isos" to isos/ARCH
|
||||||
|
for arch in variant_repo.arches:
|
||||||
|
variant_repo.paths.os_tree[arch] = repo + "/" + arch + "/os"
|
||||||
|
variant_repo.paths.repository[arch] = repo + "/" + arch + "/os"
|
||||||
|
variant_repo.paths.packages[arch] = repo + "/" + arch + "/os/Packages"
|
||||||
|
# Debug
|
||||||
|
variant_repo.paths.debug_packages[arch] = repo + "/" + arch + "/debug/tree/Packages"
|
||||||
|
variant_repo.paths.debug_repository[arch] = repo + "/" + arch + "/debug/tree"
|
||||||
|
variant_repo.paths.debug_tree[arch] = repo + "/" + arch + "/debug/tree"
|
||||||
|
# Source
|
||||||
|
variant_repo.paths.source_packages[arch] = repo + "/source/tree/Packages"
|
||||||
|
variant_repo.paths.source_repository[arch] = repo + "/source/tree"
|
||||||
|
variant_repo.paths.source_tree[arch] = repo + "/source/tree"
|
||||||
|
|
||||||
|
if "BaseOS" or "Minimal" in repo:
|
||||||
|
variant_repo.paths.isos[arch] = "isos/" + arch
|
||||||
|
variant_repo.paths.images[arch] = "images/" + arch
|
||||||
|
|
||||||
ci.variants.add(variant_repo)
|
ci.variants.add(variant_repo)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user