[arch-commits] Commit in kdelibs/trunk (PKGBUILD fix-kdirwatch-with-linux3.patch)

Andrea Scarpino andrea at archlinux.org
Mon Sep 12 15:52:44 UTC 2011


    Date: Monday, September 12, 2011 @ 11:52:44
  Author: andrea
Revision: 137924

Fix KDirWatch with Linux 3.0 and 3.1 (FS#25967)

Added:
  kdelibs/trunk/fix-kdirwatch-with-linux3.patch
Modified:
  kdelibs/trunk/PKGBUILD

---------------------------------+
 PKGBUILD                        |   27 ++++++++++--------
 fix-kdirwatch-with-linux3.patch |   56 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 11 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-09-12 13:17:05 UTC (rev 137923)
+++ PKGBUILD	2011-09-12 15:52:44 UTC (rev 137924)
@@ -4,7 +4,7 @@
 
 pkgname=kdelibs
 pkgver=4.7.1
-pkgrel=1
+pkgrel=2
 pkgdesc="KDE Core Libraries"
 arch=('i686' 'x86_64')
 url='http://www.kde.org'
@@ -19,20 +19,25 @@
 replaces=('kdelibs-experimental')
 install='kdelibs.install'
 source=("http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2"
-        'kde-applications-menu.patch' 'archlinux-menu.patch')
+        'kde-applications-menu.patch' 'archlinux-menu.patch'
+        'fix-kdirwatch-with-linux3.patch')
 sha1sums=('661cc56f199b7250bd825cc0e85ff442b85171e2'
           '86ee8c8660f19de8141ac99cd6943964d97a1ed7'
-          '63a850ab4196b9d06934f2b4a13acd9f7739bc67')
+          '63a850ab4196b9d06934f2b4a13acd9f7739bc67'
+          '54e6cbd7a8c4f9df947f18692512ca618c824c43')
 
 build() {
-       cd ${srcdir}/${pkgname}-${pkgver}
+       cd "${srcdir}"/${pkgname}-${pkgver}
 
        # avoid file conflict with gnome-menu
-       patch -p1 -i $srcdir/kde-applications-menu.patch
+       patch -p1 -i "${srcdir}"/kde-applications-menu.patch
        # add Archlinux menu entry
-       patch -p1 -i $srcdir/archlinux-menu.patch
+       patch -p1 -i "${srcdir}"/archlinux-menu.patch
 
-       cd ${srcdir}
+       # Already fixed upstream
+       patch -p1 -i "${srcdir}"/fix-kdirwatch-with-linux3.patch
+
+       cd "${srcdir}"
        mkdir build
        cd build
        cmake ../${pkgname}-${pkgver} \
@@ -48,11 +53,11 @@
 }
 
 package() {
-       cd $srcdir/build
-       make DESTDIR=$pkgdir install
+       cd "${srcdir}"/build
+       make DESTDIR="${pkgdir}" install
 
        # cert bundle seems to be hardcoded
        # link it to the one from ca-certificates
-       rm -f $pkgdir/usr/share/apps/kssl/ca-bundle.crt
-       ln -sf /etc/ssl/certs/ca-certificates.crt $pkgdir/usr/share/apps/kssl/ca-bundle.crt
+       rm -f "${pkgdir}"/usr/share/apps/kssl/ca-bundle.crt
+       ln -sf /etc/ssl/certs/ca-certificates.crt "${pkgdir}"/usr/share/apps/kssl/ca-bundle.crt
 }

Added: fix-kdirwatch-with-linux3.patch
===================================================================
--- fix-kdirwatch-with-linux3.patch	                        (rev 0)
+++ fix-kdirwatch-with-linux3.patch	2011-09-12 15:52:44 UTC (rev 137924)
@@ -0,0 +1,56 @@
+From: Alex Fiestas <afiestas at kde.org>
+Date: Fri, 09 Sep 2011 16:54:23 +0000
+Subject: Fix KDirWatch when using Kernel 3.0
+X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=7df5a79fb9f09e4a4a80cd541cc478b5fa6df00f
+---
+Fix KDirWatch when using Kernel 3.0
+
+To know INotify is available in the kernel we are checking for a
+kernel newer than 2.6.14, that's all allright but the problem is
+that the Kernel version format has changed  and now we can't be sure
+that it is going to be formed by 3 numbers.
+Basically we where checking for:
+
+%d.%d.%d and now it can be %d.%d as it is with 3.0
+
+This patch what does is check if the kernel is 2.6, if it is then
+it proceed with the version checking.
+
+CCMAIL: dfaure at kde.org
+---
+
+
+--- 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);
+




More information about the arch-commits mailing list