dev-python/cgroup-utils: 0.8 + EAPI 7 + tests + py3[78]
authorSebastian Pipping <sping@gentoo.org>
Fri, 27 Mar 2020 14:58:23 +0000 (15:58 +0100)
committerSebastian Pipping <sping@gentoo.org>
Fri, 27 Mar 2020 15:02:40 +0000 (16:02 +0100)
Bug: https://bugs.gentoo.org/711808
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
Package-Manager: Portage-2.3.92, Repoman-2.3.20

dev-python/cgroup-utils/Manifest
dev-python/cgroup-utils/cgroup-utils-0.8.ebuild [new file with mode: 0644]
dev-python/cgroup-utils/files/cgroup-utils-0.8-tests-builddir.patch [new file with mode: 0644]
dev-python/cgroup-utils/files/cgroup-utils-0.8-tests-mountpoint.patch [new file with mode: 0644]
profiles/package.mask

index 1085d34b81f3dfb0e063ebec8b175081cb751b0c..feddb90850bda42a093902a8ba81cc52cf376b2e 100644 (file)
@@ -1 +1,2 @@
 DIST cgroup-utils-0.6.tar.gz 33845 BLAKE2B 1e7688f9dc32cc976acbd0a89e561b6f5537972c286765370cd2d9e090ca95cc122442d82e617b6d7132d35459b7ddd3413060945651593ba7498da22af26ae6 SHA512 5751ad7979812117cd75fc74282fb24f3ee041cc08eaac986544a5f12b7e83c806f0d1bb4c92c32314c5c8af4995dc4f36e023037ed7617907c8f42f97dbf6b5
+DIST cgroup-utils-0.8.tar.gz 35260 BLAKE2B 11187a917d5159699eb46fb67f5057eb16317f86c32e6471d8543955e1d40107663517395226ae75e3b0739fb59c7521590a3d04a5d818b151970cbea559dee7 SHA512 fcc31fb6d2bdfa761c248553d056ea1bdcf697ae9ab8ccdc895feefdec7bc4e560bf2352968866b3064548545d98527d2a4092d4c8d2f335ef76e3c4b721bcf0
diff --git a/dev-python/cgroup-utils/cgroup-utils-0.8.ebuild b/dev-python/cgroup-utils/cgroup-utils-0.8.ebuild
new file mode 100644 (file)
index 0000000..f2de260
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit distutils-r1
+
+DESCRIPTION="Tools and libraries for control groups of Linux"
+HOMEPAGE="https://github.com/peo3/cgroup-utils"
+SRC_URI="https://github.com/peo3/cgroup-utils/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND=""
+RDEPEND=""
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.8-tests-builddir.patch
+
+       # Upstream: https://github.com/peo3/cgroup-utils/pull/12
+       "${FILESDIR}"/${PN}-0.8-tests-mountpoint.patch
+)
+
+python_test() {
+       sh ./test_all.sh || die
+}
diff --git a/dev-python/cgroup-utils/files/cgroup-utils-0.8-tests-builddir.patch b/dev-python/cgroup-utils/files/cgroup-utils-0.8-tests-builddir.patch
new file mode 100644 (file)
index 0000000..2ec6c4f
--- /dev/null
@@ -0,0 +1,25 @@
+From cf44c226f26a3d753402d36c66fcb8f81b4748f5 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Fri, 27 Mar 2020 15:35:46 +0100
+Subject: [PATCH] Make tests find the build
+
+---
+ test_all.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test_all.sh b/test_all.sh
+index d158f76..4fbbf2e 100644
+--- a/test_all.sh
++++ b/test_all.sh
+@@ -85,7 +85,7 @@ test_support()
+     fi
+ }
+-buildpath=$(find ./build/lib.linux* -maxdepth 0 -type d)
++buildpath="${BUILD_DIR}"/lib  # passed by distutils-r1 eclass
+ export PYTHONPATH=$buildpath:.
+ echo "## Testing each commands for each subsystems"
+-- 
+2.24.1
+
diff --git a/dev-python/cgroup-utils/files/cgroup-utils-0.8-tests-mountpoint.patch b/dev-python/cgroup-utils/files/cgroup-utils-0.8-tests-mountpoint.patch
new file mode 100644 (file)
index 0000000..bff7b04
--- /dev/null
@@ -0,0 +1,25 @@
+From 0697af646a8235f80856c472e623117719c7186e Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Fri, 27 Mar 2020 15:48:25 +0100
+Subject: [PATCH] test_all.sh: Fix detection of memory cgroup mountpoint
+
+---
+ test_all.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test_all.sh b/test_all.sh
+index d158f76..4d10e19 100644
+--- a/test_all.sh
++++ b/test_all.sh
+@@ -97,7 +97,7 @@ done
+ test_run bin/cgutil top -b -n 1
+-root=$(awk '/^cgroup.*memory/ {print $2;}' /proc/mounts)
++root=$(awk '/^(cgroup.*)?memory/ {print $2;}' /proc/mounts)
+ path=$root/memory.usage_in_bytes
+ test_run_event bin/cgutil event -t 0.1 $path +1M
+ path=$root/memory.oom_control
+-- 
+2.24.1
+
index 77f4423b662fd313355bd62584b19843de52a998..a3ad7e3c48b48c39058a00ba290f3c625fc7b01a 100644 (file)
@@ -255,7 +255,6 @@ dev-python/bcolz
 dev-python/beaker
 dev-python/biplist
 dev-python/blaze
-dev-python/cgroup-utils
 dev-python/colander
 dev-python/colorful
 dev-python/columnize