From 6c6183db6f3e4084b05cb366f49b37b8c89999d2be403d1e2e6c7ea0aea14f2d Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 30 Jan 2014 12:35:04 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=501 --- ...s390_con3270_disable_ANSI_colour_esc.patch | 89 +++++++++++++++++++ systemd-mini.changes | 7 ++ systemd-mini.spec | 5 ++ systemd.changes | 7 ++ systemd.spec | 5 ++ 5 files changed, 113 insertions(+) create mode 100644 0001-On_s390_con3270_disable_ANSI_colour_esc.patch diff --git a/0001-On_s390_con3270_disable_ANSI_colour_esc.patch b/0001-On_s390_con3270_disable_ANSI_colour_esc.patch new file mode 100644 index 00000000..e225f29f --- /dev/null +++ b/0001-On_s390_con3270_disable_ANSI_colour_esc.patch @@ -0,0 +1,89 @@ +--- systemd-208/src/shared/util.c ++++ systemd-208/src/shared/util.c 2014-01-30 12:23:20.094236656 +0000 +@@ -2967,6 +2967,7 @@ int status_vprintf(const char *status, b + struct iovec iovec[6] = {}; + int n = 0; + static bool prev_ephemeral; ++ static int cached_on_tty = -1; + + assert(format); + +@@ -2980,6 +2981,47 @@ int status_vprintf(const char *status, b + if (fd < 0) + return fd; + ++ if (_unlikely_(cached_on_tty < 0)) { ++ cached_on_tty = isatty(fd) > 0; ++ if (cached_on_tty) { ++ const char *e = getenv("TERM"); ++ if (e && (strcmp(e, "dumb") == 0 || strcmp(e, "ibm327x") == 0)) ++ cached_on_tty = 0; ++ } ++ } ++ ++ if (status && !cached_on_tty) { ++ const char *esc, *ptr; ++ esc = strchr(status, 0x1B); ++ if (esc && (ptr = strpbrk(esc, "SOFDTI*"))) { ++ switch(*ptr) { ++ case 'S': ++ status = " SKIP "; ++ break; ++ case 'O': ++ status = " OK "; ++ break; ++ case 'F': ++ status = "FAILED"; ++ break; ++ case 'D': ++ status = "DEPEND"; ++ break; ++ case 'T': ++ status = " TIME "; ++ break; ++ case 'I': ++ status = " INFO "; ++ break; ++ case '*': ++ status = " BUSY "; ++ break; ++ default: ++ break; ++ } ++ } ++ } ++ + if (ellipse) { + char *e; + size_t emax, sl; +@@ -3002,8 +3044,12 @@ int status_vprintf(const char *status, b + } + } + +- if (prev_ephemeral) +- IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE); ++ if (prev_ephemeral) { ++ if (cached_on_tty) ++ IOVEC_SET_STRING(iovec[n++], "\r" ANSI_ERASE_TO_END_OF_LINE); ++ else ++ IOVEC_SET_STRING(iovec[n++], "\r"); ++ } + prev_ephemeral = ephemeral; + + if (status) { +@@ -3267,8 +3313,14 @@ void columns_lines_cache_reset(int signu + bool on_tty(void) { + static int cached_on_tty = -1; + +- if (_unlikely_(cached_on_tty < 0)) ++ if (_unlikely_(cached_on_tty < 0)) { + cached_on_tty = isatty(STDOUT_FILENO) > 0; ++ if (cached_on_tty) { ++ const char *e = getenv("TERM"); ++ if (e && (strcmp(e, "dumb") == 0 || strcmp(e, "ibm327x") == 0)) ++ cached_on_tty = 0; ++ } ++ } + + return cached_on_tty; + } diff --git a/systemd-mini.changes b/systemd-mini.changes index 39675682..df17ae6d 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 30 12:33:08 UTC 2014 - werner@suse.de + +- Add patch 0001-On_s390_con3270_disable_ANSI_colour_esc.patch + to strip the colouring ANSI escape sequences from the console + messages (bnc#860937) + ------------------------------------------------------------------- Thu Jan 30 08:29:00 UTC 2014 - werner@suse.de diff --git a/systemd-mini.spec b/systemd-mini.spec index 33ae73a6..afb10340 100644 --- a/systemd-mini.spec +++ b/systemd-mini.spec @@ -271,6 +271,8 @@ Patch87: 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch Patch88: 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch # PATCH-FIX-UPSTREAM 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch -- Make sure final SIGKILL actually kills everything (bnc#841544) Patch89: 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch +# PATCH-FIX-SUSE 0001-On_s390_con3270_disable_ANSI_colour_esc.patch +Patch90: 0001-On_s390_con3270_disable_ANSI_colour_esc.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -580,6 +582,9 @@ cp %{SOURCE7} m4/ %patch87 -p1 %patch88 -p1 %patch89 -p1 +%ifarch s390 s390x +%patch90 -p1 +%endif # udev patches %patch1001 -p1 diff --git a/systemd.changes b/systemd.changes index 39675682..df17ae6d 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Jan 30 12:33:08 UTC 2014 - werner@suse.de + +- Add patch 0001-On_s390_con3270_disable_ANSI_colour_esc.patch + to strip the colouring ANSI escape sequences from the console + messages (bnc#860937) + ------------------------------------------------------------------- Thu Jan 30 08:29:00 UTC 2014 - werner@suse.de diff --git a/systemd.spec b/systemd.spec index 07823db2..565cf692 100644 --- a/systemd.spec +++ b/systemd.spec @@ -266,6 +266,8 @@ Patch87: 0001-core-introduce-new-KillMode-mixed-which-sends-SIGTER.patch Patch88: 0002-service-allow-KillMode-mixed-in-conjunction-with-PAM.patch # PATCH-FIX-UPSTREAM 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch -- Make sure final SIGKILL actually kills everything (bnc#841544) Patch89: 0003-core-make-sure-to-always-go-through-both-SIGTERM-and.patch +# PATCH-FIX-SUSE 0001-On_s390_con3270_disable_ANSI_colour_esc.patch +Patch90: 0001-On_s390_con3270_disable_ANSI_colour_esc.patch # udev patches # PATCH-FIX-OPENSUSE 1001-re-enable-by_path-links-for-ata-devices.patch @@ -575,6 +577,9 @@ cp %{SOURCE7} m4/ %patch87 -p1 %patch88 -p1 %patch89 -p1 +%ifarch s390 s390x +%patch90 -p1 +%endif # udev patches %patch1001 -p1