logrotate/logrotate-fix-test62_with_bash-4.4.patch

30 lines
1.1 KiB
Diff
Raw Normal View History

From 61f22b1eb2bd441bce998240701b0acd03265a47 Mon Sep 17 00:00:00 2001
From: Dominique Leuenberger <dimstar@opensuse.org>
Date: Mon, 3 Oct 2016 16:43:00 +0200
Subject: [PATCH] Fix test suite in combination with bash 4.4
Until bash 4.4, variables were silently stripped of NUL bytes; with Bash 4.4
this results now for every single 0-byte that is being stripped in a warning:
./test: line 170: warning: command substitution: ignored null byte in input
We now simply strip the NUL bytes before we have bash assign the values to
a variable. The result is the same.
---
test/test | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: logrotate-3.10.0/test/test
===================================================================
--- logrotate-3.10.0.orig/test/test
+++ logrotate-3.10.0/test/test
@@ -183,7 +183,7 @@ checkoutput() {
if [ -n "$co_compressed" ] && [ "$co_compressed" != 0 ]; then
contents=`gunzip -c $file`
else
- contents=`cat $file`
+ contents=`cat $file | tr -d '\000'`
fi
if [ "$contents" != "$expected" ]; then
echo "file $file does not contain expected results (compressed $co_compressed, args $*)" >&2