Blame SOURCES/0013-test-functions-add-CHOMP-macro-for-shell-output.patch

8a3219
From d74f03af843c71872e60af4a59204a6cab4cd934 Mon Sep 17 00:00:00 2001
8a3219
From: Eric Garver <eric@garver.life>
8a3219
Date: Mon, 22 Jul 2019 14:48:19 -0400
8a3219
Subject: [PATCH 13/20] test: functions: add CHOMP macro for shell output
8a3219
8a3219
chomps all trailing newlines by exploiting posix shell behavior for
8a3219
variable expansion.
8a3219
8a3219
(cherry picked from commit a8b90c38c19732f3dc9ca5cfedc10bb54c0d84bf)
8a3219
---
8a3219
 src/tests/functions.at | 3 ++-
8a3219
 1 file changed, 2 insertions(+), 1 deletion(-)
8a3219
8a3219
diff --git a/src/tests/functions.at b/src/tests/functions.at
8a3219
index 28af5a7fc532..8aeaf158a066 100644
8a3219
--- a/src/tests/functions.at
8a3219
+++ b/src/tests/functions.at
8a3219
@@ -226,7 +226,8 @@ m4_define([FWD_GREP_LOG], [
8a3219
 m4_define([TRIM], [[sed -e 's/^[ \t]*//' -e 's/[ \t]*$//']])
8a3219
 m4_define([TRIMV], [[sed -e '/^[ \t]*$/d']])
8a3219
 m4_define([TRIM_INTERNAL], [[sed -e 's/[ \t]\+/ /g']])
8a3219
-m4_define([TRIM_WHITESPACE], [TRIM | TRIMV | TRIM_INTERNAL])
8a3219
+m4_define([CHOMP], [printf "%s" "$(cat /dev/stdin)"])
8a3219
+m4_define([TRIM_WHITESPACE], [TRIM | TRIMV | TRIM_INTERNAL | { CHOMP; echo; }])
8a3219
 
8a3219
 dnl m4sugar's m4_strip has a bug that causes it to print a space after
8a3219
 dnl newlines. So implement our own suck-less version.
8a3219
-- 
8a3219
2.20.1
8a3219