Skip to content

Commit

Permalink
Fail the build if %_build_pkgcheck_set failed
Browse files Browse the repository at this point in the history
RPM build did not fail if rpmlint (%_build_pkgcheck_set) failed when checking binary RPMs
(it did fail correctly when rpmlint failed when checking SRPMs)

If %_nonzero_exit_pkgcheck_terminate_build is true, then the build must fail, otherwise it must not.
This regressed and the build never failed.

Probably fixes regression introduced by 78f61f2 ("Refactor package set checking out of packageBinaries()")
  • Loading branch information
mikhailnov authored and pmatilai committed Jun 10, 2020
1 parent 32e2bc5 commit bea87e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions build/pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ static rpmRC checkPackageSet(Package pkgs)
{
char *pkglist = NULL;
char *pkgcheck_set = NULL;
rpmRC rc = RPMRC_OK;

for (Package pkg = pkgs; pkg != NULL; pkg = pkg->next) {
if (pkg->filename)
Expand All @@ -628,11 +629,11 @@ static rpmRC checkPackageSet(Package pkgs)

/* run only if _build_pkgcheck_set is defined */
if (pkgcheck_set[0] != ' ')
checkPackages(pkgcheck_set);
rc = checkPackages(pkgcheck_set);

free(pkgcheck_set);
free(pkglist);
return RPMRC_OK;
return rc;
}

/* watchout, argument is modified */
Expand Down Expand Up @@ -782,7 +783,7 @@ rpmRC packageBinaries(rpmSpec spec, const char *cookie, int cheating)

/* Now check the package set if enabled */
if (rc == RPMRC_OK)
checkPackageSet(spec->packages);
rc = checkPackageSet(spec->packages);

free(tasks);

Expand Down

0 comments on commit bea87e4

Please sign in to comment.