Skip to content

Commit b389e04

Browse files
committed
gpgtar: Use log-file from common.conf only in --batch mode.
* tools/gpgtar.c (main): Do it. -- This makes the interactive use of gpgtar more convenient and is more aligned to what gpg and gpgsm do.
1 parent 8359f2e commit b389e04

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

doc/tools.texi

+2-1
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,8 @@ implemented.
20602060
@item --batch
20612061
@opindex batch
20622062
Use batch mode. Never ask but use the default action. This option is
2063-
passed directly to @command{gpg}.
2063+
passed directly to @command{gpg}. This option is also required to
2064+
activate the @option{log-file} in @file{common.conf} for this program.
20642065

20652066
@item --yes
20662067
@opindex yes

tools/gpgtar.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -496,8 +496,11 @@ main (int argc, char **argv)
496496
if (log_get_errorcount (0))
497497
exit (2);
498498

499-
/* Get a log file from common.conf. */
500-
if (!parse_comopt (GNUPG_MODULE_NAME_GPGTAR, any_debug) && comopt.logfile)
499+
/* Get a log file from common.conf but use it only in --batch mode
500+
* because people expect to see the verbose output here even if they
501+
* have a log-file in their common.conf. */
502+
if (!parse_comopt (GNUPG_MODULE_NAME_GPGTAR, any_debug) && comopt.logfile
503+
&& opt.batch)
501504
log_set_file (comopt.logfile);
502505

503506
/* Print a warning if an argument looks like an option. */

0 commit comments

Comments
 (0)