Mon Mar 28 19:36:31 2011 UTC ()
Add hunk: don't assume bare split writes @_, because new perl doesn't.

Rename patchfile for new convention, and add comments.


(gdt)
diff -r1.4 -r1.5 pkgsrc/graphics/xplot-devel/Makefile
diff -r1.3 -r1.4 pkgsrc/graphics/xplot-devel/distinfo
diff -r1.1 -r0 pkgsrc/graphics/xplot-devel/patches/patch-ab
diff -r0 -r1.1 pkgsrc/graphics/xplot-devel/patches/patch-tcpdump2xplot.pl

cvs diff -r1.4 -r1.5 pkgsrc/graphics/xplot-devel/Makefile (expand / switch to context diff)
--- pkgsrc/graphics/xplot-devel/Makefile 2010/01/29 23:54:31 1.4
+++ pkgsrc/graphics/xplot-devel/Makefile 2011/03/28 19:36:30 1.5
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2010/01/29 23:54:31 joerg Exp $
+# $NetBSD: Makefile,v 1.5 2011/03/28 19:36:30 gdt Exp $
 
 DISTNAME=	xplot-0.90.8
-PKGREVISION=	1
+PKGREVISION=	2
 CATEGORIES=	graphics x11
 MASTER_SITES=	http://acert.ir.bbn.com/downloads/acert-geospatial/
 HOMEPAGE=	http://www.xplot.org/

cvs diff -r1.3 -r1.4 pkgsrc/graphics/xplot-devel/distinfo (expand / switch to context diff)
--- pkgsrc/graphics/xplot-devel/distinfo 2006/10/16 18:20:29 1.3
+++ pkgsrc/graphics/xplot-devel/distinfo 2011/03/28 19:36:30 1.4
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.3 2006/10/16 18:20:29 gdt Exp $
+$NetBSD: distinfo,v 1.4 2011/03/28 19:36:30 gdt Exp $
 
 SHA1 (xplot-0.90.8.tar.gz) = d87a382b01c7a48787d2c6fa2d16e0961de9d81c
 RMD160 (xplot-0.90.8.tar.gz) = ac8877ad7fa1c80afa0281236b3a4992482109c2
 Size (xplot-0.90.8.tar.gz) = 243259 bytes
 SHA1 (patch-aa) = 48a475a550a2ea9d2bc50f2782d598830802817e
-SHA1 (patch-ab) = f7eaac7296a830584b2cf02324086101579cc3d5
 SHA1 (patch-ad) = fd19823030badf91734fde92b45fcaecc06cf0f8
+SHA1 (patch-tcpdump2xplot.pl) = 9e50ee6591d4fe68ae8839025aa8fd5d22d29503

File Deleted: pkgsrc/graphics/xplot-devel/patches/Attic/patch-ab

File Added: pkgsrc/graphics/xplot-devel/patches/patch-tcpdump2xplot.pl
$NetBSD: patch-tcpdump2xplot.pl,v 1.1 2011/03/28 19:36:30 gdt Exp $

# This patch contains minor changes to parsing tcpdump to adapt to
# tcpdump's output changes.  These changes should be merged upstream.
# Upstream has no bug tracker but $MAINTAINER is an upstream maintainer.
# Specifically:
#   omit tos information - we don't use it and it confuses the parser
#   bare split breaks in modern perl - assgin to @_ explicitly
#   remove "IP" as second field
#   allow multiple spaces when splitting sack.

--- tcpdump2xplot.pl.orig	2006-07-27 19:55:59.000000000 +0000
+++ tcpdump2xplot.pl
@@ -229,12 +229,16 @@ for ($lineNo = 1; <$Tcpdump>; $lineNo++)
     local(%opts);
 
     chop;
+    # strip unwanted output added by modern tcdump versions in verbose mode
+    s/\(tos.*?\)//;     # (tos 0x0, ttl ... length: \d+)
+    s/ \[(?:bad )?tcp (?:ck)?sum.*?\]//; # [tcp sum ok]/[bad tcp cksum ....]
     $opts = $_;   # save this for later 
 
-    split(/ /);
-    if ($_[1] == "IP") {
-	splice @_,1,1;
-    }
+    @_ = split(/ +/);
+    # Sometime after version 3.7.1 tcpdump started to print 'IP'
+    # as the second field in the output. Get rid of it again.
+    # also remove additional fields printed in verbose mode
+    splice @_, 1, 1 if $_[1] eq 'IP';
     $time = $_[0];
 
     # If there is if_signal.c-style signal strength info, elide it.
@@ -432,7 +436,7 @@ for ($lineNo = 1; <$Tcpdump>; $lineNo++)
 
 		# print stderr "SACKS after : $sacks \n";
 
-		@sacks = split(/ /, $sacks);
+		@sacks = split(/ +/, $sacks);
 		
 		for ($i = 0; $i <= $#sacks; $i++) {
 		    local($start);