Fix regression: -bp should check BuildRequires

Some source packages assume that BuildRequires are installed before
%prep is executed.  For example, `openssh` BuildRequires `automake` and
runs `autoreconf` in %prep.

Prior to 11c56d5 `rpmbuild -bp` checked BuildRequires and printed a
helpful error message if there were any missing dependencies.  Since
that commit, `rpmbuild -bp` skips the BuildRequires check, which can
lead to misleading errors in %prep.

This commit restores the BuildRequires check in `rpmbuild -bp`.

Co-authored-by: Florian Festi <ffesti@redhat.com>
This commit is contained in:
Paul Donohue 2022-11-08 11:00:23 -05:00 committed by Panu Matilainen
parent 1281c928a7
commit 0d6429a4d9
1 changed files with 3 additions and 0 deletions

View File

@ -674,6 +674,9 @@ int main(int argc, char *argv[])
/* fallthrough */ /* fallthrough */
case 'p': case 'p':
ba->buildAmount |= RPMBUILD_PREP; ba->buildAmount |= RPMBUILD_PREP;
if (!noDeps) {
ba->buildAmount |= RPMBUILD_CHECKBUILDREQUIRES;
}
break; break;
case 'l': case 'l':
ba->buildAmount |= RPMBUILD_FILECHECK; ba->buildAmount |= RPMBUILD_FILECHECK;