From 85e01770d70b90862e5f3e5012165b6a572d991d Mon Sep 17 00:00:00 2001 From: Manuel Date: Sun, 11 Sep 2011 10:19:26 +0000 Subject: [PATCH] Fix a bug with Kernel<3, fixes plasma changing issue --- kdelibs/PKGBUILD | 13 ++++++++----- kdelibs/fix-kdirwatch.patch | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 kdelibs/fix-kdirwatch.patch diff --git a/kdelibs/PKGBUILD b/kdelibs/PKGBUILD index 49aeea2b5..f157d4c7e 100644 --- a/kdelibs/PKGBUILD +++ b/kdelibs/PKGBUILD @@ -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') diff --git a/kdelibs/fix-kdirwatch.patch b/kdelibs/fix-kdirwatch.patch new file mode 100644 index 000000000..a70b9d7dd --- /dev/null +++ b/kdelibs/fix-kdirwatch.patch @@ -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)