rpms/dstat/F-10 dstat-0.6.8-counts.patch, NONE, 1.1 dstat-0.6.8-dbus.patch, 1.1, 1.2 dstat.spec, 1.10, 1.11
Zdenek Prikryl
zprikryl at fedoraproject.org
Tue Dec 23 11:41:13 UTC 2008
Author: zprikryl
Update of /cvs/extras/rpms/dstat/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13726
Modified Files:
dstat-0.6.8-dbus.patch dstat.spec
Added Files:
dstat-0.6.8-counts.patch
Log Message:
Fixed wrong total disk counts (#476935)
Fixed dbus module patch agai
dstat-0.6.8-counts.patch:
--- NEW FILE dstat-0.6.8-counts.patch ---
diff -up dstat-0.6.8/dstat.counts dstat-0.6.8/dstat
--- dstat-0.6.8/dstat.counts 2008-12-18 08:09:11.000000000 +0100
+++ dstat-0.6.8/dstat 2008-12-23 12:31:15.000000000 +0100
@@ -585,6 +585,7 @@ class dstat_cpu24(dstat):
class dstat_disk(dstat):
def __init__(self):
self.format = ('f', 5, 1024)
+ self.diskfilter = re.compile('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)')
self.open('/proc/diskstats')
self.nick = ('read', 'writ')
self.discover = self.discover()
@@ -612,7 +613,7 @@ class dstat_disk(dstat):
else:
list = []
for name in self.discover:
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not self.diskfilter.match(name):
list.append(name)
# if len(list) > 2: list = list[0:2]
list.sort()
@@ -629,7 +630,7 @@ class dstat_disk(dstat):
if l[5] == '0' and l[9] == '0': continue
name = l[2]
if l[3:] == ['0',] * 11: continue
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not self.diskfilter.match(name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[5]), self.cn2['total'][1] + long(l[9]) )
if name in self.vars and name != 'total':
self.cn2[name] = ( self.cn2[name][0] + long(l[5]), self.cn2[name][1] + long(l[9]) )
@@ -649,6 +650,7 @@ class dstat_disk(dstat):
class dstat_disk24(dstat):
def __init__(self):
self.format = ('f', 5, 1024)
+ self.diskfilter = re.compile('(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)')
self.open('/proc/partitions')
self.nick = ('read', 'writ')
self.discover = self.discover()
@@ -677,7 +679,7 @@ class dstat_disk24(dstat):
else:
list = []
for name in self.discover:
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not self.diskfilter.match(name):
list.append(name)
# if len(list) > 2: list = list[0:2]
list.sort()
@@ -692,7 +694,7 @@ class dstat_disk24(dstat):
l = line.split()
if len(l) < 15 or l[0] == 'major' or int(l[1]) % 16 != 0: continue
name = l[3]
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not self.diskfilter.match(name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[6]), self.cn2['total'][1] + long(l[10]) )
if name in self.vars:
self.cn2[name] = ( self.cn2[name][0] + long(l[6]), self.cn2[name][1] + long(l[10]) )
@@ -713,9 +715,9 @@ class dstat_disk24(dstat):
class dstat_disk24old(dstat):
def __init__(self):
self.format = ('f', 5, 1024)
+ self.regexp = re.compile('^\((\d+),(\d+)\):\(\d+,\d+,(\d+),\d+,(\d+)\)$')
self.open('/proc/stat')
self.nick = ('read', 'writ')
- self.regexp = re.compile('^\((\d+),(\d+)\):\(\d+,\d+,(\d+),\d+,(\d+)\)$')
self.discover = self.discover()
self.vars = self.vars()
self.name = ['dsk/'+name for name in self.vars]
@@ -748,7 +750,7 @@ class dstat_disk24old(dstat):
else:
list = []
for name in self.discover:
- if not re.match('(md[0-9]+|dm-[0-9]+)', name):
+ if not self.diskfilter.match(name):
list.append(name)
# if len(list) > 2: list = list[0:2]
list.sort()
@@ -770,7 +772,7 @@ class dstat_disk24old(dstat):
l = m.groups()
if len(l) < 4: continue
name = dev(int(l[0]), int(l[1]))
- if not re.match('(md[0-9]+)', name):
+ if not self.diskfilter.match(name):
self.cn2['total'] = ( self.cn2['total'][0] + long(l[2]), self.cn2['total'][1] + long(l[3]) )
if name in self.vars and name != 'total':
self.cn2[name] = ( self.cn2[name][0] + long(l[2]), self.cn2[name][1] + long(l[3]) )
dstat-0.6.8-dbus.patch:
Index: dstat-0.6.8-dbus.patch
===================================================================
RCS file: /cvs/extras/rpms/dstat/F-10/dstat-0.6.8-dbus.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- dstat-0.6.8-dbus.patch 16 Sep 2008 11:34:50 -0000 1.1
+++ dstat-0.6.8-dbus.patch 23 Dec 2008 11:40:42 -0000 1.2
@@ -23,7 +23,7 @@
+ try:
+ self.sesbus = dbus.Interface(dbus.SessionBus().get_object('org.freedesktop.DBus', '/org/freedesktop/DBus'), 'org.freedesktop.DBus')
+ except:
-+ raise True
++ self.sesbus = None
+
+ return True
Index: dstat.spec
===================================================================
RCS file: /cvs/extras/rpms/dstat/F-10/dstat.spec,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- dstat.spec 16 Sep 2008 11:34:50 -0000 1.10
+++ dstat.spec 23 Dec 2008 11:40:42 -0000 1.11
@@ -4,13 +4,14 @@
Summary: Versatile resource statistics tool
Name: dstat
Version: 0.6.8
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Group: System Environment/Base
URL: http://dag.wieers.com/home-made/dstat/
Source: http://dag.wieers.com/home-made/dstat/dstat-%{version}.tar.bz2
Patch0: dstat-0.6.8-dbus.patch
+Patch1: dstat-0.6.8-counts.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root%(%{__id_u} -n)
BuildArch: noarch
@@ -35,6 +36,7 @@
%prep
%setup -q
%patch0 -p1 -b .dbus
+%patch1 -p1 -b .counts
%build
# Make sure the docs are in unix format
@@ -65,6 +67,10 @@
%{_datadir}/dstat/*.py*
%changelog
+* Tue Dec 23 2008 Zdenek Prikryl <zprikryl at redhat.com> - 0.6.8-2
+- Fixed wrong total disk counts (#476935)
+- Fixed dbus module patch again
+
* Tue Sep 16 2008 Zdenek Prikryl <zprikryl at redhat.com> - 0.6.8-1
- Updated to 0.6.8
- Fixed dbus module patch
More information about the fedora-extras-commits
mailing list