diff options
author | Tomáš Mózes <hydrapolic@gmail.com> | 2020-06-19 09:18:02 +0000 |
---|---|---|
committer | Joonas Niilola <juippis@gentoo.org> | 2020-07-16 17:38:40 +0300 |
commit | dfe7211eaba93e58b530ec6fd80f3478e4ec3653 (patch) | |
tree | 517b2d9a6f00dcf2965a52f9eb1507f7c7ae8b61 /sys-apps/dstat | |
parent | media-gfx/iscan: Explicitly use pthreads so we can use gold linker (diff) | |
download | gentoo-dfe7211eaba93e58b530ec6fd80f3478e4ec3653.tar.gz gentoo-dfe7211eaba93e58b530ec6fd80f3478e4ec3653.tar.bz2 gentoo-dfe7211eaba93e58b530ec6fd80f3478e4ec3653.zip |
sys-apps/dstat: fix csv output
Closes: https://bugs.gentoo.org/728736
Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/16322
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'sys-apps/dstat')
-rw-r--r-- | sys-apps/dstat/dstat-0.7.4-r2.ebuild | 56 | ||||
-rw-r--r-- | sys-apps/dstat/files/fix-csv-output.patch | 21 |
2 files changed, 77 insertions, 0 deletions
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 000000000000..ef9a1a736eaf --- /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 000000000000..e44125b0e469 --- /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]) |