pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/py-psutil py-psutil: fix bugs in swap code on...
details: https://anonhg.NetBSD.org/pkgsrc/rev/99538df28e20
branches: trunk
changeset: 382678:99538df28e20
user: wiz <wiz%pkgsrc.org@localhost>
date: Tue Aug 02 17:13:10 2022 +0000
description:
py-psutil: fix bugs in swap code on NetBSD.
Bump PKGREVISION.
diffstat:
sysutils/py-psutil/Makefile | 5 +-
sysutils/py-psutil/distinfo | 3 +-
sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c | 27 ++++++++++
3 files changed, 32 insertions(+), 3 deletions(-)
diffs (65 lines):
diff -r dd312219e794 -r 99538df28e20 sysutils/py-psutil/Makefile
--- a/sysutils/py-psutil/Makefile Tue Aug 02 16:06:01 2022 +0000
+++ b/sysutils/py-psutil/Makefile Tue Aug 02 17:13:10 2022 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.44 2022/07/07 11:54:53 adam Exp $
+# $NetBSD: Makefile,v 1.45 2022/08/02 17:13:10 wiz Exp $
DISTNAME= psutil-5.9.1
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
+PKGREVISION= 1
CATEGORIES= sysutils python
MASTER_SITES= ${MASTER_SITE_PYPI:=p/psutil/}
@@ -17,7 +18,7 @@
# facilitate PLIST processing
.if ${OPSYS} == "Darwin"
PLIST_SUBST+= SYSTEM=osx
-.elif !empty(OPSYS:M*BSD)
+.elif ${OPSYS:M*BSD}
PLIST_SUBST+= SYSTEM=bsd
.else
PLIST_SUBST+= SYSTEM=${OPSYS:tl}
diff -r dd312219e794 -r 99538df28e20 sysutils/py-psutil/distinfo
--- a/sysutils/py-psutil/distinfo Tue Aug 02 16:06:01 2022 +0000
+++ b/sysutils/py-psutil/distinfo Tue Aug 02 17:13:10 2022 +0000
@@ -1,6 +1,7 @@
-$NetBSD: distinfo,v 1.45 2022/07/07 11:54:53 adam Exp $
+$NetBSD: distinfo,v 1.46 2022/08/02 17:13:10 wiz Exp $
BLAKE2s (psutil-5.9.1.tar.gz) = 5aae9fa5a4e596f3074bddead9b0cd0e49aa164b8fc4507a95c4c04569a2e53f
SHA512 (psutil-5.9.1.tar.gz) = 1ddb119a10243d17d808417817ec8659d22447f12a4bbc0366c13f6587a4b0b59f4e74f6ac5d1e1a908bb5fd287be630466d32beabcb5008f6a19c24a1557c27
Size (psutil-5.9.1.tar.gz) = 479090 bytes
SHA1 (patch-psutil___psbsd.py) = ae69cf5f7ce590c34ef4e770b2fb0386425f33b6
+SHA1 (patch-psutil_arch_netbsd_specific.c) = ce7c91a1f7de0cbc443435fcb1e34af96bff4a3e
diff -r dd312219e794 -r 99538df28e20 sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/py-psutil/patches/patch-psutil_arch_netbsd_specific.c Tue Aug 02 17:13:10 2022 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-psutil_arch_netbsd_specific.c,v 1.6 2022/08/02 17:13:10 wiz Exp $
+
+Fix swap code.
+https://github.com/giampaolo/psutil/pull/2128
+
+--- psutil/arch/netbsd/specific.c.orig 2022-02-01 21:23:36.000000000 +0000
++++ psutil/arch/netbsd/specific.c
+@@ -459,7 +459,7 @@ psutil_virtual_mem(PyObject *self, PyObj
+ (unsigned long long) uv.active << uv.pageshift, // active
+ (unsigned long long) uv.inactive << uv.pageshift, // inactive
+ (unsigned long long) uv.wired << uv.pageshift, // wired
+- (unsigned long long) uv.filepages + uv.execpages * pagesize, // cached
++ (unsigned long long) (uv.filepages + uv.execpages) * pagesize, // cached
+ // These are determined from /proc/meminfo in Python.
+ (unsigned long long) 0, // buffers
+ (unsigned long long) 0 // shared
+@@ -495,8 +495,8 @@ psutil_swap_mem(PyObject *self, PyObject
+ swap_total = swap_free = 0;
+ for (i = 0; i < nswap; i++) {
+ if (swdev[i].se_flags & SWF_ENABLE) {
+- swap_total += swdev[i].se_nblks * DEV_BSIZE;
+- swap_free += (swdev[i].se_nblks - swdev[i].se_inuse) * DEV_BSIZE;
++ swap_total += (uint64_t)swdev[i].se_nblks * DEV_BSIZE;
++ swap_free += (uint64_t)(swdev[i].se_nblks - swdev[i].se_inuse) * DEV_BSIZE;
+ }
+ }
+ free(swdev);
Home |
Main Index |
Thread Index |
Old Index