pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

py-netsnmp-cffi: upgrade to version 0.1.3.



Module Name:	pkgsrc-wip
Committed By:	Havard Eidnes <he%NetBSD.org@localhost>
Pushed By:	he
Date:		Wed Sep 17 17:53:51 2025 +0200
Changeset:	35469633f127228cb1ce619642e0d778bef24c5f

Modified Files:
	py-netsnmp-cffi/Makefile
	py-netsnmp-cffi/PLIST
	py-netsnmp-cffi/distinfo
Removed Files:
	py-netsnmp-cffi/patches/patch-src_netsnmp_trapsession.py
	py-netsnmp-cffi/patches/patch-src_netsnmpy_netsnmp__ffi.py

Log Message:
py-netsnmp-cffi: upgrade to version 0.1.3.

Pkgsrc changes:
 * Version + checksum updates.
 * Drop patches now integrated upstream for portability
   to NetBSD's layout of e.g. sockaddr_in.

Upstream changes:
0.1.3:
Fixed:
 * Return raw community value bytestring rather than crashing trap
   handler if the incoming trap messages community cannot be decoded
   as ASCII (#9)

0.1.2:
Added:
 * Added tools to automatically build manylinux binary wheels.

Fixed:
 * Fixed pyproject.toml license attributes to conform with package build tools.
 * Make library import fail with helpful error message if Net-SNMP
   cannot be found or is older than supported.
 * Fixed typo in variable reference that would mask the real error
   when SNMP session opening failed.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=35469633f127228cb1ce619642e0d778bef24c5f

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 py-netsnmp-cffi/Makefile                           |  3 +-
 py-netsnmp-cffi/PLIST                              |  6 +--
 py-netsnmp-cffi/distinfo                           |  8 ++-
 .../patches/patch-src_netsnmp_trapsession.py       | 62 ----------------------
 .../patches/patch-src_netsnmpy_netsnmp__ffi.py     | 41 --------------
 5 files changed, 7 insertions(+), 113 deletions(-)

diffs:
diff --git a/py-netsnmp-cffi/Makefile b/py-netsnmp-cffi/Makefile
index 91bd8a629f..d0ae85ac0f 100644
--- a/py-netsnmp-cffi/Makefile
+++ b/py-netsnmp-cffi/Makefile
@@ -1,8 +1,7 @@
 # $NetBSD$
 
-DISTNAME=	netsnmp-cffi-0.1.1
+DISTNAME=	netsnmp-cffi-0.1.3
 PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
-PKGREVISION=	4
 CATEGORIES=	net
 MASTER_SITES=	${MASTER_SITE_GITHUB:=Uninett/}
 GITHUB_PROJECT=	netsnmp-cffi
diff --git a/py-netsnmp-cffi/PLIST b/py-netsnmp-cffi/PLIST
index ff3b1977b2..85ae7acd76 100644
--- a/py-netsnmp-cffi/PLIST
+++ b/py-netsnmp-cffi/PLIST
@@ -10,6 +10,9 @@ ${PYSITELIB}/netsnmpy/__init__.py
 ${PYSITELIB}/netsnmpy/__init__.pyc
 ${PYSITELIB}/netsnmpy/__init__.pyo
 ${PYSITELIB}/netsnmpy/_netsnmp.abi3.so
+${PYSITELIB}/netsnmpy/annotations.py
+${PYSITELIB}/netsnmpy/annotations.pyc
+${PYSITELIB}/netsnmpy/annotations.pyo
 ${PYSITELIB}/netsnmpy/constants.py
 ${PYSITELIB}/netsnmpy/constants.pyc
 ${PYSITELIB}/netsnmpy/constants.pyo
@@ -40,9 +43,6 @@ ${PYSITELIB}/netsnmpy/session.pyo
 ${PYSITELIB}/netsnmpy/trapsession.py
 ${PYSITELIB}/netsnmpy/trapsession.pyc
 ${PYSITELIB}/netsnmpy/trapsession.pyo
-${PYSITELIB}/netsnmpy/types.py
-${PYSITELIB}/netsnmpy/types.pyc
-${PYSITELIB}/netsnmpy/types.pyo
 ${PYSITELIB}/netsnmpy/version.py
 ${PYSITELIB}/netsnmpy/version.pyc
 ${PYSITELIB}/netsnmpy/version.pyo
diff --git a/py-netsnmp-cffi/distinfo b/py-netsnmp-cffi/distinfo
index 5acdbdfc75..ca4774736e 100644
--- a/py-netsnmp-cffi/distinfo
+++ b/py-netsnmp-cffi/distinfo
@@ -1,7 +1,5 @@
 $NetBSD$
 
-BLAKE2s (netsnmp-cffi-0.1.1.tar.gz) = 10d75260cfca2be08f73f7ff0e8726a3eec2b351a6a6c8f136d0a4ddea087d37
-SHA512 (netsnmp-cffi-0.1.1.tar.gz) = 1f0be1e2af13364f3b93c7dc26e2f78d57e9f9120185fe4b85251e4b0a7417117a83dd3626abd2874a6b1ce99cbd1d7e42198b1159bd7b715b51084a9e121311
-Size (netsnmp-cffi-0.1.1.tar.gz) = 38212 bytes
-SHA1 (patch-src_netsnmp_trapsession.py) = 7293de0f01b9c59b82d92c8d5ec11b060ecd6900
-SHA1 (patch-src_netsnmpy_netsnmp__ffi.py) = e0b0c9348325f7aad2f8086a7048f74b2408575e
+BLAKE2s (netsnmp-cffi-0.1.3.tar.gz) = 9b123cf8f560c36ee8a7a7bf7fd731b231f8294f7eecd19aa591b50d7125b35c
+SHA512 (netsnmp-cffi-0.1.3.tar.gz) = 487a285067f440af4057a56f265a7c32a38feaec972b2c83388743743f2f8aab5b40f54661813c9a9126e5e5e090537c2ac5667c5ed609ac8b82ea61d37e2e94
+Size (netsnmp-cffi-0.1.3.tar.gz) = 39269 bytes
diff --git a/py-netsnmp-cffi/patches/patch-src_netsnmp_trapsession.py b/py-netsnmp-cffi/patches/patch-src_netsnmp_trapsession.py
deleted file mode 100644
index d179d7d8d7..0000000000
--- a/py-netsnmp-cffi/patches/patch-src_netsnmp_trapsession.py
+++ /dev/null
@@ -1,62 +0,0 @@
-$NetBSD$
-
-Add patch to handle sockaddr layout on BSD*s.
-
---- src/netsnmpy/trapsession.py.orig	2025-04-25 09:15:29.422003201 +0000
-+++ src/netsnmpy/trapsession.py
-@@ -1,6 +1,7 @@
- """SNMP Trap session handling"""
- 
- import logging
-+import platform
- from ipaddress import ip_address
- from socket import AF_INET, AF_INET6, inet_ntop
- from typing import Optional, Protocol
-@@ -36,10 +37,18 @@ _lib = _netsnmp.lib
- _log = logging.getLogger(__name__)
- 
- # Local constants
-+SOCKADDR_OFFSET = 1 if "BSD" in platform.system() else 0
- IPADDR_SIZE = 4
- IP6ADDR_SIZE = 16
--IPADDR_OFFSET = 4
--IP6ADDR_OFFSET = 8
-+IPADDR_OFFSET = 0
-+IP6ADDR_OFFSET = _ffi.sizeof("uint32_t") # sin6_flowinfo
-+if "BSD" in platform.platform():
-+    SOCKADDR_TYPE = "bsd_sockaddr_in"
-+    SA_FAILY_TYPE = "uint8_t"
-+else:
-+    SOCKADDR_TYPE = "linux_sockaddr_in"
-+    SA_FAMILY_TYPE = "unsigned short"
-+SOCKADDR_DATA_OFFSET = _ffi.offsetof(SOCKADDR_TYPE, "sa_data")
- 
- OBJID_SNMP_TRAPS = OID(".1.3.6.1.6.3.1.1.5")
- OBJID_SNMP_TRAP_OID = OID(".1.3.6.1.6.3.1.1.4.1.0")
-@@ -248,18 +257,19 @@ class SNMPTrap:
-         if pdu.transport_data_length <= 1:
-             return
- 
--        # peek the first two bytes of the pdu's opaque transport data to determine
--        # socket address family (we are assuming the transport_data is a sockaddr_in
--        # or sockaddr_in6 structure and accessing it naughtily here)
--        family_p = _ffi.cast("unsigned short*", pdu.transport_data)
--        family = family_p[0]
-+        # peek the first part of the pdu's opaque transport data to determine socket
-+        # address family (we are assuming the transport_data is a sockaddr_in or
-+        # sockaddr_in6 structure and accessing it naughtily here. sockaddr
-+        # definitions vary between platforms, further complicating this).
-+        sockaddr = _ffi.cast(f"{SOCKADDR_TYPE}*", pdu.transport_data)
-+        family = sockaddr[0].sa_family
-         if family not in (AF_INET, AF_INET6):
-             return
- 
-         addr_size, offset = (
--            (IPADDR_SIZE, IPADDR_OFFSET)
-+            (IPADDR_SIZE, SOCKADDR_DATA_OFFSET + IPADDR_OFFSET)
-             if family == AF_INET
--            else (IP6ADDR_SIZE, IP6ADDR_OFFSET)
-+            else (IP6ADDR_SIZE, SOCKADDR_DATA_OFFSET + IP6ADDR_OFFSET)
-         )
- 
-         buffer = _ffi.cast("char*", pdu.transport_data)
diff --git a/py-netsnmp-cffi/patches/patch-src_netsnmpy_netsnmp__ffi.py b/py-netsnmp-cffi/patches/patch-src_netsnmpy_netsnmp__ffi.py
deleted file mode 100644
index 897351641f..0000000000
--- a/py-netsnmp-cffi/patches/patch-src_netsnmpy_netsnmp__ffi.py
+++ /dev/null
@@ -1,41 +0,0 @@
-$NetBSD$
-
-Use the new way of dealing with different-sized
-time_t types in FFI.
-
-Also handle the difference in sockaddr layout on Linux & BSDs.
-
---- src/netsnmpy/netsnmp_ffi.py.orig	2025-05-14 09:52:14.408968553 +0000
-+++ src/netsnmpy/netsnmp_ffi.py
-@@ -12,6 +12,17 @@ typedef struct _callback_data {
-     void          *reserved;
-     unsigned long  session_id;
- } _callback_data;
-+typedef struct linux_sockaddr_in {
-+     unsigned short sa_family;
-+     unsigned short sa_port;
-+     char           sa_data[14];
-+} linux_sockaddr_in;
-+typedef struct bsd_sockaddr_in {
-+     uint8_t  sa_len;
-+     uint8_t  sa_family;
-+     unsigned short sa_port;
-+     char     sa_data[14];
-+} bsd_sockaddr_in;
- """
- _CDEF = f"""
- /* Typedefs and structs we will be needing access to */
-@@ -20,9 +31,11 @@ typedef unsigned short u_short;
- typedef unsigned char u_char;
- typedef unsigned int u_int;
- typedef unsigned long oid;
-+typedef int... time_t;
-+typedef int... suseconds_t;
- typedef struct timeval {{
--    long tv_sec;
--    long tv_usec;
-+    time_t tv_sec;
-+    suseconds_t tv_usec;
- }};
- 
- 


Home | Main Index | Thread Index | Old Index