201-450 · Question #178
When building an RPM package, which rpmbuild option is used to unpack sources and apply patches before proceeding with the next steps?
The correct answer is E. -bp. Option E (-bp) is correct because the -bp flag tells rpmbuild to execute only through the %prep section of the spec file - which is precisely where sources are unpacked (via %setup) and patches are applied (via %patch). This makes it ideal for inspecting the source tree before…
Question
Options
- A-ba
- B-bb
- C-be
- D-bs
- E-bp
How the community answered
(22 responses)- A5% (1)
- B18% (4)
- D5% (1)
- E73% (16)
Explanation
Option E (-bp) is correct because the -bp flag tells rpmbuild to execute only through the %prep section of the spec file - which is precisely where sources are unpacked (via %setup) and patches are applied (via %patch). This makes it ideal for inspecting the source tree before compilation begins.
Why the distractors are wrong:
- -ba builds everything: both the binary RPM and source RPM (all stages).
- -bb builds only the binary RPM, running all stages through
%install. - -be executes through the
%checksection, running tests after compilation. - -bs builds only the source RPM without ever compiling anything.
Memory tip: Think of the letter as mapping to the spec file stage it stops at - p for %prep, c for %compile, i for %install, a for all. If you need to "peek at the patched source," use -bp.
Topics
Community Discussion
No community discussion yet for this question.