[arch-commits] Commit in kdelibs/trunk (PKGBUILD fix-vlc-hangs.patch)

Andrea Scarpino andrea at archlinux.org
Thu Feb 10 06:40:17 UTC 2011


    Date: Thursday, February 10, 2011 @ 01:40:16
  Author: andrea
Revision: 109475

upgpkg: kdelibs 4.6.0-3
Fix VLC hangs on open file dialog (FS#22727)

Added:
  kdelibs/trunk/fix-vlc-hangs.patch
Modified:
  kdelibs/trunk/PKGBUILD

---------------------+
 PKGBUILD            |    9 ++-
 fix-vlc-hangs.patch |  118 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 124 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2011-02-10 00:14:25 UTC (rev 109474)
+++ PKGBUILD	2011-02-10 06:40:16 UTC (rev 109475)
@@ -4,7 +4,7 @@
 
 pkgname=kdelibs
 pkgver=4.6.0
-pkgrel=2
+pkgrel=3
 pkgdesc="KDE Core Libraries"
 arch=('i686' 'x86_64')
 url='http://www.kde.org'
@@ -20,12 +20,14 @@
 install='kdelibs.install'
 source=("http://download.kde.org/stable/${pkgver}/src/${pkgname}-${pkgver}.tar.bz2"
         'kde-applications-menu.patch' 'archlinux-menu.patch' 'abs-syntax-highlight.patch'
-        'fix-crash-in-plasma.patch')
+        'fix-crash-in-plasma.patch'
+        'fix-vlc-hangs.patch')
 sha1sums=('6ea3fc69f98fa91c5159ccd743d4d548e801c7bc'
           '86ee8c8660f19de8141ac99cd6943964d97a1ed7'
           '63a850ab4196b9d06934f2b4a13acd9f7739bc67'
           'd994f262356af5b9e4e9619646e471bd98c91efb'
-          '270f24d9682c32c9f69b3e6e13696888724c5169')
+          '270f24d9682c32c9f69b3e6e13696888724c5169'
+          'b4cefad7e1aec2a9d3c52c5c633566aad3b08d1d')
 
 build() {
        cd ${srcdir}/${pkgname}-${pkgver}
@@ -39,6 +41,7 @@
 
        # Already fixed upstream
        patch -Np1 -i ${srcdir}/fix-crash-in-plasma.patch
+       patch -Np1 -i ${srcdir}/fix-vlc-hangs.patch
 
        cd ${srcdir}
        mkdir build

Added: fix-vlc-hangs.patch
===================================================================
--- fix-vlc-hangs.patch	                        (rev 0)
+++ fix-vlc-hangs.patch	2011-02-10 06:40:16 UTC (rev 109475)
@@ -0,0 +1,118 @@
+commit 7ca7e81303c50769e286897be0afe0793dabdf52
+Author: Dawit Alemayehu <adawit at kde.org>
+Date:   Fri Feb 4 18:29:51 2011 -0500
+
+    Workaround for the hang (freeze) when opening VLC's file dialog under KDE.
+    See http://git.reviewboard.kde.org/r/100539/ for the details.
+    
+    BUG:260719
+    REVIEW:100539
+
+diff --git a/kdecore/services/kmimetyperepository.cpp b/kdecore/services/kmimetyperepository.cpp
+index 9f4c3ca..39e6a61 100644
+--- a/kdecore/services/kmimetyperepository.cpp
++++ b/kdecore/services/kmimetyperepository.cpp
+@@ -683,29 +683,84 @@ bool KMimeTypeRepository::useFavIcons()
+     return m_useFavIcons;
+ }
+ 
+-int KMimeTypeRepository::sharedMimeInfoVersion()
++static void addPlatformSpecificPkgConfigPath(QStringList& paths)
+ {
+-    m_mutex.lockForWrite();
+-    if (m_sharedMimeInfoVersion == 0) {
+-        QProcess smi;
+-        const QString umd = KStandardDirs::findExe(QString::fromLatin1("update-mime-database"));
+-        if (umd.isEmpty()) {
+-            kWarning() << "update-mime-database not found!";
+-            m_sharedMimeInfoVersion = -1;
+-        } else {
+-            smi.start(umd, QStringList() << QString::fromLatin1("-v"));
+-            smi.waitForStarted();
+-            smi.waitForFinished();
+-            const QString out = QString::fromLocal8Bit(smi.readAllStandardError());
+-            QRegExp versionRe(QString::fromLatin1("update-mime-database \\(shared-mime-info\\) (\\d+)\\.(\\d+)(\\.(\\d+))?"));
+-            if (versionRe.indexIn(out) > -1) {
+-                m_sharedMimeInfoVersion = KDE_MAKE_VERSION(versionRe.cap(1).toInt(), versionRe.cap(2).toInt(), versionRe.cap(4).toInt());
+-            } else {
+-                kWarning() << "Unexpected version scheme from update-mime-database -v: got" << out;
+-                m_sharedMimeInfoVersion = -1;
++#if defined (Q_OS_FREEBSD)
++    paths << QLatin1String("/usr/local/libdata/pkgconfig"); // FreeBSD
++#elif defined(Q_OS_OPENBSD) || defined(Q_OS_NETBSD) || defined(Q_OS_SOLARIS)
++    paths << QLatin1String("/usr/local/lib/pkgconfig"); // {Net,Open}BSD/OpenSolaris
++#elif defined (Q_OS_UNIX)
++    paths << QLatin1String("/usr/share/pkgconfig"); // Linux and all other unix
++#endif
++}
++
++static int mimeDataBaseVersion()
++{
++    // TODO: Remove the #idef'ed code below once the issue is fixed either
++    // in QProcess or the shared-mime-info utility provides its version number.
++#ifdef Q_OS_UNIX
++    // Try to read the version number from the shared-mime-info.pc file
++    QStringList paths;
++    const QByteArray pkgConfigPath = qgetenv("PKG_CONFIG_PATH");
++    if (!pkgConfigPath.isEmpty()) {
++        paths << QFile::decodeName(pkgConfigPath).split(QLatin1Char(':'), QString::SkipEmptyParts);
++    }
++
++    // Add platform specific hard-coded default paths to the list...
++    addPlatformSpecificPkgConfigPath(paths);
++
++    Q_FOREACH(const QString& path, paths) {
++        const QString fileName = path + QLatin1String("/shared-mime-info.pc");
++        if (!QFile::exists(fileName)) {
++            continue;
++        }
++
++        QFile file (fileName);
++        if (!file.open(QIODevice::ReadOnly)) {
++            break;
++        }
++
++        while (!file.atEnd()) {
++            const QByteArray line = file.readLine().simplified();
++            if (!line.startsWith("Version")) {
++                continue;
++            }
++            QRegExp versionRe(QString::fromLatin1("Version: (\\d+)\\.(\\d+)(\\.(\\d+))?"));
++            if (versionRe.indexIn(QString::fromLocal8Bit(line)) > -1) {
++                return KDE_MAKE_VERSION(versionRe.cap(1).toInt(), versionRe.cap(2).toInt(), versionRe.cap(4).toInt());
+             }
+         }
+     }
++#endif
++
++    // Execute "update-mime-database -v" to determine version number.
++    // NOTE: On *nix, the code below is known to cause freezes/hangs in apps
++    // that block signals. See https://bugs.kde.org/show_bug.cgi?id=260719.
++    const QString umd = KStandardDirs::findExe(QString::fromLatin1("update-mime-database"));
++    if (umd.isEmpty()) {
++        kWarning(servicesDebugArea()) << "update-mime-database not found!";
++        return -1;
++    }
++
++    QProcess smi;
++    smi.start(umd, QStringList() << QString::fromLatin1("-v"));
++    smi.waitForStarted();
++    smi.waitForFinished();
++    const QString out = QString::fromLocal8Bit(smi.readAllStandardError());
++    QRegExp versionRe(QString::fromLatin1("update-mime-database \\(shared-mime-info\\) (\\d+)\\.(\\d+)(\\.(\\d+))?"));
++    if (versionRe.indexIn(out) > -1) {
++        return KDE_MAKE_VERSION(versionRe.cap(1).toInt(), versionRe.cap(2).toInt(), versionRe.cap(4).toInt());
++    }
++
++    kWarning(servicesDebugArea()) << "Unexpected version scheme from update-mime-database -v: got" << out;
++    return -1;
++}
++
++int KMimeTypeRepository::sharedMimeInfoVersion()
++{
++    m_mutex.lockForWrite();
++    if (m_sharedMimeInfoVersion == 0)
++        m_sharedMimeInfoVersion = mimeDataBaseVersion();
+     m_mutex.unlock();
+     return m_sharedMimeInfoVersion;
+ }




More information about the arch-commits mailing list