diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-11-07 10:29:18 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-11-07 10:30:45 +0000 |
commit | f835540496599596c7682621fa24f1612d8217ad (patch) | |
tree | c96e92249affbb11afbae506f3ae5789bd7cd90e /main/apk-tools/0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch | |
parent | b825d06115aa7a4c7788b9368949921e2c57a7b1 (diff) | |
download | aports-f835540496599596c7682621fa24f1612d8217ad.tar.bz2 aports-f835540496599596c7682621fa24f1612d8217ad.tar.xz |
Revert "main/apk-tools: fix progress bar in musl builds"
The moving progress bar to stdout breaks the progressbar in initramfs.
We will deal with musl later.
This reverts commit dc6f406066b464b6afa5ccc8f4dab92c802a1cfb.
Diffstat (limited to 'main/apk-tools/0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch')
-rw-r--r-- | main/apk-tools/0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/main/apk-tools/0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch b/main/apk-tools/0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch deleted file mode 100644 index 82d7b13479..0000000000 --- a/main/apk-tools/0002-print-use-stdout-instead-of-stderr-for-logging-and-p.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 517378721855280d2e23d25d7529e6b9cbae9136 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi> -Date: Fri, 11 Oct 2013 14:52:34 +0300 -Subject: [PATCH] print: use stdout instead of stderr for logging and progress - -stdout is the proper place for it. this also fixes the progress -bar in musl, which seems to not support using line buffering for -stderr. ---- - src/apk.c | 1 - - src/print.c | 20 ++++++++++---------- - 2 files changed, 10 insertions(+), 11 deletions(-) - -diff --git a/src/apk.c b/src/apk.c -index 8744de6..8a3c7ef 100644 ---- a/src/apk.c -+++ b/src/apk.c -@@ -266,7 +266,6 @@ static void on_sigwinch(int s) - - static void setup_terminal(void) - { -- setvbuf(stderr, NULL, _IOLBF, BUFSIZ); - signal(SIGWINCH, on_sigwinch); - signal(SIGPIPE, SIG_IGN); - } -diff --git a/src/print.c b/src/print.c -index 6d00064..aafe2ef 100644 ---- a/src/print.c -+++ b/src/print.c -@@ -35,7 +35,7 @@ int apk_get_screen_width(void) - - if (apk_screen_width == 0) { - apk_screen_width = 50; -- if (ioctl(STDERR_FILENO, TIOCGWINSZ, &w) == 0 && -+ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &w) == 0 && - w.ws_col > 50) - apk_screen_width = w.ws_col; - } -@@ -77,14 +77,14 @@ void apk_print_progress(size_t done, size_t total) - last_percent = percent; - apk_progress_force = 0; - -- fprintf(stderr, "\e7%3i%% [", percent); -+ fprintf(stdout, "\e7%3i%% [", percent); - for (i = 0; i < bar; i++) -- fputc('#', stderr); -+ fputc('#', stdout); - for (; i < bar_width; i++) -- fputc(' ', stderr); -- fputc(']', stderr); -- fflush(stderr); -- fputs("\e8\e[0K", stderr); -+ fputc(' ', stdout); -+ fputc(']', stdout); -+ fflush(stdout); -+ fputs("\e8\e[0K", stdout); - } - - int apk_print_indented(struct apk_indent *i, apk_blob_t blob) -@@ -144,11 +144,11 @@ void apk_log(const char *prefix, const char *format, ...) - va_list va; - - if (prefix != NULL) -- fprintf(stderr, "%s", prefix); -+ fprintf(stdout, "%s", prefix); - va_start(va, format); -- vfprintf(stderr, format, va); -+ vfprintf(stdout, format, va); - va_end(va); -- fprintf(stderr, "\n"); -+ fprintf(stdout, "\n"); - apk_progress_force = 1; - } - --- -1.8.4 - |