From owner-svn-ports-head@freebsd.org Tue Mar 21 08:38:29 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFED7D16E74; Tue, 21 Mar 2017 08:38:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A94A1952; Tue, 21 Mar 2017 08:38:29 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2L8cSNQ006299; Tue, 21 Mar 2017 08:38:28 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2L8cSxl006297; Tue, 21 Mar 2017 08:38:28 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201703210838.v2L8cSxl006297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 21 Mar 2017 08:38:28 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r436574 - in head/sysutils/py-psutil: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2017 08:38:29 -0000 Author: glebius (src committer) Date: Tue Mar 21 08:38:28 2017 New Revision: 436574 URL: https://svnweb.freebsd.org/changeset/ports/436574 Log: Make it compilable on FreeBSD 12 after struct inpcb and struct tcpcb were stopped being exported. Added: head/sysutils/py-psutil/files/ head/sysutils/py-psutil/files/patch-psutil__arch__bsd__freebsd_socks.c (contents, props changed) Modified: head/sysutils/py-psutil/Makefile Modified: head/sysutils/py-psutil/Makefile ============================================================================== --- head/sysutils/py-psutil/Makefile Tue Mar 21 08:27:28 2017 (r436573) +++ head/sysutils/py-psutil/Makefile Tue Mar 21 08:38:28 2017 (r436574) @@ -3,6 +3,7 @@ PORTNAME= psutil PORTVERSION= 5.2.0 +PORTREVISION= 1 CATEGORIES= sysutils python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} Added: head/sysutils/py-psutil/files/patch-psutil__arch__bsd__freebsd_socks.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/py-psutil/files/patch-psutil__arch__bsd__freebsd_socks.c Tue Mar 21 08:38:28 2017 (r436574) @@ -0,0 +1,86 @@ +--- psutil/arch/bsd/freebsd_socks.c.orig 2017-03-21 00:28:50.234080000 -0700 ++++ psutil/arch/bsd/freebsd_socks.c 2017-03-21 00:35:53.545508000 -0700 +@@ -112,10 +112,17 @@ + } + + ++#if __FreeBSD_version >= 1200026 ++static struct xtcpcb * ++psutil_search_tcplist(char *buf, struct kinfo_file *kif) { ++ struct xtcpcb *tp; ++ struct xinpcb *inp; ++#else + static struct tcpcb * + psutil_search_tcplist(char *buf, struct kinfo_file *kif) { + struct tcpcb *tp; + struct inpcb *inp; ++#endif + struct xinpgen *xig, *oxig; + struct xsocket *so; + +@@ -123,9 +130,15 @@ + for (xig = (struct xinpgen *)((char *)xig + xig->xig_len); + xig->xig_len > sizeof(struct xinpgen); + xig = (struct xinpgen *)((char *)xig + xig->xig_len)) { ++#if __FreeBSD_version >= 1200026 ++ tp = (struct xtcpcb *)xig; ++ inp = &tp->xt_inp; ++ so = &inp->xi_socket; ++#else + tp = &((struct xtcpcb *)xig)->xt_tp; + inp = &((struct xtcpcb *)xig)->xt_inp; + so = &((struct xtcpcb *)xig)->xt_socket; ++#endif + + if (so->so_type != kif->kf_sock_type || + so->xso_family != kif->kf_sock_domain || +@@ -208,7 +221,11 @@ + struct xinpgen *xig, *exig; + struct xinpcb *xip; + struct xtcpcb *xtp; ++#if __FreeBSD_version >= 1200026 ++ struct xinpcb *inp; ++#else + struct inpcb *inp; ++#endif + struct xsocket *so; + const char *varname = NULL; + size_t len, bufsize; +@@ -273,8 +290,13 @@ + goto error; + } + inp = &xtp->xt_inp; ++#if __FreeBSD_version >= 1200026 ++ so = &inp->xi_socket; ++ status = xtp->t_state; ++#else + so = &xtp->xt_socket; + status = xtp->xt_tp.t_state; ++#endif + break; + case IPPROTO_UDP: + xip = (struct xinpcb *)xig; +@@ -283,7 +305,11 @@ + "struct xinpcb size mismatch"); + goto error; + } ++#if __FreeBSD_version >= 1200026 ++ inp = xip; ++#else + inp = &xip->xi_inp; ++#endif + so = &xip->xi_socket; + status = PSUTIL_CONN_NONE; + break; +@@ -477,7 +503,11 @@ + struct kinfo_file *freep = NULL; + struct kinfo_file *kif; + char *tcplist = NULL; ++#if __FreeBSD_version >= 1200026 ++ struct xtcpcb *tcp; ++#else + struct tcpcb *tcp; ++#endif + + PyObject *py_retlist = PyList_New(0); + PyObject *py_tuple = NULL;