2
0
mirror of https://github.com/xcat2/xcat-dep.git synced 2026-09-25 17:24:11 +00:00

fix(mockbuild): keep the empty-collection guards ahead of the Genesis release

The Genesis release is installed from a verified directory instead of being
built here, so counting it before the "did anything build?" checks made those
checks unreachable with --genesis-release: a run whose builders had all failed
carried seven release packages past the guard, ran createrepo, and copied them
into the deployable per-EL tree before assert_required_deps stopped it, naming
the missing dependencies rather than the failed builds.

Assert on what the run collected first, then add the release. The source-RPM
warning was masked the same way and moves with it.
This commit is contained in:
Vinícius Ferrão
2026-08-24 13:07:04 -03:00
parent 64afd0c935
commit 6ed0fa2ba0
+11 -7
View File
@@ -492,13 +492,17 @@ my ($copied, $skipped_src, $missing_roots) = collect_rpms(
dry_run => $dry_run,
);
$copied += install_genesis_release_packages('rpm', $repo_dir)
if $genesis_release && !$dry_run;
# Assert on what this run BUILT, before the Genesis release is added: the release is
# installed from a verified directory rather than built here, so counting it first would
# let a run whose builders all failed reach createrepo and the deployable tree, and fail
# much later in assert_required_deps naming packages instead of the failed builds.
if (!$dry_run && $copied == 0) {
die "No binary RPMs were collected. Check build logs and collection roots.\n";
}
$copied += install_genesis_release_packages('rpm', $repo_dir)
if $genesis_release && !$dry_run;
# Ensure the OS-dependent xCAT-genesis-base rpm (built by the genesis step above)
# lands in the dep repo even when the full xCAT core is built elsewhere (--skip-xcat).
if (!$skip_genesis && !$dry_run) {
@@ -520,16 +524,16 @@ my ($copied_srpms, $skipped_non_src, $missing_srpm_roots) = collect_srpms(
dry_run => $dry_run,
);
if (!$dry_run && $copied_srpms == 0) {
print "WARN: No source RPMs were collected. SRPM repo and tarball may be empty.\n";
}
$copied_srpms += install_genesis_release_packages('srpm', $srpm_repo_dir)
if $genesis_release && !$dry_run;
assert_genesis_release_copied($repo_dir, $srpm_repo_dir)
if $genesis_release && !$dry_run;
if (!$dry_run && $copied_srpms == 0) {
print "WARN: No source RPMs were collected. SRPM repo and tarball may be empty.\n";
}
if (!$skip_createrepo) {
run_step(
step => 'Run createrepo',