Fix a bug with Kernel<3, fixes plasma changing issue

This commit is contained in:
Manuel 2011-09-11 10:19:26 +00:00
parent c26a0c275f
commit 85e01770d7
2 changed files with 41 additions and 5 deletions

View File

@ -17,7 +17,7 @@ pkgname=('kdelibs' 'kdelibs-doc')
arch=('i686' 'x86_64')
pkgver=${_kdever}
pkgrel=1
pkgrel=2
pkgdesc="split package"
url="http://www.kde.org"
@ -37,12 +37,14 @@ replaces=('arts' 'kdelibs-experimental')
source=($_mirror/${_origname}-$_kdever.tar.bz2
01_chakra_tag.patch
02_kde_applications_menu.patch
03_chakra_menu.patch)
03_chakra_menu.patch
fix-kdirwatch.patch)
md5sums=(`grep ${_origname}-$_kdever.tar.bz2 ../kde-sc.md5 | cut -d" " -f1`
'40ba51f0c50ced94dfffe667ec856950' # 01_chakra_tag.patch
'e94450ba5430ea9c1e33bad9ae38ca2d' # 02_kde_applications_menu.patch
'53b85403e4dd8f9146933c52ca23243e') # 03_chakra_menu.patch
'53b85403e4dd8f9146933c52ca23243e' # 03_chakra_menu.patch
'd8219059f24fa060d975dd008a3a5b05') # fix-kdirwatch.patch
#
# build function
@ -58,7 +60,8 @@ build()
patch -Np1 -i ${srcdir}/03_chakra_menu.patch || return 1
# fixes
# msg "applying fixes ..."
msg "applying fixes ..."
patch -Np1 -i ${srcdir}/fix-kdirwatch.patch || return 1
cd ..
@ -97,7 +100,7 @@ package_kdelibs()
'avahi : Service discovery on your local network'
'aspell : Spell checking'
'hspell : Hebrew spell checking'
'hal : Legacy hardware support')
'hal : Optional hardware abstraction layer for Solid')
provides=("${_origname}=${_kdever}")
replaces=('kdelibs-experimental')

View File

@ -0,0 +1,33 @@
--- a/kdecore/io/kdirwatch.cpp
+++ b/kdecore/io/kdirwatch.cpp
@@ -210,16 +210,24 @@ KDirWatchPrivate::KDirWatchPrivate()
{
struct utsname uts;
int major, minor, patch;
- if (uname(&uts) < 0)
- supports_inotify = false; // *shrug*
- else if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3)
- supports_inotify = false; // *shrug*
- else if( major * 1000000 + minor * 1000 + patch < 2006014 ) { // <2.6.14
- kDebug(7001) << "Can't use INotify, Linux kernel too old";
+ if (uname(&uts) < 0) {
supports_inotify = false;
+ kDebug(7001) << "Unable to get uname";
+ } else if (sscanf(uts.release, "%d.%d", &major, &minor) != 2) {
+ supports_inotify = false;
+ kDebug(7001) << "The version is malformed: " << uts.release;
+ } else if(major == 2 && minor == 6) { // If it is 2.6 check further...
+ if (sscanf(uts.release, "%d.%d.%d", &major, &minor, &patch) != 3) {
+ supports_inotify = false;
+ kDebug() << "Detected 2.6 kernel but can't know more: " << uts.release;
+ } else if (major * 1000000 + minor * 1000 + patch < 2006014 ){
+ supports_inotify = false;
+ kDebug(7001) << "Can't use INotify, Linux kernel too old " << uts.release;
+ }
}
}
+ kDebug() << "INotify available: " << supports_inotify;
if ( supports_inotify ) {
availableMethods << "INotify";
fcntl(m_inotify_fd, F_SETFD, FD_CLOEXEC)