summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Yamin <plasmaroo@gentoo.org>2003-08-28 09:16:00 +0000
committerTim Yamin <plasmaroo@gentoo.org>2003-08-28 09:16:00 +0000
commit3aa40033d03cf22bb4b887d8a87196553c4766e7 (patch)
tree71fc45e52c405eead931192b754e6ba1c9413ca5 /app-misc
parentRemoving 4.3.99.8 (diff)
downloadgentoo-2-3aa40033d03cf22bb4b887d8a87196553c4766e7.tar.gz
gentoo-2-3aa40033d03cf22bb4b887d8a87196553c4766e7.tar.bz2
gentoo-2-3aa40033d03cf22bb4b887d8a87196553c4766e7.zip
Kernel 2.5/2.6 compatibility patch
Diffstat (limited to 'app-misc')
-rw-r--r--app-misc/xosview/ChangeLog7
-rw-r--r--app-misc/xosview/Manifest5
-rw-r--r--app-misc/xosview/files/xosview-kernel-2.5+.diff139
-rw-r--r--app-misc/xosview/xosview-1.8.0.ebuild9
4 files changed, 156 insertions, 4 deletions
diff --git a/app-misc/xosview/ChangeLog b/app-misc/xosview/ChangeLog
index 5fd8605515b8..7cc1de40d977 100644
--- a/app-misc/xosview/ChangeLog
+++ b/app-misc/xosview/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for app-misc/xosview
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/xosview/ChangeLog,v 1.4 2003/02/12 05:11:13 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/xosview/ChangeLog,v 1.5 2003/08/28 09:15:43 plasmaroo Exp $
+
+xosview-1.8.0 (28 Aug 2003)
+
+ 28 Aug 2003; Tim Yamin <plasmaroo@gentoo.org> :
+ Added kernel 2.5/2.6 support through a patch [Bug 24342]
*xosview-1.8.0 (12 Jul 2002)
diff --git a/app-misc/xosview/Manifest b/app-misc/xosview/Manifest
index 800d5c1c28e9..7749e3b8762e 100644
--- a/app-misc/xosview/Manifest
+++ b/app-misc/xosview/Manifest
@@ -1,4 +1,5 @@
-MD5 3d588ac77a53e330559c55da387c800e ChangeLog 1070
-MD5 31f6f8ddc069d2f3637f56a1d153604e xosview-1.8.0.ebuild 741
+MD5 e1329983ee98731d10a635169b4dd69c ChangeLog 1212
+MD5 cc28ccb2e23917ad64856b69e45af3f1 xosview-1.8.0.ebuild 1020
MD5 c6579bb720046ebff01f1b2a8c3d62fa files/digest-xosview-1.8.0 65
+MD5 332f3ebb3cdfed0ed20ecbf6c79a424a files/xosview-kernel-2.5+.diff 3771
MD5 b96b1e80221cab3e2cf8a6d5081b6440 files/xosview-1.8.0-ppc.diff 3488
diff --git a/app-misc/xosview/files/xosview-kernel-2.5+.diff b/app-misc/xosview/files/xosview-kernel-2.5+.diff
new file mode 100644
index 000000000000..42df1cbde10c
--- /dev/null
+++ b/app-misc/xosview/files/xosview-kernel-2.5+.diff
@@ -0,0 +1,139 @@
+diff -u -r xosview-1.8.0/linux/diskmeter.cc xosview-1.8.0-kai/linux/diskmeter.cc
+--- xosview-1.8.0/linux/diskmeter.cc 1999-11-07 21:30:58.000000000 +0100
++++ xosview-1.8.0-kai/linux/diskmeter.cc 2003-02-27 03:50:54.000000000 +0100
+@@ -12,6 +12,8 @@
+ #include <stdlib.h>
+
+ static const char STATFILENAME[] = "/proc/stat";
++// kernel >= 2.5 support
++static const char VMSTATFILENAME[] = "/proc/vmstat";
+
+ DiskMeter::DiskMeter( XOSView *parent, float max ) : FieldMeterGraph(
+ parent, 3, "DISK", "READ/WRITE/IDLE")
+@@ -50,25 +52,54 @@
+ IntervalTimerStop();
+ total_ = maxspeed_;
+ char buf[1024];
++ unsigned char new_kernel = 1;
++ ifstream vmstats( VMSTATFILENAME );
+ ifstream stats( STATFILENAME );
+
+- if ( !stats )
++ if ( new_kernel && !vmstats )
+ {
+- cerr <<"Can not open file : " <<STATFILENAME <<endl;
+- exit( 1 );
++ new_kernel = 0;
+ }
+
+- // Find the line with 'page'
+- stats >> buf;
+- while (strncmp(buf, "page", 9))
++ if ( !new_kernel && !stats )
+ {
+- stats.ignore(1024, '\n');
+- stats >> buf;
++ cerr <<"Can not open file : " <<STATFILENAME <<endl;
++ exit( 1 );
+ }
+
+- // read values
+ unsigned long one, two;
+- stats >> one >> two;
++
++ if (new_kernel) {
++ vmstats >> buf;
++ // kernel >= 2.5
++ while (!vmstats.eof() && strncmp(buf, "pgpgin", 7))
++ {
++ vmstats.ignore(1024, '\n');
++ vmstats >> buf;
++ }
++
++ // read first value
++ vmstats >> one;
++
++ while (!vmstats.eof() && strncmp(buf, "pgpgout", 7))
++ {
++ vmstats.ignore(1024, '\n');
++ vmstats >> buf;
++ }
++
++ // read second value
++ vmstats >> two;
++ } else {
++ stats >> buf;
++ while (strncmp(buf, "page", 9))
++ {
++ stats.ignore(1024, '\n');
++ stats >> buf;
++ }
++
++ // read values
++ stats >> one >> two;
++ }
+
+ // assume each "unit" is 1k.
+ // This is true for ext2, but seems to be 512 bytes
+Only in xosview-1.8.0/linux/memstat: Makefile
+diff -u -r xosview-1.8.0/linux/pagemeter.cc xosview-1.8.0-kai/linux/pagemeter.cc
+--- xosview-1.8.0/linux/pagemeter.cc 1999-02-24 23:28:18.000000000 +0100
++++ xosview-1.8.0-kai/linux/pagemeter.cc 2003-02-27 03:02:17.000000000 +0100
+@@ -13,6 +13,8 @@
+
+
+ static const char STATFILENAME[] = "/proc/stat";
++// kernel >= 2.5 support
++static const char VMSTATFILENAME[] = "/proc/vmstat";
+
+
+ PageMeter::PageMeter( XOSView *parent, float max )
+@@ -49,18 +51,41 @@
+ void PageMeter::getpageinfo( void ){
+ total_ = 0;
+ char buf[1024];
++ unsigned char new_kernel = 1;
++
++ ifstream vmstats( VMSTATFILENAME );
+ ifstream stats( STATFILENAME );
+
+- if ( !stats ){
+- cerr <<"Cannot open file : " <<STATFILENAME <<endl;
+- exit( 1 );
++ if ( new_kernel && !vmstats ){
++ new_kernel = 0;
++ }
++
++ if ( !new_kernel && !stats ) {
++ cerr <<"Cannot open file : " <<STATFILENAME <<endl;
++ exit( 1 );
+ }
+
+- do {
+- stats >>buf;
+- } while (strncasecmp(buf, "swap", 5));
++ if ( new_kernel ) {
++ // kernel >= 2.5
++ do {
++ vmstats >>buf;
++ } while (!vmstats.eof() && strncasecmp(buf, "pswpin", 7));
+
+- stats >>pageinfo_[pageindex_][0] >>pageinfo_[pageindex_][1];
++ vmstats >>pageinfo_[pageindex_][0];
++
++ do {
++ vmstats >>buf;
++ } while (!vmstats.eof() && strncasecmp(buf, "pswpout", 8)) ;
++
++ vmstats >>pageinfo_[pageindex_][1];
++ } else {
++ // kernel < 2.5
++ do {
++ stats >>buf;
++ } while (strncasecmp(buf, "swap", 5));
++
++ stats >>pageinfo_[pageindex_][0] >>pageinfo_[pageindex_][1];
++ }
+
+ int oldindex = (pageindex_+1)%2;
+
diff --git a/app-misc/xosview/xosview-1.8.0.ebuild b/app-misc/xosview/xosview-1.8.0.ebuild
index e941f7b9e049..11d22f7091ad 100644
--- a/app-misc/xosview/xosview-1.8.0.ebuild
+++ b/app-misc/xosview/xosview-1.8.0.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-misc/xosview/xosview-1.8.0.ebuild,v 1.6 2003/02/13 09:13:46 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-misc/xosview/xosview-1.8.0.ebuild,v 1.7 2003/08/28 09:15:43 plasmaroo Exp $
DESCRIPTION="X11 operating system viewer"
SRC_URI="http://www.ibiblio.org/pub/Linux/system/status/xstatus/${P}.tar.gz"
@@ -13,6 +13,13 @@ KEYWORDS="x86 ppc"
DEPEND="virtual/x11"
src_compile() {
+
+ if [ `uname -r | cut -d. -f1` -eq 2 -a `uname -r | cut -d. -f2` -ge 5 -a `uname -r | cut -d. -f2` -le 6 ] ; then
+ einfo "You are running `uname -r`"
+ einfo "Using 2.5/2.6 kernel compatibility patch"
+ epatch ${FILESDIR}/xosview-kernel-2.5+.diff || die "patch failed"
+ fi
+
if [ ${ARCH} = "ppc" ] ; then
patch -p0 < ${FILESDIR}/xosview-1.8.0-ppc.diff || die "patch failed"
fi