ALBS-987: Generate i686 and dev repositories with pungi on building new distr. version automatically
- Some refactoring
This commit is contained in:
parent
6d58bc2ed8
commit
0747e967b0
@ -203,31 +203,12 @@ class KojiMock:
|
|||||||
packages = []
|
packages = []
|
||||||
|
|
||||||
# get all rpms in folder
|
# get all rpms in folder
|
||||||
rpms = search_rpms(self._packages_dir)
|
rpms = search_rpms(Path(self._packages_dir))
|
||||||
all_rpms = [package.path for package in rpms]
|
|
||||||
|
|
||||||
# get nvras for modular packages
|
for rpm in rpms:
|
||||||
nvras = set()
|
info = parse_nvra(rpm.path.stem)
|
||||||
for module in self._modules.values():
|
if 'module' in info['release']:
|
||||||
path = os.path.join(
|
continue
|
||||||
self._modules_dir,
|
|
||||||
module.arch,
|
|
||||||
module.nvr,
|
|
||||||
)
|
|
||||||
info = Modulemd.ModuleStream.read_string(open(path).read(), strict=True)
|
|
||||||
|
|
||||||
for package in info.get_rpm_artifacts():
|
|
||||||
data = parse_nvra(package)
|
|
||||||
nvras.add((data['name'], data['version'], data['release'], data['arch']))
|
|
||||||
|
|
||||||
# and remove modular packages from global list
|
|
||||||
for rpm in all_rpms[:]:
|
|
||||||
data = parse_nvra(os.path.basename(rpm[:-4]))
|
|
||||||
if (data['name'], data['version'], data['release'], data['arch']) in nvras:
|
|
||||||
all_rpms.remove(rpm)
|
|
||||||
|
|
||||||
for rpm in all_rpms:
|
|
||||||
info = parse_nvra(os.path.basename(rpm))
|
|
||||||
packages.append({
|
packages.append({
|
||||||
"build_id": RELEASE_BUILD_ID,
|
"build_id": RELEASE_BUILD_ID,
|
||||||
"name": info['name'],
|
"name": info['name'],
|
||||||
|
Loading…
Reference in New Issue
Block a user