[packages/dstat] Up to 0.7.4
arekm
arekm at pld-linux.org
Sat Mar 14 21:22:10 CET 2026
commit 51d51641bbb535b264274b18986867e4f4aca8c5
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sat Mar 14 21:22:03 2026 +0100
Up to 0.7.4
220a785321b13b6df92a536080aca6ef1cb644ad.patch | 40 ++++++++++++++++++++++++++
dstat-python3.patch | 26 +++++++++++++++++
dstat.spec | 19 ++++++------
3 files changed, 77 insertions(+), 8 deletions(-)
---
diff --git a/dstat.spec b/dstat.spec
index 3cb07c3..2ae0a98 100644
--- a/dstat.spec
+++ b/dstat.spec
@@ -1,16 +1,17 @@
Summary: Versatile resource statistics tool
Summary(pl.UTF-8): Uniwersalne narzędzie do monitorowania użycia zasobów
Name: dstat
-Version: 0.7.2
-Release: 2
+Version: 0.7.4
+Release: 1
License: GPL v2+
Group: Applications/System
-Source0: http://dag.wieers.com/home-made/dstat/%{name}-%{version}.tar.bz2
-# Source0-md5: bfea4dc8037a0b18fc40a4dfc104dcc8
+Source0: https://github.com/dagwieers/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 9d6a11d1f8cff1e4bf953958c824c798
+Patch0: 220a785321b13b6df92a536080aca6ef1cb644ad.patch
+Patch1: dstat-python3.patch
URL: http://dag.wieers.com/home-made/dstat/
-BuildRequires: rpm-pythonprov
-Requires: python
-Requires: python-modules
+Requires: python3
+Requires: python3-six
BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -40,6 +41,8 @@ samym interwale czasowym).
%prep
%setup -q
+%patch 0 -p1
+%patch 1 -p1
%install
rm -rf $RPM_BUILD_ROOT
@@ -55,7 +58,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog README TODO docs/*.html docs/*.txt examples/
+%doc AUTHORS ChangeLog LINKS README.adoc TODO docs/*.html examples/
%attr(755,root,root) %{_bindir}/dstat
%{_mandir}/man1/dstat.1*
%{_datadir}/dstat
diff --git a/220a785321b13b6df92a536080aca6ef1cb644ad.patch b/220a785321b13b6df92a536080aca6ef1cb644ad.patch
new file mode 100644
index 0000000..177c740
--- /dev/null
+++ b/220a785321b13b6df92a536080aca6ef1cb644ad.patch
@@ -0,0 +1,40 @@
+From 220a785321b13b6df92a536080aca6ef1cb644ad Mon Sep 17 00:00:00 2001
+From: Falko Goettsch <falko at uw.edu>
+Date: Mon, 11 Mar 2019 20:12:49 -0700
+Subject: [PATCH] Fixed bug when specifying a delay
+
+The division in the 'loop' calculation in perform() was returning floating point values
+after the migration to Python 3, rather than rounding down. Changed to floor division.
+
+I think the floating point values kept 'loop == 0' from ever being
+true and the variables inside that conditional were never initialized,
+causing the following error when a delay other than 1 was specified:
+
+You did not select any stats, using -cdngy by default.
+Traceback (most recent call last):
+ File "/home/falko/repos/dstat/dstat", line 2825, in <module>
+ main()
+ File "/home/falko/repos/dstat/dstat", line 2684, in main
+ scheduler.run()
+ File "/home/falko/.conda/envs/python3/lib/python3.7/sched.py", line 151, in run
+ action(*argument, **kwargs)
+ File "/home/falko/repos/dstat/dstat", line 2729, in perform
+ oldcols = cols
+NameError: name 'cols' is not defined
+---
+ dstat | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dstat b/dstat
+index 9359965..3b4980f 100755
+--- a/dstat
++++ b/dstat
+@@ -2697,7 +2697,7 @@ def perform(update):
+
+ starttime = time.time()
+
+- loop = (update - 1 + op.delay) / op.delay
++ loop = (update - 1 + op.delay) // op.delay
+ step = ((update - 1) % op.delay) + 1
+
+ ### Get current time (may be different from schedule) for debugging
diff --git a/dstat-python3.patch b/dstat-python3.patch
new file mode 100644
index 0000000..665279a
--- /dev/null
+++ b/dstat-python3.patch
@@ -0,0 +1,26 @@
+--- dstat-0.7.4/dstat.orig
++++ dstat-0.7.4/dstat
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+
+ ### This program is free software; you can redistribute it and/or
+ ### modify it under the terms of the GNU General Public License
+@@ -19,7 +19,7 @@
+ from __future__ import absolute_import, division, generators, print_function
+ __metaclass__ = type
+
+-import collections
++import collections.abc
+ import fnmatch
+ import getopt
+ import getpass
+@@ -512,7 +512,7 @@
+ scale = self.scales[i]
+ else:
+ scale = self.scale
+- if isinstance(self.val[name], collections.Sequence) and not isinstance(self.val[name], six.string_types):
++ if isinstance(self.val[name], collections.abc.Sequence) and not isinstance(self.val[name], six.string_types):
+ line = line + cprintlist(self.val[name], ctype, self.width, scale)
+ sep = theme['frame'] + char['colon']
+ if i + 1 != len(self.vars):
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/dstat.git/commitdiff/51d51641bbb535b264274b18986867e4f4aca8c5
More information about the pld-cvs-commit
mailing list