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
--- 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,17 +1,17 @@ | | | @@ -1,17 +1,17 @@ |
1 | # $NetBSD: Makefile,v 1.4 2010/01/29 23:54:31 joerg Exp $ | | 1 | # $NetBSD: Makefile,v 1.5 2011/03/28 19:36:30 gdt Exp $ |
2 | | | 2 | |
3 | DISTNAME= xplot-0.90.8 | | 3 | DISTNAME= xplot-0.90.8 |
4 | PKGREVISION= 1 | | 4 | PKGREVISION= 2 |
5 | CATEGORIES= graphics x11 | | 5 | CATEGORIES= graphics x11 |
6 | MASTER_SITES= http://acert.ir.bbn.com/downloads/acert-geospatial/ | | 6 | MASTER_SITES= http://acert.ir.bbn.com/downloads/acert-geospatial/ |
7 | HOMEPAGE= http://www.xplot.org/ | | 7 | HOMEPAGE= http://www.xplot.org/ |
8 | | | 8 | |
9 | MAINTAINER= gdt@NetBSD.org | | 9 | MAINTAINER= gdt@NetBSD.org |
10 | COMMENT= Plotting program (development snapshot) | | 10 | COMMENT= Plotting program (development snapshot) |
11 | | | 11 | |
12 | PKG_DESTDIR_SUPPORT= user-destdir | | 12 | PKG_DESTDIR_SUPPORT= user-destdir |
13 | | | 13 | |
14 | USE_X11BASE= yes | | 14 | USE_X11BASE= yes |
15 | GNU_CONFIGURE= yes | | 15 | GNU_CONFIGURE= yes |
16 | | | 16 | |
17 | DOCFILES= ANNOUNCE README README.tcp_plots \ | | 17 | DOCFILES= ANNOUNCE README README.tcp_plots \ |
--- 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 @@ | | | @@ -1,8 +1,8 @@ |
1 | $NetBSD: distinfo,v 1.3 2006/10/16 18:20:29 gdt Exp $ | | 1 | $NetBSD: distinfo,v 1.4 2011/03/28 19:36:30 gdt Exp $ |
2 | | | 2 | |
3 | SHA1 (xplot-0.90.8.tar.gz) = d87a382b01c7a48787d2c6fa2d16e0961de9d81c | | 3 | SHA1 (xplot-0.90.8.tar.gz) = d87a382b01c7a48787d2c6fa2d16e0961de9d81c |
4 | RMD160 (xplot-0.90.8.tar.gz) = ac8877ad7fa1c80afa0281236b3a4992482109c2 | | 4 | RMD160 (xplot-0.90.8.tar.gz) = ac8877ad7fa1c80afa0281236b3a4992482109c2 |
5 | Size (xplot-0.90.8.tar.gz) = 243259 bytes | | 5 | Size (xplot-0.90.8.tar.gz) = 243259 bytes |
6 | SHA1 (patch-aa) = 48a475a550a2ea9d2bc50f2782d598830802817e | | 6 | SHA1 (patch-aa) = 48a475a550a2ea9d2bc50f2782d598830802817e |
7 | SHA1 (patch-ab) = f7eaac7296a830584b2cf02324086101579cc3d5 | | | |
8 | SHA1 (patch-ad) = fd19823030badf91734fde92b45fcaecc06cf0f8 | | 7 | SHA1 (patch-ad) = fd19823030badf91734fde92b45fcaecc06cf0f8 |
| | | 8 | SHA1 (patch-tcpdump2xplot.pl) = 9e50ee6591d4fe68ae8839025aa8fd5d22d29503 |
$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);