pkgsrc-Changes archive

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

CVS commit: pkgsrc/sysutils/py-psutil



Module Name:    pkgsrc
Committed By:   kamil
Date:           Sat Jun  1 01:11:57 UTC 2019

Modified Files:
        pkgsrc/sysutils/py-psutil: Makefile distinfo
        pkgsrc/sysutils/py-psutil/patches: patch-psutil___psutil__bsd.c
            patch-psutil_arch_netbsd_specific.c
Added Files:
        pkgsrc/sysutils/py-psutil/patches: patch-psutil___psbsd.py
            patch-psutil_arch_netbsd_specific.h

Log Message:
py-psutil: Use KERN_PROC_CWD on NetBSD >= 8.99.42


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 pkgsrc/sysutils/py-psutil/Makefile \
    pkgsrc/sysutils/py-psutil/distinfo
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/sysutils/py-psutil/patches/patch-psutil___psbsd.py
cvs rdiff -u -r1.8 -r1.9 \
    pkgsrc/sysutils/py-psutil/patches/patch-psutil___psutil__bsd.c
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c
cvs rdiff -u -r0 -r1.1 \
    pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.h

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

Modified files:

Index: pkgsrc/sysutils/py-psutil/Makefile
diff -u pkgsrc/sysutils/py-psutil/Makefile:1.28 pkgsrc/sysutils/py-psutil/Makefile:1.29
--- pkgsrc/sysutils/py-psutil/Makefile:1.28     Tue Apr 30 09:32:07 2019
+++ pkgsrc/sysutils/py-psutil/Makefile  Sat Jun  1 01:11:57 2019
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.28 2019/04/30 09:32:07 adam Exp $
+# $NetBSD: Makefile,v 1.29 2019/06/01 01:11:57 kamil Exp $
 
 DISTNAME=      psutil-5.6.2
+PKGREVISION=   1
 PKGNAME=       ${PYPKGPREFIX}-${DISTNAME}
 CATEGORIES=    sysutils python
 MASTER_SITES=  ${MASTER_SITE_PYPI:=p/psutil/}
Index: pkgsrc/sysutils/py-psutil/distinfo
diff -u pkgsrc/sysutils/py-psutil/distinfo:1.28 pkgsrc/sysutils/py-psutil/distinfo:1.29
--- pkgsrc/sysutils/py-psutil/distinfo:1.28     Tue Apr 30 09:32:07 2019
+++ pkgsrc/sysutils/py-psutil/distinfo  Sat Jun  1 01:11:57 2019
@@ -1,8 +1,10 @@
-$NetBSD: distinfo,v 1.28 2019/04/30 09:32:07 adam Exp $
+$NetBSD: distinfo,v 1.29 2019/06/01 01:11:57 kamil Exp $
 
 SHA1 (psutil-5.6.2.tar.gz) = c01d48a103196eb513b72d32fbc7cee1ed64a38c
 RMD160 (psutil-5.6.2.tar.gz) = 5450a028ad787d3e274a2c0e11c127bf5cd7e9da
 SHA512 (psutil-5.6.2.tar.gz) = ff41428b43c59ad948b8b4e6824943258abb30dc76cd042bdf7fe72d5aceb9bcbd2a2038a6a43d2b4c36eccae9007ef78779fe0cb5ee3caa68da9b1ba687b66d
 Size (psutil-5.6.2.tar.gz) = 432907 bytes
-SHA1 (patch-psutil___psutil__bsd.c) = 3d1166abdd74e3f3b4bec3098b03e7d05a67df04
-SHA1 (patch-psutil_arch_netbsd_specific.c) = bc38af6ba1c360a12fb3d7112026425ca0cf4a92
+SHA1 (patch-psutil___psbsd.py) = f8888b8f386a1928446c7d588a7a46f2674c69f6
+SHA1 (patch-psutil___psutil__bsd.c) = 5516c6c257b389c7e977074d2a6eeb3c23f565d1
+SHA1 (patch-psutil_arch_netbsd_specific.c) = 3809727dcf605af44ec15f0ef5924acd65be5ea9
+SHA1 (patch-psutil_arch_netbsd_specific.h) = 4d6b3c96eefeec4908e1006b96ab175d64714dd2

