gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] [PATCH] Fixes manual use of regress-driver with binary lo


From: Jon Schlueter
Subject: Re: [gpsd-dev] [PATCH] Fixes manual use of regress-driver with binary logs.
Date: Sat, 20 Feb 2016 23:36:21 -0500

good catch, merged!

Jon

On Sat, Feb 20, 2016 at 7:37 PM, Fred Wright <address@hidden> wrote:
At present, running regress-driver manually on binary logs may fail,
even though it works when run from scons.  This is due to running in
an unsanitized environment when run manually.

The problem is that sed is being used to filter the daemon output, and
it's not really kosher to be using sed on binary data.  Whether the
"working" cases involve its working "correctly" or merely
"reproducibly" is unclear, but what is clear is that in can choke on
binary data with certain settings of the LANG environment variable (in
particular, "en_US.UTF-8" is known to fail on ac12_binary).  The fix
is merely to unset LANG in regress-driver.

Failures on binary data are also not very informative due to diff
simply reporting "binary files differ".  That can be fixed by adding
the -b option to diff, but the resulting output can contain characters
that screw up the terminal, so it's probably not a good default.

TESTED:
Ran the full "scons check" with this change, as well as a manual
"./regress-driver test/daemon/*.log", and observed success in both
cases.
---
 regress-driver | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/regress-driver b/regress-driver
index ea75820..f3b886e 100755
--- a/regress-driver
+++ b/regress-driver
@@ -14,6 +14,9 @@ else
     GPSD_HOME=`dirname $0`
 fi

+# sed may choke on binary data with some LANG settings
+unset LANG
+
 # Arrange to call a gpsfake in the source directory without fuss.
 if [ -z ${PYTHON} ]; then
     PYTHON="python2"
--
2.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]