[gentoo-commits] repo/gentoo:master commit in: sys-apps/dstat/files/, sys-apps/dstat/

2020-07-16 Thread Joonas Niilola
commit: dfe7211eaba93e58b530ec6fd80f3478e4ec3653
Author: Tomáš Mózes  gmail  com>
AuthorDate: Fri Jun 19 09:18:02 2020 +
Commit: Joonas Niilola  gentoo  org>
CommitDate: Thu Jul 16 14:38:40 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dfe7211e

sys-apps/dstat: fix csv output

Closes: https://bugs.gentoo.org/728736
Signed-off-by: Tomáš Mózes  gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/16322
Signed-off-by: Joonas Niilola  gentoo.org>

 sys-apps/dstat/dstat-0.7.4-r2.ebuild  | 56 +++
 sys-apps/dstat/files/fix-csv-output.patch | 21 
 2 files changed, 77 insertions(+)

diff --git a/sys-apps/dstat/dstat-0.7.4-r2.ebuild 
b/sys-apps/dstat/dstat-0.7.4-r2.ebuild
new file mode 100644
index 000..ef9a1a736ea
--- /dev/null
+++ b/sys-apps/dstat/dstat-0.7.4-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+
+inherit python-r1
+
+DESCRIPTION="Versatile replacement for vmstat, iostat and ifstat"
+HOMEPAGE="http://dag.wieers.com/home-made/dstat/";
+SRC_URI="https://github.com/dagwieers/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 
~x86-linux"
+IUSE="doc examples"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="${PYTHON_DEPS}
+   dev-python/six[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+   "${FILESDIR}/dstat-${PV}-skip-non-sandbox-tests.patch"
+   "${FILESDIR}/fix-collections-deprecation-warning.patch"
+   "${FILESDIR}/fix-csv-output.patch"
+)
+
+src_prepare() {
+
+   # bug fix: allow delay to be specified
+   # backport from: https://github.com/dagwieers/dstat/pull/167/files
+   sed -i -e 's; / op\.delay; // op.delay;' "dstat" || die
+
+   default
+}
+
+src_install() {
+   python_foreach_impl python_doscript dstat
+
+   insinto /usr/share/dstat
+   newins dstat dstat.py
+   doins plugins/dstat_*.py
+
+   doman docs/dstat.1
+
+   einstalldocs
+
+   if use examples; then
+   dodoc examples/{mstat,read}.py
+   fi
+   if use doc; then
+   dodoc docs/*.html
+   fi
+}

diff --git a/sys-apps/dstat/files/fix-csv-output.patch 
b/sys-apps/dstat/files/fix-csv-output.patch
new file mode 100644
index 000..e44125b0e46
--- /dev/null
+++ b/sys-apps/dstat/files/fix-csv-output.patch
@@ -0,0 +1,21 @@
+https://serverfault.com/questions/996996/dstat-fails-to-start-trying-to-load-python3s-csv
+
+diff --git a/dstat b/dstat
+index 9359965..1682fb5 100755
+--- a/dstat
 b/dstat
+@@ -541,12 +541,12 @@ class dstat:
+ 
+ line = ''
+ for i, name in enumerate(self.vars):
+-if isinstance(self.val[name], types.ListType) or 
isinstance(self.val[name], types.TupleType):
++if isinstance(self.val[name], (tuple, list)):
+ for j, val in enumerate(self.val[name]):
+ line = line + printcsv(val)
+ if j + 1 != len(self.val[name]):
+ line = line + char['sep']
+-elif isinstance(self.val[name], types.StringType):
++elif isinstance(self.val[name], str):
+ line = line + self.val[name]
+ else:
+ line = line + printcsv(self.val[name])



[gentoo-commits] repo/gentoo:master commit in: sys-apps/dstat/files/, sys-apps/dstat/

2020-07-16 Thread Joonas Niilola
commit: 372d3bc3dbb073de22a7ef44e399d5e218b92348
Author: Joonas Niilola  gentoo  org>
AuthorDate: Thu Jul 16 13:45:58 2020 +
Commit: Joonas Niilola  gentoo  org>
CommitDate: Thu Jul 16 14:38:40 2020 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=372d3bc3

sys-apps/dstat: rename csv-output.patch better

Signed-off-by: Joonas Niilola  gentoo.org>

 sys-apps/dstat/dstat-0.7.4-r2.ebuild| 2 +-
 .../files/{fix-csv-output.patch => dstat-0.7.4-fix-csv-output.patch}| 0
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-apps/dstat/dstat-0.7.4-r2.ebuild 
b/sys-apps/dstat/dstat-0.7.4-r2.ebuild
index ef9a1a736ea..6116fd50161 100644
--- a/sys-apps/dstat/dstat-0.7.4-r2.ebuild
+++ b/sys-apps/dstat/dstat-0.7.4-r2.ebuild
@@ -24,7 +24,7 @@ DEPEND="${RDEPEND}"
 PATCHES=(
"${FILESDIR}/dstat-${PV}-skip-non-sandbox-tests.patch"
"${FILESDIR}/fix-collections-deprecation-warning.patch"
-   "${FILESDIR}/fix-csv-output.patch"
+   "${FILESDIR}/dstat-0.7.4-fix-csv-output.patch"
 )
 
 src_prepare() {

diff --git a/sys-apps/dstat/files/fix-csv-output.patch 
b/sys-apps/dstat/files/dstat-0.7.4-fix-csv-output.patch
similarity index 100%
rename from sys-apps/dstat/files/fix-csv-output.patch
rename to sys-apps/dstat/files/dstat-0.7.4-fix-csv-output.patch



[gentoo-commits] repo/gentoo:master commit in: sys-apps/dstat/files/, sys-apps/dstat/

2019-10-21 Thread Joonas Niilola
commit: 3b58c3821d247318956da534ca95b838d1ed26f2
Author: Paul Healy  gmail  com>
AuthorDate: Tue Oct  8 20:21:11 2019 +
Commit: Joonas Niilola  gentoo  org>
CommitDate: Mon Oct 21 14:08:17 2019 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b58c382

sys-apps/dstat: version bump to 0.7.4

Adds support for python 3
Now uses EAPI 7
backport fix from: https://github.com/dagwieers/dstat/pull/167/files
added missing six dep
avoid deprecation warning for importing collections with python 3.7

Closes: https://bugs.gentoo.org/696442

Signed-off-by: Paul Healy  gmail.com>
Signed-off-by: Joonas Niilola  gentoo.org>

 sys-apps/dstat/Manifest|  1 +
 sys-apps/dstat/dstat-0.7.4.ebuild  | 51 ++
 .../files/dstat-0.7.4-skip-non-sandbox-tests.patch | 18 
 .../fix-collections-deprecation-warning.patch  | 25 +++
 4 files changed, 95 insertions(+)

diff --git a/sys-apps/dstat/Manifest b/sys-apps/dstat/Manifest
index bd2c9a4da63..ad77287898f 100644
--- a/sys-apps/dstat/Manifest
+++ b/sys-apps/dstat/Manifest
@@ -1 +1,2 @@
 DIST dstat-0.7.3.tar.gz 135583 BLAKE2B 
c846a06b6039e49944d43cc36178fed74fd4e0e3a1a4418dbe0e5987763995eb36dff0245cfa7107d446b8ac2ea500e13980f87e97aa8e5b8d566ee188be1639
 SHA512 
db37cc8bb7afd235ae9088e76c4defaa4d76651b111fbfdcd0980bc96376de20d57964912799a413397a79651730503bdeb8fea5cb97ab4d6d81632f528aefd2
+DIST dstat-0.7.4.tar.gz 139992 BLAKE2B 
c8226358956687a4f64e248ef539b431b9e394e87986366f9941df2e86f0dac3032261ec2ca9c816d3bc89afabc352bc8bc80f9ad3eaa6118fd16bd7b0f1e68e
 SHA512 
d100223887ebd83d0fd1259436f39419a85df9002556abcfc8e4195aa63be73d85707dcd5c4fb56a979b29131485dce6e97c177fbfca08dc50bd0f92b15cc6f5

diff --git a/sys-apps/dstat/dstat-0.7.4.ebuild 
b/sys-apps/dstat/dstat-0.7.4.ebuild
new file mode 100644
index 000..66bbf59ec4a
--- /dev/null
+++ b/sys-apps/dstat/dstat-0.7.4.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_{6,7}} )
+
+inherit python-r1
+
+DESCRIPTION="Versatile replacement for vmstat, iostat and ifstat"
+HOMEPAGE="http://dag.wieers.com/home-made/dstat/";
+SRC_URI="https://github.com/dagwieers/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 
~amd64-linux ~x86-linux"
+IUSE="doc examples wifi"
+REQUIRED_USE="wifi? ( ${PYTHON_REQUIRED_USE} )"
+
+RDEPEND="
+   dev-python/six[${PYTHON_USEDEP}]
+   wifi? (
+   ${PYTHON_DEPS}
+   net-wireless/python-wifi
+   )"
+DEPEND=""
+
+PATCHES=( \
+   "${FILESDIR}/dstat-${PV}-skip-non-sandbox-tests.patch" \
+   "${FILESDIR}/fix-collections-deprecation-warning.patch" \
+)
+
+src_prepare() {
+
+   # bug fix: allow delay to be specified
+   # backport from: https://github.com/dagwieers/dstat/pull/167/files
+   sed -i -e 's; / op\.delay; // op.delay;' "dstat" || die
+
+   default
+}
+
+src_install() {
+   default
+
+   if use examples; then
+   dodoc examples/{mstat,read}.py
+   fi
+   if use doc; then
+   dodoc docs/*.html
+   fi
+}

diff --git a/sys-apps/dstat/files/dstat-0.7.4-skip-non-sandbox-tests.patch 
b/sys-apps/dstat/files/dstat-0.7.4-skip-non-sandbox-tests.patch
new file mode 100644
index 000..38457cdc95d
--- /dev/null
+++ b/sys-apps/dstat/files/dstat-0.7.4-skip-non-sandbox-tests.patch
@@ -0,0 +1,18 @@
+diff --git a/Makefile b/Makefile
+index c371f62..42ef84d 100644
+--- a/Makefile
 b/Makefile
+@@ -32,10 +32,12 @@ clean:
+   rm -f examples/*.pyc plugins/*.pyc
+   $(MAKE) -C docs clean
+ 
++TEST_PLUGINS=--cpufreq --disk-tps --dstat-cpu --dstat-ctxt --dstat-mem 
--dstat --helloworld --md-status --net-packets --proc-count --snooze --test 
--top-bio-adv --top-bio --top-childwait --top-cpu-adv --top-cpu 
--top-cputime-avg --top-cputime --top-int --top-io-adv --top-io 
--top-latency-avg --top-latency --top-mem --top-oom
++
+ test:
+   ./dstat --version
+   ./dstat -taf 1 5
+-  ./dstat -t --all-plugins 1 5
++  ./dstat -t $(TEST_PLUGINS) 1 5
+ 
+ dist: clean
+   $(MAKE) -C docs dist

diff --git a/sys-apps/dstat/files/fix-collections-deprecation-warning.patch 
b/sys-apps/dstat/files/fix-collections-deprecation-warning.patch
new file mode 100644
index 000..e505c98d89f
--- /dev/null
+++ b/sys-apps/dstat/files/fix-collections-deprecation-warning.patch
@@ -0,0 +1,25 @@
+diff --git a/dstat b/dstat
+index 9359965..777242f 100755
+--- a/dstat
 b/dstat
+@@ -19,6 +19,11 @@
+ from __future__ import absolute_import, division, generators, print_function
+ __metaclass__ = type
+ 
++try:
++from collections.abc import Sequence
++except ImportError:
++from collections import Sequence
++
+ import collections
+ import fnmatch
+ import getopt
+@@ -512,7 +517,7 @@ class 

[gentoo-commits] repo/gentoo:master commit in: sys-apps/dstat/files/, sys-apps/dstat/

2018-10-07 Thread Andreas Sturmlechner
commit: 3f9649777c14a331b3f29c0bc77f223656eec5a0
Author: Paul Healy  gmail  com>
AuthorDate: Tue Oct  2 17:52:58 2018 +
Commit: Andreas Sturmlechner  gentoo  org>
CommitDate: Sun Oct  7 21:06:41 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f964977

sys-apps/dstat: avoid running network... etc tests

This fixes the test target to only load a restricted
number of the shipped plugins - network, db,
virtualisation... etc will fail in different ways
unless the environment or explicit dependencies are
met.

Closes: https://bugs.gentoo.org/638728
Closes: https://bugs.gentoo.org/656514

Signed-off-by: Paul Healy  gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/10046
Signed-off-by: Andreas Sturmlechner  gentoo.org>

 sys-apps/dstat/dstat-0.7.3.ebuild |  2 ++
 .../dstat/files/dstat-0.7.3-skip-non-sandbox-tests.patch  | 15 +++
 2 files changed, 17 insertions(+)

diff --git a/sys-apps/dstat/dstat-0.7.3.ebuild 
b/sys-apps/dstat/dstat-0.7.3.ebuild
index cbdd1df1a54..372d70a1fd0 100644
--- a/sys-apps/dstat/dstat-0.7.3.ebuild
+++ b/sys-apps/dstat/dstat-0.7.3.ebuild
@@ -24,6 +24,8 @@ RDEPEND="
)"
 DEPEND=""
 
+PATCHES=( "${FILESDIR}/dstat-${PV}-skip-non-sandbox-tests.patch" )
+
 src_install() {
emake DESTDIR="${ED}" install
einstalldocs

diff --git a/sys-apps/dstat/files/dstat-0.7.3-skip-non-sandbox-tests.patch 
b/sys-apps/dstat/files/dstat-0.7.3-skip-non-sandbox-tests.patch
new file mode 100644
index 000..48eb542ed19
--- /dev/null
+++ b/sys-apps/dstat/files/dstat-0.7.3-skip-non-sandbox-tests.patch
@@ -0,0 +1,15 @@
+--- a/Makefile 2016-03-18 13:03:22.0 +
 b/Makefile 2018-10-02 11:11:00.344942941 +0100
+@@ -32,9 +32,11 @@
+   rm -f examples/*.pyc plugins/*.pyc
+   $(MAKE) -C docs clean
+ 
++TEST_PLUGINS=--cpufreq --disk-avgqu --disk-avgrq --disk-svctm --disk-tps 
--disk-util --disk-wait --dstat-cpu --dstat-ctxt --dstat-mem --dstat 
--helloworld --md-status --net-packets --proc-count --snooze --test 
--top-bio-adv --top-bio --top-childwait --top-cpu-adv --top-cpu 
--top-cputime-avg --top-cputime --top-int --top-io-adv --top-io 
--top-latency-avg --top-latency --top-mem --top-oom
++
+ test:
+   ./dstat -taf 1 5
+-  ./dstat -t --all-plugins 1 5
++  ./dstat -t $(TEST_PLUGINS) 1 5
+ 
+ dist: clean
+   $(MAKE) -C docs dist