py-psutil: updated to 5.6.5
5.6.5 **Bug fixes** - remove pyproject.toml as it was causing installation issues. 5.6.4 **Enhancements** - [Linux] added Process.cpu_times().iowait counter, which is the time spent waiting for blocking I/O to complete. - add PEP 517/8 build backend and requirements specification for better pip integration. **Bug fixes** - [Windows] Process' cmdline(), environ() or cwd() may occasionally fail with ERROR_PARTIAL_COPY which now gets translated to AccessDenied. - [Linux] cpu_affinity() segfaults on CentOS 5 / manylinux. cpu_affinity() support for CentOS 5 was removed. - [AIX] compilation error on AIX 7.2 due to 32 vs 64 bit differences. - 'type' and 'family' fields returned by net_connections() are not always turned into enums. - [NetBSD] process cmdline() erroneously raise ZombieProcess error if cmdline has non encodable chars. - usage percent may be rounded to 0 on Python 2. - [Windows] getloadavg() math for calculating 5 and 15 mins values is incorrect. - [Linux] use CC compiler env var if defined. - [Windows] `NtWow64*` syscalls fail to raise the proper error code - [OSX] calling close() (in C) on possible negative integers. - [SunOS] compilation fails on SunOS 5.10.
This commit is contained in:
parent
2c30389672
commit
1bb2f5c40b
6 changed files with 25 additions and 100 deletions
|
@ -1,8 +1,7 @@
|
|||
# $NetBSD: Makefile,v 1.33 2019/10/11 20:01:50 kamil Exp $
|
||||
# $NetBSD: Makefile,v 1.34 2019/11/06 15:48:23 adam Exp $
|
||||
|
||||
DISTNAME= psutil-5.6.3
|
||||
DISTNAME= psutil-5.6.5
|
||||
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
|
||||
PKGREVISION= 2
|
||||
CATEGORIES= sysutils python
|
||||
MASTER_SITES= ${MASTER_SITE_PYPI:=p/psutil/}
|
||||
|
||||
|
@ -18,8 +17,6 @@ TEST_DEPENDS+= ${PYPKGPREFIX}-ipaddress-[0-9]*:../../net/py-ipaddress
|
|||
TEST_DEPENDS+= ${PYPKGPREFIX}-mock-[0-9]*:../../devel/py-mock
|
||||
.endif
|
||||
|
||||
REPLACE_PYTHON= psutil/*py
|
||||
|
||||
.include "../../mk/bsd.prefs.mk"
|
||||
|
||||
# facilitate PLIST processing
|
||||
|
@ -31,6 +28,8 @@ PLIST_SUBST+= SYSTEM=bsd
|
|||
PLIST_SUBST+= SYSTEM=${OPSYS:tl}
|
||||
.endif
|
||||
|
||||
.include "../../lang/python/application.mk"
|
||||
do-test:
|
||||
cd ${WRKSRC} && ${PYTHONBIN} psutil/tests/__main__.py
|
||||
|
||||
.include "../../lang/python/egg.mk"
|
||||
.include "../../mk/bsd.pkg.mk"
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
$NetBSD: distinfo,v 1.33 2019/10/11 20:01:50 kamil Exp $
|
||||
$NetBSD: distinfo,v 1.34 2019/11/06 15:48:23 adam Exp $
|
||||
|
||||
SHA1 (psutil-5.6.3.tar.gz) = dc596577226eba6f5382a3ed9816d6d340837068
|
||||
RMD160 (psutil-5.6.3.tar.gz) = bf7bdc047d8ca5e912602152bb3bd890869789b2
|
||||
SHA512 (psutil-5.6.3.tar.gz) = 62cf120c9391705bd393d6554afa32d672470b61ebb3c0e7458bad26134b784175ba64d3eff119ace6def2aebc97df73cd0c9d213776176ce39c3d47da3f3d9c
|
||||
Size (psutil-5.6.3.tar.gz) = 435374 bytes
|
||||
SHA1 (patch-psutil___psbsd.py) = 204349da5b07d817e546184757b058fa4dff5d3e
|
||||
SHA1 (patch-psutil___psutil__bsd.c) = cb98d2c4a734e4ccaa82d9d741167540f5708afc
|
||||
SHA1 (patch-psutil_arch_netbsd_specific.c) = b44e3aca5a221cd38482a16b013edb170818905a
|
||||
SHA1 (patch-psutil_arch_netbsd_specific.h) = 4d6b3c96eefeec4908e1006b96ab175d64714dd2
|
||||
SHA1 (psutil-5.6.5.tar.gz) = d44d010c03d4adf9db04fe0e44a77e7ece41934e
|
||||
RMD160 (psutil-5.6.5.tar.gz) = f09719d6a824153a3460afe449a4bdca9d0e21ef
|
||||
SHA512 (psutil-5.6.5.tar.gz) = 037b1501b686b7101be4180c8698b09d20d4260962a88f0c437ff558d91c405f56eae186c9d55c1893c612c4534093ab26e6943f0ed56db69e343c5c0317be1b
|
||||
Size (psutil-5.6.5.tar.gz) = 447489 bytes
|
||||
SHA1 (patch-psutil___psbsd.py) = da61606aee2366181935c10873d0627d0cb80f3f
|
||||
SHA1 (patch-psutil___psutil__bsd.c) = a94b2c5a11338f3fffcbdde4339391c9519cf6d6
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
$NetBSD: patch-psutil___psbsd.py,v 1.4 2019/10/11 20:01:51 kamil Exp $
|
||||
|
||||
Use proc_cwd on NetBSD >= 8.99.42.
|
||||
$NetBSD: patch-psutil___psbsd.py,v 1.5 2019/11/06 15:48:23 adam Exp $
|
||||
|
||||
Stop using SDEAD as it is no longer available.
|
||||
|
||||
--- psutil/_psbsd.py.orig 2019-04-11 21:10:12.000000000 +0000
|
||||
--- psutil/_psbsd.py.orig 2019-06-28 13:13:13.000000000 +0000
|
||||
+++ psutil/_psbsd.py
|
||||
@@ -57,7 +57,7 @@ elif OPENBSD or NETBSD:
|
||||
@@ -58,7 +58,7 @@ elif OPENBSD or NETBSD:
|
||||
# equivalent. Also it appears there's no equivalent of
|
||||
# psutil.STATUS_DEAD. SDEAD really means STATUS_ZOMBIE.
|
||||
# cext.SZOMB: _common.STATUS_ZOMBIE,
|
||||
|
@ -15,20 +13,3 @@ Stop using SDEAD as it is no longer available.
|
|||
cext.SZOMB: _common.STATUS_ZOMBIE,
|
||||
# From http://www.eecs.harvard.edu/~margo/cs161/videos/proc.h.txt
|
||||
# OpenBSD has SRUN and SONPROC: SRUN indicates that a process
|
||||
@@ -105,6 +105,7 @@ HAS_PER_CPU_TIMES = hasattr(cext, "per_c
|
||||
HAS_PROC_NUM_THREADS = hasattr(cext, "proc_num_threads")
|
||||
HAS_PROC_OPEN_FILES = hasattr(cext, 'proc_open_files')
|
||||
HAS_PROC_NUM_FDS = hasattr(cext, 'proc_num_fds')
|
||||
+HAS_PROC_CWD = hasattr(cext, 'proc_cwd')
|
||||
|
||||
kinfo_proc_map = dict(
|
||||
ppid=0,
|
||||
@@ -845,6 +846,8 @@ class Process(object):
|
||||
if OPENBSD and self.pid == 0:
|
||||
return None # ...else it would raise EINVAL
|
||||
elif NETBSD:
|
||||
+ if HAS_PROC_CWD:
|
||||
+ return cext.proc_cwd(self.pid) or None
|
||||
with wrap_exceptions_procfs(self):
|
||||
return os.readlink("/proc/%s/cwd" % self.pid)
|
||||
elif HAS_PROC_OPEN_FILES:
|
||||
|
|
|
@ -1,25 +1,16 @@
|
|||
$NetBSD: patch-psutil___psutil__bsd.c,v 1.11 2019/06/29 18:00:49 wiz Exp $
|
||||
$NetBSD: patch-psutil___psutil__bsd.c,v 1.12 2019/11/06 15:48:23 adam Exp $
|
||||
|
||||
Define proc_cwd on NetBSD >= 8.99.42.
|
||||
Optionally use SDEAD.
|
||||
|
||||
--- psutil/_psutil_bsd.c.orig 2019-06-11 04:04:44.000000000 +0000
|
||||
--- psutil/_psutil_bsd.c.orig 2019-10-21 06:43:32.000000000 +0000
|
||||
+++ psutil/_psutil_bsd.c
|
||||
@@ -921,6 +921,8 @@ PsutilMethods[] = {
|
||||
#if defined(PSUTIL_FREEBSD) || defined(PSUTIL_OPENBSD)
|
||||
{"proc_connections", psutil_proc_connections, METH_VARARGS,
|
||||
"Return connections opened by process"},
|
||||
+#endif
|
||||
+#if defined(PSUTIL_FREEBSD) || defined(PSUTIL_OPENBSD) || (defined(PSUTIL_NETBSD) && __NetBSD_Version__ >= 899004200)
|
||||
{"proc_cwd", psutil_proc_cwd, METH_VARARGS,
|
||||
"Return process current working directory."},
|
||||
#endif
|
||||
@@ -1071,7 +1073,9 @@ void init_psutil_bsd(void)
|
||||
PyModule_AddIntConstant(module, "SSLEEP", LSSLEEP);
|
||||
PyModule_AddIntConstant(module, "SSTOP", LSSTOP);
|
||||
PyModule_AddIntConstant(module, "SZOMB", LSZOMB);
|
||||
@@ -1049,7 +1051,9 @@ static PyMethodDef mod_methods[] = {
|
||||
if (PyModule_AddIntConstant(mod, "SSLEEP", LSSLEEP)) INITERR;
|
||||
if (PyModule_AddIntConstant(mod, "SSTOP", LSSTOP)) INITERR;
|
||||
if (PyModule_AddIntConstant(mod, "SZOMB", LSZOMB)) INITERR;
|
||||
+#if defined(LSDEAD)
|
||||
PyModule_AddIntConstant(module, "SDEAD", LSDEAD);
|
||||
if (PyModule_AddIntConstant(mod, "SDEAD", LSDEAD)) INITERR;
|
||||
+#endif
|
||||
PyModule_AddIntConstant(module, "SONPROC", LSONPROC);
|
||||
if (PyModule_AddIntConstant(mod, "SONPROC", LSONPROC)) INITERR;
|
||||
// unique to NetBSD
|
||||
PyModule_AddIntConstant(module, "SSUSPENDED", LSSUSPENDED);
|
||||
if (PyModule_AddIntConstant(mod, "SSUSPENDED", LSSUSPENDED)) INITERR;
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
$NetBSD: patch-psutil_arch_netbsd_specific.c,v 1.4 2019/06/11 22:55:04 leot Exp $
|
||||
|
||||
Use proc_cwd on NetBSD >= 8.99.42.
|
||||
|
||||
--- psutil/arch/netbsd/specific.c.orig 2019-03-02 20:46:28.000000000 +0000
|
||||
+++ psutil/arch/netbsd/specific.c
|
||||
@@ -112,6 +112,24 @@ kinfo_getfile(pid_t pid, int* cnt) {
|
||||
return kf;
|
||||
}
|
||||
|
||||
+#ifdef KERN_PROC_CWD /* Introduced in NetBSD-8.99.42 */
|
||||
+PyObject *
|
||||
+psutil_proc_cwd(PyObject *self, PyObject *args) {
|
||||
+ long pid;
|
||||
+ char path[MAXPATHLEN];
|
||||
+ size_t pathlen = sizeof path;
|
||||
+
|
||||
+ if (! PyArg_ParseTuple(args, "l", &pid))
|
||||
+ return NULL;
|
||||
+
|
||||
+ int name[] = { CTL_KERN, KERN_PROC_ARGS, pid, KERN_PROC_CWD};
|
||||
+ if (sysctl(name, 4, path, &pathlen, NULL, 0) != 0) {
|
||||
+ PyErr_SetFromErrno(PyExc_OSError);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ return PyUnicode_DecodeFSDefault(path);
|
||||
+}
|
||||
+#endif
|
||||
|
||||
// XXX: This is no longer used as per
|
||||
// https://github.com/giampaolo/psutil/pull/557#issuecomment-171912820
|
|
@ -1,13 +0,0 @@
|
|||
$NetBSD: patch-psutil_arch_netbsd_specific.h,v 1.1 2019/06/01 01:11:57 kamil Exp $
|
||||
|
||||
Use proc_cwd on NetBSD >= 8.99.42.
|
||||
|
||||
--- psutil/arch/netbsd/specific.h.orig 2019-03-02 20:46:28.000000000 +0000
|
||||
+++ psutil/arch/netbsd/specific.h
|
||||
@@ -26,3 +26,6 @@ PyObject* psutil_disk_io_counters(PyObje
|
||||
PyObject* psutil_proc_exe(PyObject* self, PyObject* args);
|
||||
PyObject* psutil_proc_num_threads(PyObject* self, PyObject* args);
|
||||
PyObject* psutil_cpu_stats(PyObject* self, PyObject* args);
|
||||
+#if (__NetBSD_Version__ - 0) >= 899004200
|
||||
+PyObject *psutil_proc_cwd(PyObject *self, PyObject *args);
|
||||
+#endif
|
Loading…
Reference in a new issue