Skip to content

Commit

Permalink
Do not redirect command output to /dev/null in non-verbose mode
Browse files Browse the repository at this point in the history
The output is going to be needed Dynamic BuildRequires.
Just do not duplicated to stdout if verbose mode is not enabled.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
  • Loading branch information
ignatenkobrain authored and pmatilai committed May 28, 2019
1 parent 11c56d5 commit d0754b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion build/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name,
int argc = 0;
const char **argv = NULL;
FILE * fp = NULL;
FILE * cmdOut = rpmIsVerbose() ? stdout : NULL;

FD_t fd = NULL;
rpmRC rc = RPMRC_FAIL; /* assume failure */
Expand Down Expand Up @@ -149,7 +150,8 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name,
(void) poptParseArgvString(buildCmd, &argc, &argv);

rpmlog(RPMLOG_NOTICE, _("Executing(%s): %s\n"), name, buildCmd);
if (rpmfcExec((ARGV_const_t)argv, NULL, sb_stdoutp, 1, spec->buildSubdir, stdout)) {
if (rpmfcExec((ARGV_const_t)argv, NULL, sb_stdoutp, 1,
spec->buildSubdir, cmdOut)) {
rpmlog(RPMLOG_ERR, _("Exec of %s failed (%s): %s\n"),
scriptName, name, strerror(errno));
goto exit;
Expand Down
2 changes: 1 addition & 1 deletion macros.in
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ package or when debugging this package.\
PKG_CONFIG_PATH=\"${PKG_CONFIG_PATH}:%{_libdir}/pkgconfig:%{_datadir}/pkgconfig\"\
export PKG_CONFIG_PATH\
\
%{verbose:set -x}%{!verbose:exec > /dev/null}\
%{verbose:set -x}\
umask 022\
cd \"%{u2p:%{_builddir}}\"\

Expand Down

0 comments on commit d0754b4

Please sign in to comment.