svn commit: r520959 - in head/net-mgmt/arpwatch: . files

Craig Leres leres at FreeBSD.org
Thu Dec 26 22:47:18 UTC 2019


Author: leres
Date: Thu Dec 26 22:47:17 2019
New Revision: 520959
URL: https://svnweb.freebsd.org/changeset/ports/520959

Log:
  net-mgmt/arpwatch: Add python 2 compatibility to the massagevendor
  script. This allows use on pfsense <= 2.4.4.
  
  Approved by:	matthew (mentor, implicit)

Added:
  head/net-mgmt/arpwatch/files/patch-massagevendor.py.in   (contents, props changed)
Modified:
  head/net-mgmt/arpwatch/Makefile

Modified: head/net-mgmt/arpwatch/Makefile
==============================================================================
--- head/net-mgmt/arpwatch/Makefile	Thu Dec 26 21:59:06 2019	(r520958)
+++ head/net-mgmt/arpwatch/Makefile	Thu Dec 26 22:47:17 2019	(r520959)
@@ -3,7 +3,7 @@
 
 PORTNAME=	arpwatch
 PORTVERSION=	3.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net-mgmt
 MASTER_SITES=	https://ee.lbl.gov/downloads/arpwatch/ \
 		LOCAL/leres/arpwatch

Added: head/net-mgmt/arpwatch/files/patch-massagevendor.py.in
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net-mgmt/arpwatch/files/patch-massagevendor.py.in	Thu Dec 26 22:47:17 2019	(r520959)
@@ -0,0 +1,40 @@
+--- massagevendor.py.in.orig	2019-12-26 22:30:49 UTC
++++ massagevendor.py.in
+@@ -1,6 +1,6 @@
+ #!@PYTHON@
+ """massagevendor - convert IEEE oui.csv to ethercodes.dat format"""
+-# @(#) $Id: massagevendor.py.in 1505 2019-11-30 18:35:23Z leres $ (LBL)
++# @(#) $Id: massagevendor.py.in 1516 2019-12-26 22:28:17Z leres $ (LBL)
+ #
+ #  Copyright (c) 2000, 2004, 2009, 2010, 2013, 2015, 2016, 2019
+ #  The Regents of the University of California. All rights reserved.
+@@ -35,6 +35,8 @@
+ #  into ethercodes.dat format.
+ #
+ 
++from __future__ import print_function
++
+ import argparse
+ import csv
+ import os
+@@ -63,7 +65,10 @@ def process(f):
+             tup = [x[1:] if  x[0] == '0' else x for x in tup]
+         vendor = ':'.join(tup)
+ 
+-        company = row[2].encode('utf-8').decode('ascii', 'ignore')
++        company = row[2]
++        if sys.version_info[0] < 3:
++            company = unicode(company, 'utf-8')
++        company = company.encode('utf-8').decode('ascii', 'ignore')
+ 
+         lines.append('%s\t%s' % (vendor, company))
+ 
+@@ -88,7 +93,7 @@ def main(argv=None):
+ #        os.environ[pathstr] = '%s:%s' % (localsbin, os.environ[pathstr])
+ 
+     PROG = os.path.basename(argv[0])
+-    version = '$Revision: 1505 $'.strip('$').rstrip()
++    version = '$Revision: 1516 $'.strip('$').rstrip()
+ 
+     parser = argparse.ArgumentParser(
+         formatter_class=argparse.RawTextHelpFormatter)


More information about the svn-ports-head mailing list