Modify repoclosure for peridot and metadata

* Fix peridot repoclosure script
* Modify shared utils for metadata and repositories (part 1, metadata)
* Modify dnf utils to take advantage of shared utility (part 2, metadata)
This commit is contained in:
Louis Abel 2022-10-11 19:58:17 -07:00
parent f7bff05735
commit 53ab6a9ec5
Signed by untrusted user: label
GPG key ID: B37E62D143879B36
6 changed files with 70 additions and 1 deletions

0
iso/empanadas/empanadas/scripts/peridot_repoclosure.py Normal file → Executable file
View file

View file

@ -0,0 +1,26 @@
# Use this to test upcoming functionality
import argparse
import sys
#import createrepo_c as cr
from empanadas.common import *
from empanadas.util import Checks
from empanadas.util import RepoSync
# Start up the parser baby
parser = argparse.ArgumentParser(description="Peridot Upstream Repoclosure")
# All of our options
parser.add_argument('--release', type=str, help="Major Release Version or major-type (eg 9-beta)", required=True)
# Parse them
results = parser.parse_args()
rlvars = rldict[results.release]
major = rlvars['major']
r = Checks(rlvars, config['arch'])
r.check_valid_arch()
def run():
print(sys.path)

View file

@ -912,7 +912,9 @@ class RepoSync:
self.shortname,
self.fullversion,
'updates',
productmd_date
productmd_date,
self.arches,
self.repos
)
self.log.info(Color.INFO + 'Metadata files phase completed.')

View file

@ -978,6 +978,16 @@ class Shared:
ci.compose.date = datestamp
ci.compose.respin = 0
for repo in repos:
variant_repo = productmd.composeinfo.Variant(ci)
variant_repo.id = repo
variant_repo.uid = repo
variant_repo.name = repo
variant_repo.type = "variant"
variant_repo.arches = set(arches)
ci.variants.add(variant_repo)
ci.dump(cijson)
with open(cijson, 'r') as cidump:

View file

@ -22,6 +22,7 @@ attrs = "^21.4.0"
pytest = "~5"
[tool.poetry.scripts]
test_module = "empanadas.scripts.test_module:run"
sync_from_peridot = "empanadas.scripts.sync_from_peridot:run"
sync_from_peridot_test = "empanadas.scripts.sync_from_peridot_test:run"
sync_sig = "empanadas.scripts.sync_sig:run"

View file

@ -0,0 +1,30 @@
#!/usr/bin/python3
import os
import os.path
import json
import dnf
# Init the dnf configuration
base = dnf.Base()
conf = base.conf
base.read_all_repos()
all_repos = base.repos.all()
all_repos.disable()
base.repos.add_new_repo('all-source', conf, baseurl=['https://yumrepofs.build.resf.org/v1/projects/55b17281-bc54-4929-8aca-a8a11d628738/repo/all/src'])
base.fill_sack()
q = base.sack.query()
a = q.available()
pkg_list = []
for packages in a:
nevr = '{}-{}:{}-{}'.format(
packages.name,
packages.epoch,
packages.version,
packages.release
)
pkg_list.append(nevr)
pkg_list.sort()
print(pkg_list)