diff mbox series

[OpenWrt-Devel] Honour NO_COLOR in include/scan.mk

Message ID mailman.18154.1548856897.2376.openwrt-devel@lists.openwrt.org
State Superseded
Delegated to: Hauke Mehrtens
Headers show
Series [OpenWrt-Devel] Honour NO_COLOR in include/scan.mk | expand

Commit Message

Thomas Richard via openwrt-devel Jan. 30, 2019, 2:01 p.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
> Could you please send a V2 with the requested change
 > to print $(1) without ANSII escape sequences?

Here it goes:

Honour NO_COLOR in Makefile function 'progress' in include/scan.mk, in 
the same way that include/verbose.mk does.


Signed-off-by: R. Diez <R. Diez>
---
  include/scan.mk | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/include/scan.mk b/include/scan.mk
index e6b21b27b0..d9cd4f7e8c 100644
--- a/include/scan.mk
+++ b/include/scan.mk
@@ -19,9 +19,15 @@  else
  endif

  ifeq ($(IS_TTY),1)
-  define progress
+  ifneq ($(strip $(NO_COLOR)),1)
+    define progress
  	printf "\033[M\r$(1)" >&2;
-  endef
+    endef
+  else
+    define progress
+	printf "\r$(1)" >&2;
+    endef
+  endif
  else
    define progress
  	:;