summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-03-01 07:27:06 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-03-01 07:27:06 +0000
commitce4c043805865f745e6aa8762455a2f9b19b25cd (patch)
tree729209530fd842b9d61c6728ef637872bab58e62
parentb868e0296793f398cbc2ffed3a2c2fb3e9fbc788 (diff)
disable progress bar if the output is redirected (patch from VMiklos <vmiklos@frugalware.org>)
-rw-r--r--src/pacman/pacman.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 73f8c637..18422e39 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -88,6 +88,10 @@ int main(int argc, char *argv[])
config = config_new();
config->op = PM_OP_MAIN;
config->debug |= PM_LOG_WARNING;
+ /* disable progressbar if the output is redirected */
+ if(!isatty(1)) {
+ config->noprogressbar = 1;
+ }
/* parse the command line */
ret = parseargs(argc, argv);