On 10/15/19 5:00 AM, Craig Small wrote: > > > On Tue, 15 Oct. 2019, 1:04 pm Thomas Goirand, <z...@debian.org > <mailto:z...@debian.org>> wrote: > > Please re-read the excellent contribution from Neil Williams > in this thread, and explain again why we have a special case... :) > > I just did re-read it; especially about it's RC bugs not a total removal > RM so these packages will sit in unstable and not move into testing. > > That works for me.
Hi Craing, I'm not sure if that helps, but here's a patch... :) Thomas
diff -Nru net-snmp-5.7.3+dfsg/debian/changelog net-snmp-5.7.3+dfsg/debian/changelog --- net-snmp-5.7.3+dfsg/debian/changelog 2019-01-05 06:16:10.000000000 +0100 +++ net-snmp-5.7.3+dfsg/debian/changelog 2019-10-15 04:25:31.000000000 +0200 @@ -1,3 +1,9 @@ +net-snmp (5.7.3+dfsg-5.1) UNRELEASED; urgency=medium + + * Add Python 3 support. + + -- Thomas Goirand <z...@debian.org> Tue, 15 Oct 2019 04:25:31 +0200 + net-snmp (5.7.3+dfsg-5) unstable; urgency=medium * Use debhelper macros for shlibs Closes: #912685 diff -Nru net-snmp-5.7.3+dfsg/debian/control net-snmp-5.7.3+dfsg/debian/control --- net-snmp-5.7.3+dfsg/debian/control 2019-01-05 06:16:10.000000000 +0100 +++ net-snmp-5.7.3+dfsg/debian/control 2019-10-15 04:25:31.000000000 +0200 @@ -8,6 +8,7 @@ Build-Depends: debhelper (>= 11), libtool, libwrap0-dev, libssl-dev, perl (>=5.8), libperl-dev, python-all (>= 2.6.6-3~), python-setuptools (>=0.6b3), python2.7-dev, + python3-all-dev, python3-setuptools, autoconf, automake, debianutils (>=1.13.1), dh-python, bash (>=2.05), findutils (>=4.1.20), procps, @@ -160,6 +161,18 @@ The Net-SNMP Python support files provide the Python functions for integration of SNMP into applications written in Python. +Package: python3-netsnmp +Section: python +Architecture: any +Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends} +Description: SNMP (Simple Network Management Protocol) Python 3 support + The Simple Network Management Protocol (SNMP) provides a framework + for the exchange of management information between agents (servers) + and clients. + . + The Net-SNMP Python support files provide the Python functions for + integration of SNMP into applications written in Python 3. + Package: tkmib Architecture: all Depends: libsnmp-perl (>=${source:Version}), perl-tk, ${misc:Depends} diff -Nru net-snmp-5.7.3+dfsg/debian/patches/fix-space-vs-tabs.patch net-snmp-5.7.3+dfsg/debian/patches/fix-space-vs-tabs.patch --- net-snmp-5.7.3+dfsg/debian/patches/fix-space-vs-tabs.patch 1970-01-01 01:00:00.000000000 +0100 +++ net-snmp-5.7.3+dfsg/debian/patches/fix-space-vs-tabs.patch 2019-10-15 04:25:31.000000000 +0200 @@ -0,0 +1,16 @@ +Description: Fix space vs tabs +Author: Thomas Goirand <z...@debian.org> +Forwarded: no +Last-Update: 2019-10-15 + +--- net-snmp-5.7.3+dfsg.orig/python/setup.py ++++ net-snmp-5.7.3+dfsg/python/setup.py +@@ -10,7 +10,7 @@ args = sys.argv[:] + for arg in args: + if arg.find('--basedir=') == 0: + basedir = arg.split('=')[1] +- sys.argv.remove(arg) ++ sys.argv.remove(arg) + intree=1 + + if intree: diff -Nru net-snmp-5.7.3+dfsg/debian/patches/py3-compat.patch net-snmp-5.7.3+dfsg/debian/patches/py3-compat.patch --- net-snmp-5.7.3+dfsg/debian/patches/py3-compat.patch 1970-01-01 01:00:00.000000000 +0100 +++ net-snmp-5.7.3+dfsg/debian/patches/py3-compat.patch 2019-10-15 04:22:51.000000000 +0200 @@ -0,0 +1,419 @@ +Description: Py3 compat +Author: Thomas Goirand <z...@debian.org> +Forwarded: no +Last-Update: 2019-10-15 + +--- net-snmp-5.7.3+dfsg.orig/python/netsnmp/client.py ++++ net-snmp-5.7.3+dfsg/python/netsnmp/client.py +@@ -2,7 +2,7 @@ import client_intf + import string + import re + import types +-from sys import stderr ++import sys + + # control verbosity of error output + verbose = 1 +@@ -37,10 +37,10 @@ def _parse_session_args(kargs): + } + keys = kargs.keys() + for key in keys: +- if sessArgs.has_key(key): ++ if key in sessArgs: + sessArgs[key] = kargs[key] + else: +- print >>stderr, "ERROR: unknown key", key ++ print("ERROR: unknown key", key, file=sys.stderr) + return sessArgs + + def STR(obj): +--- net-snmp-5.7.3+dfsg.orig/python/netsnmp/tests/test.py ++++ net-snmp-5.7.3+dfsg/python/netsnmp/tests/test.py +@@ -8,7 +8,7 @@ import time + + class BasicTests(unittest.TestCase): + def testFuncs(self): +- print "" ++ print("") + var = netsnmp.Varbind('sysDescr.0') + var = netsnmp.Varbind('sysDescr','0') + var = netsnmp.Varbind( +@@ -19,67 +19,67 @@ class BasicTests(unittest.TestCase): + + var = netsnmp.Varbind('.1.3.6.1.2.1.1.1','0') + +- print "---v1 GET tests -------------------------------------\n" ++ print("---v1 GET tests -------------------------------------\n") + res = netsnmp.snmpget(var, + Version = 1, + DestHost='localhost', + Community='public') + +- print "v1 snmpget result: ", res, "\n" ++ print("v1 snmpget result: ", res, "\n") + +- print "v1 get var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print("v1 get var: ", var.tag, var.iid, "=", var.val, '(',var.type,')') + +- print "---v1 GETNEXT tests-------------------------------------\n" ++ print("---v1 GETNEXT tests-------------------------------------\n") + res = netsnmp.snmpgetnext(var, + Version = 1, + DestHost='localhost', + Community='public') + +- print "v1 snmpgetnext result: ", res, "\n" ++ print("v1 snmpgetnext result: ", res, "\n") + +- print "v1 getnext var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print("v1 getnext var: ", var.tag, var.iid, "=", var.val, '(',var.type,')') + +- print "---v1 SET tests-------------------------------------\n" ++ print("---v1 SET tests-------------------------------------\n") + var = netsnmp.Varbind('sysLocation','0', 'my new location') + res = netsnmp.snmpset(var, + Version = 1, + DestHost='localhost', + Community='public') + +- print "v1 snmpset result: ", res, "\n" ++ print9"v1 snmpset result: ", res, "\n") + +- print "v1 set var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print("v1 set var: ", var.tag, var.iid, "=", var.val, '(',var.type,')') + +- print "---v1 walk tests-------------------------------------\n" ++ print("---v1 walk tests-------------------------------------\n") + vars = netsnmp.VarList(netsnmp.Varbind('system')) + +- print "v1 varlist walk in: " ++ print("v1 varlist walk in: ") + for var in vars: +- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(" ",var.tag, var.iid, "=", var.val, '(',var.type,')') + + res = netsnmp.snmpwalk(vars, + Version = 1, + DestHost='localhost', + Community='public') +- print "v1 snmpwalk result: ", res, "\n" ++ print("v1 snmpwalk result: ", res, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') + + +- print "---v1 walk 2-------------------------------------\n" ++ print("---v1 walk 2-------------------------------------\n") + +- print "v1 varbind walk in: " ++ print("v1 varbind walk in: ") + var = netsnmp.Varbind('system') + res = netsnmp.snmpwalk(var, + Version = 1, + DestHost='localhost', + Community='public') +- print "v1 snmpwalk result (should be = orig): ", res, "\n" ++ print("v1 snmpwalk result (should be = orig): ", res, "\n") + +- print var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') + +- print "---v1 multi-varbind test-------------------------------------\n" ++ print("---v1 multi-varbind test-------------------------------------\n") + sess = netsnmp.Session(Version=1, + DestHost='localhost', + Community='public') +@@ -88,16 +88,16 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysContact', 0), + netsnmp.Varbind('sysLocation', 0)) + vals = sess.get(vars) +- print "v1 sess.get result: ", vals, "\n" ++ print("v1 sess.get result: ", vals, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') + + vals = sess.getnext(vars) +- print "v1 sess.getnext result: ", vals, "\n" ++ print("v1 sess.getnext result: ", vals, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') + + vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), + netsnmp.Varbind('sysORLastChange'), +@@ -106,28 +106,28 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysORUpTime')) + + vals = sess.getbulk(2, 8, vars) +- print "v1 sess.getbulk result: ", vals, "\n" ++ print("v1 sess.getbulk result: ", vals, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') + +- print "---v1 set2-------------------------------------\n" ++ print("---v1 set2-------------------------------------\n") + + vars = netsnmp.VarList( + netsnmp.Varbind('sysLocation', '0', 'my newer location')) + res = sess.set(vars) +- print "v1 sess.set result: ", res, "\n" ++ print("v1 sess.set result: ", res, "\n") + +- print "---v1 walk3-------------------------------------\n" ++ print("---v1 walk3-------------------------------------\n") + vars = netsnmp.VarList(netsnmp.Varbind('system')) + + vals = sess.walk(vars) +- print "v1 sess.walk result: ", vals, "\n" ++ print("v1 sess.walk result: ", vals, "\n") + + for var in vars: +- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(" ",var.tag, var.iid, "=", var.val, '(',var.type,')') + +- print "---v2c get-------------------------------------\n" ++ print("---v2c get-------------------------------------\n") + + sess = netsnmp.Session(Version=2, + DestHost='localhost', +@@ -140,22 +140,22 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysContact', 0), + netsnmp.Varbind('sysLocation', 0)) + vals = sess.get(vars) +- print "v2 sess.get result: ", vals, "\n" ++ print("v2 sess.get result: ", vals, "\n") + +- print "---v2c getnext-------------------------------------\n" ++ print("---v2c getnext-------------------------------------\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') ++ print("\n") + + vals = sess.getnext(vars) +- print "v2 sess.getnext result: ", vals, "\n" ++ print("v2 sess.getnext result: ", vals, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') ++ print("\n") + +- print "---v2c getbulk-------------------------------------\n" ++ print("---v2c getbulk-------------------------------------\n") + + vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), + netsnmp.Varbind('sysORLastChange'), +@@ -164,30 +164,30 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysORUpTime')) + + vals = sess.getbulk(2, 8, vars) +- print "v2 sess.getbulk result: ", vals, "\n" ++ print("v2 sess.getbulk result: ", vals, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') ++ print("\n") + +- print "---v2c set-------------------------------------\n" ++ print("---v2c set-------------------------------------\n") + + vars = netsnmp.VarList( + netsnmp.Varbind('sysLocation','0','my even newer location')) + + res = sess.set(vars) +- print "v2 sess.set result: ", res, "\n" ++ print("v2 sess.set result: ", res, "\n") + +- print "---v2c walk-------------------------------------\n" ++ print("---v2c walk-------------------------------------\n") + vars = netsnmp.VarList(netsnmp.Varbind('system')) + + vals = sess.walk(vars) +- print "v2 sess.walk result: ", vals, "\n" ++ print("v2 sess.walk result: ", vals, "\n") + + for var in vars: +- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(" ",var.tag, var.iid, "=", var.val, '(',var.type,')') + +- print "---v3 setup-------------------------------------\n" ++ print("---v3 setup-------------------------------------\n") + sess = netsnmp.Session(Version=3, + DestHost='localhost', + SecLevel='authPriv', +@@ -200,22 +200,22 @@ class BasicTests(unittest.TestCase): + vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), + netsnmp.Varbind('sysContact', 0), + netsnmp.Varbind('sysLocation', 0)) +- print "---v3 get-------------------------------------\n" ++ print("---v3 get-------------------------------------\n") + vals = sess.get(vars) +- print "v3 sess.get result: ", vals, "\n" ++ print("v3 sess.get result: ", vals, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') ++ print("\n") + +- print "---v3 getnext-------------------------------------\n" ++ print("---v3 getnext-------------------------------------\n") + + vals = sess.getnext(vars) +- print "v3 sess.getnext result: ", vals, "\n" ++ print("v3 sess.getnext result: ", vals, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') ++ print("\n") + + vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), + netsnmp.Varbind('sysORLastChange'), +@@ -224,37 +224,37 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysORUpTime')) + + vals = sess.getbulk(2, 8, vars) +- print "v3 sess.getbulk result: ", vals, "\n" ++ print("v3 sess.getbulk result: ", vals, "\n") + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') ++ print("\n") + +- print "---v3 set-------------------------------------\n" ++ print("---v3 set-------------------------------------\n") + + vars = netsnmp.VarList( + netsnmp.Varbind('sysLocation','0', 'my final destination')) + res = sess.set(vars) +- print "v3 sess.set result: ", res, "\n" ++ print("v3 sess.set result: ", res, "\n") + +- print "---v3 walk-------------------------------------\n" ++ print("---v3 walk-------------------------------------\n") + vars = netsnmp.VarList(netsnmp.Varbind('system')) + + vals = sess.walk(vars) +- print "v3 sess.walk result: ", vals, "\n" ++ print("v3 sess.walk result: ", vals, "\n") + + for var in vars: +- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print(" ",var.tag, var.iid, "=", var.val, '(',var.type,')') + + + class SetTests(unittest.TestCase): + def testFuncs(self): +- print "\n-------------- SET Test Start ----------------------------\n" ++ print("\n-------------- SET Test Start ----------------------------\n") + + var = netsnmp.Varbind('sysUpTime','0') + res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', + Community='public') +- print "uptime = ", res[0] ++ print("uptime = ", res[0]) + + + var = netsnmp.Varbind('versionRestartAgent','0', 1) +@@ -264,19 +264,19 @@ class SetTests(unittest.TestCase): + var = netsnmp.Varbind('sysUpTime','0') + res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', + Community='public') +- print "uptime = ", res[0] ++ print("uptime = ", res[0]) + + var = netsnmp.Varbind('nsCacheEntry') + res = netsnmp.snmpgetnext(var, Version = 1, DestHost='localhost', + Community='public') +- print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print("var = ", var.tag, var.iid, "=", var.val, '(',var.type,')') + + var.val = 65 + res = netsnmp.snmpset(var, Version = 1, DestHost='localhost', + Community='public') + res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', + Community='public') +- print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')' ++ print("var = ", var.tag, var.iid, "=", var.val, '(',var.type,')') + + sess = netsnmp.Session(Version = 1, DestHost='localhost', + Community='public') +@@ -286,7 +286,7 @@ class SetTests(unittest.TestCase): + netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 4)) + res = sess.set(vars) + +- print "res = ", res ++ print("res = ", res) + + vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), + netsnmp.Varbind('snmpTargetAddrTAddress'), +@@ -295,14 +295,14 @@ class SetTests(unittest.TestCase): + res = sess.getnext(vars) + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') ++ print("\n") + + vars = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 6)) + + res = sess.set(vars) + +- print "res = ", res ++ print("res = ", res) + + vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), + netsnmp.Varbind('snmpTargetAddrTAddress'), +@@ -311,10 +311,10 @@ class SetTests(unittest.TestCase): + res = sess.getnext(vars) + + for var in vars: +- print var.tag, var.iid, "=", var.val, '(',var.type,')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(',var.type,')') ++ print("\n") + +- print "\n-------------- SET Test End ----------------------------\n" ++ print("\n-------------- SET Test End ----------------------------\n") + + + if __name__=='__main__': +--- net-snmp-5.7.3+dfsg.orig/python/setup.py ++++ net-snmp-5.7.3+dfsg/python/setup.py +@@ -2,15 +2,14 @@ from distutils.core import setup, Extens + from setuptools import setup, Extension, find_packages + import os + import re +-import string + import sys + + intree=0 + + args = sys.argv[:] + for arg in args: +- if string.find(arg,'--basedir=') == 0: +- basedir = string.split(arg,'=')[1] ++ if arg.find('--basedir=') == 0: ++ basedir = arg.split('=')[1] + sys.argv.remove(arg) + intree=1 + diff -Nru net-snmp-5.7.3+dfsg/debian/patches/series net-snmp-5.7.3+dfsg/debian/patches/series --- net-snmp-5.7.3+dfsg/debian/patches/series 2019-01-05 06:16:10.000000000 +0100 +++ net-snmp-5.7.3+dfsg/debian/patches/series 2019-10-15 04:25:31.000000000 +0200 @@ -38,3 +38,5 @@ snmpwalk_args_in_snmpcheck CVE-2018-18065.patch snmptrapd_mysql_init +py3-compat.patch +fix-space-vs-tabs.patch diff -Nru net-snmp-5.7.3+dfsg/debian/python3-netsnmp.install net-snmp-5.7.3+dfsg/debian/python3-netsnmp.install --- net-snmp-5.7.3+dfsg/debian/python3-netsnmp.install 1970-01-01 01:00:00.000000000 +0100 +++ net-snmp-5.7.3+dfsg/debian/python3-netsnmp.install 2019-10-15 04:25:28.000000000 +0200 @@ -0,0 +1 @@ +debian/tmp/usr/lib/python3* diff -Nru net-snmp-5.7.3+dfsg/debian/python-netsnmp.install net-snmp-5.7.3+dfsg/debian/python-netsnmp.install --- net-snmp-5.7.3+dfsg/debian/python-netsnmp.install 2019-01-05 06:16:10.000000000 +0100 +++ net-snmp-5.7.3+dfsg/debian/python-netsnmp.install 2019-10-15 04:25:08.000000000 +0200 @@ -1 +1 @@ -debian/tmp/usr/lib/python* +debian/tmp/usr/lib/python2* diff -Nru net-snmp-5.7.3+dfsg/debian/rules net-snmp-5.7.3+dfsg/debian/rules --- net-snmp-5.7.3+dfsg/debian/rules 2019-01-05 06:16:10.000000000 +0100 +++ net-snmp-5.7.3+dfsg/debian/rules 2019-10-15 04:24:48.000000000 +0200 @@ -33,7 +33,7 @@ endif %: - dh $@ --with python2 + dh $@ --with python2,python3 override_dh_auto_configure: dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man \ @@ -59,12 +59,16 @@ override_dh_auto_build: dh_auto_build cd python; python setup.py build --basedir=$(CURDIR) + cd python; python3 setup.py build --basedir=$(CURDIR) override_dh_auto_install: dh_auto_install cd python; python setup.py install --root=$(CURDIR)/debian/tmp \ --install-layout=deb --basedir=$(CURDIR) ; \ find $(CURDIR) -name *.pyc -delete + cd python; python3 setup.py install --root=$(CURDIR)/debian/tmp \ + --install-layout=deb --basedir=$(CURDIR) ; \ + find $(CURDIR) -name *.pyc -delete override_dh_clean: dh_clean