logrotate/logrotate-fix-test62_with_bash-4.4.patch
Dirk Mueller e408d24b71 Accepting request 432966 from home:dimstar:Factory
- Add logrotate-fix-test62_with_bash-4.4.patch: Fix the test suite
  when running with bash 4.4 (gh#logrotate/logrotate#66).

OBS-URL: https://build.opensuse.org/request/show/432966
OBS-URL: https://build.opensuse.org/package/show/Base:System/logrotate?expand=0&rev=47
2016-10-04 11:00:37 +00:00

30 lines
1.1 KiB
Diff

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.9.1/test/test
===================================================================
--- logrotate-3.9.1.orig/test/test
+++ logrotate-3.9.1/test/test
@@ -167,7 +167,7 @@ checkoutput() {
if [ -n "$co_compressed" -a "$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