Excluding log fields of name mime_type for comparision.

This is because libmagic can return different results depending on
installation.

Note, this still doesn't fix all problems: smtp-entities sets md5
depending on the mime-type returned by libmagic ...
This commit is contained in:
Robin Sommer 2011-09-09 11:30:41 -07:00
parent 3a3f58d5df
commit cb2cb117d0
3 changed files with 27 additions and 2 deletions

View file

@ -2,4 +2,7 @@
#
# Default canonifier used with the trace-based tests in testing/external/*.
`dirname $0`/diff-remove-timestamps | `dirname $0`/diff-remove-uids
`dirname $0`/diff-remove-timestamps \
| `dirname $0`/diff-remove-uids \
| `dirname $0`/diff-remove-mime-types \
| `dirname $0`/diff-remove-abspath

View file

@ -0,0 +1,22 @@
#! /usr/bin/awk -f
#
# A diff canonifier that removes all MIME types because libmagic output
# can differ between installations.
BEGIN { FS="\t"; OFS="\t"; column = -1; }
/^#fields/ {
for ( i = 2; i < NF; ++i )
if ( $i == "mime_type" )
column = i-1;
}
column >= 0 {
if ( $column != "-" )
# Mark that it's set, but ignore content.
$column = "+";
}
{
print;
}

View file

@ -2,7 +2,7 @@
#
# A diff canonifier that removes all connection UIDs.
BEGIN { IFS="\t"; OFS="\t"; }
BEGIN { FS="\t"; OFS="\t"; }
column > 0 {
$column = "XXXXXXXXXXX";