Index: pkgsrc/sysutils/py-psutil/patches/patch-psutil___psutil__bsd.c
diff -u pkgsrc/sysutils/py-psutil/patches/patch-psutil___psutil__bsd.c:1.8 pkgsrc/sysutils/py-psutil/patches/patch-psutil___psutil__bsd.c:1.9
--- pkgsrc/sysutils/py-psutil/patches/patch-psutil___psutil__bsd.c:1.8  Thu Jun 22 22:01:47 2017
+++ pkgsrc/sysutils/py-psutil/patches/patch-psutil___psutil__bsd.c      Sat Jun  1 01:11:57 2019
@@ -1,9 +1,11 @@
-$NetBSD: patch-psutil___psutil__bsd.c,v 1.8 2017/06/22 22:01:47 kamil Exp $
+$NetBSD: patch-psutil___psutil__bsd.c,v 1.9 2019/06/01 01:11:57 kamil Exp $
 
 Don't include <sys/user.h> on every BSD.
 It's absent on NetBSD and unused on OpenBSD.
 
---- psutil/_psutil_bsd.c.orig  2017-03-26 08:09:27.000000000 +0000
+Define proc_cwd on NetBSD >= 8.99.42.
+
+--- psutil/_psutil_bsd.c.orig  2019-04-11 21:10:12.000000000 +0000
 +++ psutil/_psutil_bsd.c
 @@ -30,7 +30,9 @@
  #include <sys/types.h>
@@ -15,3 +17,12 @@ It's absent on NetBSD and unused on Open
  #include <sys/proc.h>
  #include <sys/file.h>
  #include <sys/socket.h>
+@@ -919,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

Index: pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c
diff -u pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c:1.1 pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c:1.2
--- pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c:1.1   Tue May 15 22:22:01 2018
+++ pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c       Sat Jun  1 01:11:57 2019
@@ -1,8 +1,10 @@
-$NetBSD: patch-psutil_arch_netbsd_specific.c,v 1.1 2018/05/15 22:22:01 minskim Exp $
+$NetBSD: patch-psutil_arch_netbsd_specific.c,v 1.2 2019/06/01 01:11:57 kamil Exp $
 
 Don't include <sys/user.h> on NetBSD. Include <sys/iostat.h> instead.
 
---- psutil/arch/netbsd/specific.c.orig 2018-04-12 08:37:17.000000000 +0000
+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
 @@ -22,7 +22,7 @@
  #include <sys/types.h>
@@ -13,3 +15,28 @@ Don't include <sys/user.h> on NetBSD. In
  #include <sys/proc.h>
  #include <sys/swap.h>  // for swap_mem
  #include <signal.h>
+@@ -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

Added files:

Index: pkgsrc/sysutils/py-psutil/patches/patch-psutil___psbsd.py
diff -u /dev/null pkgsrc/sysutils/py-psutil/patches/patch-psutil___psbsd.py:1.3
--- /dev/null   Sat Jun  1 01:11:57 2019
+++ pkgsrc/sysutils/py-psutil/patches/patch-psutil___psbsd.py   Sat Jun  1 01:11:57 2019
@@ -0,0 +1,23 @@
+$NetBSD: patch-psutil___psbsd.py,v 1.3 2019/06/01 01:11:57 kamil Exp $
+
+Use proc_cwd on NetBSD >= 8.99.42.
+
+--- psutil/_psbsd.py.orig      2019-04-11 21:10:12.000000000 +0000
++++ psutil/_psbsd.py
+@@ -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:

Index: pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.h
diff -u /dev/null pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.h:1.1
--- /dev/null   Sat Jun  1 01:11:57 2019
+++ pkgsrc/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.h       Sat Jun  1 01:11:57 2019
@@ -0,0 +1,13 @@
+$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



Home | Main Index | Thread Index | Old Index