Do not redirect command output to /dev/null in non-verbose mode

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>
This commit is contained in:
Igor Gnatenko 2019-05-24 10:55:56 +02:00 committed by Panu Matilainen
parent 11c56d5aaa
commit d0754b4f2c
2 changed files with 4 additions and 2 deletions

View File

@ -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 */
@ -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;

View File

@ -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}}\"\