[pacman-dev] [PATCH v2] Add NoProgressbar to pacman.conf options
From: Ivy Foster <escondida@iff.ink> This is useful for dumb terminals that do not support escape sequences. Signed-off-by: Ivy Foster <escondida@iff.ink> --- doc/pacman.conf.5.asciidoc | 4 ++++ etc/pacman.conf.in | 1 + src/pacman/conf.c | 2 ++ src/pacman/pacman-conf.c | 3 +++ 4 files changed, 10 insertions(+) diff --git a/doc/pacman.conf.5.asciidoc b/doc/pacman.conf.5.asciidoc index b297e332..ecbbd8b3 100644 --- a/doc/pacman.conf.5.asciidoc +++ b/doc/pacman.conf.5.asciidoc @@ -186,6 +186,10 @@ Options *Color*:: Automatically enable colors only when pacman's output is on a tty. +*NoProgressBar*:: + Disables progressbars. This is useful for terminals which do + not support escape characters. + *TotalDownload*:: When downloading, display the amount downloaded, download rate, ETA, and completed percentage of the entire download list rather diff --git a/etc/pacman.conf.in b/etc/pacman.conf.in index 7446944f..e3c73e13 100644 --- a/etc/pacman.conf.in +++ b/etc/pacman.conf.in @@ -31,6 +31,7 @@ Architecture = auto # Misc options #UseSyslog #Color +#NoProgressBar #TotalDownload CheckSpace #VerbosePkgLists diff --git a/src/pacman/conf.c b/src/pacman/conf.c index f9de386f..e5f37b1a 100644 --- a/src/pacman/conf.c +++ b/src/pacman/conf.c @@ -579,6 +579,8 @@ static int _parse_options(const char *key, char *value, config->color = isatty(fileno(stdout)) ? PM_COLOR_ON : PM_COLOR_OFF; enable_colors(config->color); } + } else if(strcmp(key, "NoProgressBar") == 0) { + config->noprogressbar = 1; } else if(strcmp(key, "DisableDownloadTimeout") == 0) { config->disable_dl_timeout = 1; } else { diff --git a/src/pacman/pacman-conf.c b/src/pacman/pacman-conf.c index 6e25d243..a6f7362b 100644 --- a/src/pacman/pacman-conf.c +++ b/src/pacman/pacman-conf.c @@ -259,6 +259,7 @@ static void dump_config(void) show_bool("VerbosePkgLists", config->verbosepkglists); show_bool("DisableDownloadTimeout", config->disable_dl_timeout); show_bool("ILoveCandy", config->chomp); + show_bool("NoProgressBar", config->noprogressbar); show_cleanmethod("CleanMethod", config->cleanmethod); @@ -368,6 +369,8 @@ static int list_directives(void) show_bool("VerbosePkgLists", config->verbosepkglists); } else if(strcasecmp(i->data, "DisableDownloadTimeout") == 0) { show_bool("DisableDownloadTimeout", config->disable_dl_timeout); + } else if(strcasecmp(i->data, "NoProgressBar") == 0) { + show_bool("NoProgressBar", config->noprogressbar); } else if(strcasecmp(i->data, "CleanMethod") == 0) { show_cleanmethod("CleanMethod", config->cleanmethod); -- 2.26.2
On 24/4/20 4:12 am, escondida@iff.ink wrote:
From: Ivy Foster <escondida@iff.ink>
This is useful for dumb terminals that do not support escape sequences.
Signed-off-by: Ivy Foster <escondida@iff.ink> ---
OK - fixed small typo below while commit the patch.
doc/pacman.conf.5.asciidoc | 4 ++++ etc/pacman.conf.in | 1 + src/pacman/conf.c | 2 ++ src/pacman/pacman-conf.c | 3 +++ 4 files changed, 10 insertions(+)
diff --git a/doc/pacman.conf.5.asciidoc b/doc/pacman.conf.5.asciidoc index b297e332..ecbbd8b3 100644 --- a/doc/pacman.conf.5.asciidoc +++ b/doc/pacman.conf.5.asciidoc @@ -186,6 +186,10 @@ Options *Color*:: Automatically enable colors only when pacman's output is on a tty.
+*NoProgressBar*:: + Disables progressbars. This is useful for terminals which do
progress bars
+ not support escape chara
participants (2)
-
Allan McRae
-
escondida@iff.ink