mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Fix mime type diff canonifier to also skip mime_desc columns
In particular, the ftp.log baseline in the new ipv6 test in bro-testing was failign on various platforms because of this.
This commit is contained in:
parent
508ac1c7ba
commit
907c92e1cc
1 changed files with 12 additions and 5 deletions
|
@ -3,20 +3,27 @@
|
||||||
# A diff canonifier that removes all MIME types because libmagic output
|
# A diff canonifier that removes all MIME types because libmagic output
|
||||||
# can differ between installations.
|
# can differ between installations.
|
||||||
|
|
||||||
BEGIN { FS="\t"; OFS="\t"; column = -1; }
|
BEGIN { FS="\t"; OFS="\t"; type_col = -1; desc_col = -1 }
|
||||||
|
|
||||||
/^#fields/ {
|
/^#fields/ {
|
||||||
for ( i = 2; i < NF; ++i )
|
for ( i = 2; i < NF; ++i )
|
||||||
|
{
|
||||||
if ( $i == "mime_type" )
|
if ( $i == "mime_type" )
|
||||||
column = i-1;
|
type_col = i-1;
|
||||||
|
if ( $i == "mime_desc" )
|
||||||
|
desc_col = i-1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
column >= 0 {
|
function remove_mime (n) {
|
||||||
if ( $column != "-" )
|
if ( n >= 0 && $n != "-" )
|
||||||
# Mark that it's set, but ignore content.
|
# Mark that it's set, but ignore content.
|
||||||
$column = "+";
|
$n = "+"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remove_mime(type_col)
|
||||||
|
remove_mime(desc_col)
|
||||||
|
|
||||||
{
|
{
|
||||||
print;
|
print;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue