aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2015-05-04 09:59:36 +0200
committerFlorian Bruhin <git@the-compiler.org>2015-05-04 09:59:36 +0200
commit55dc505616f9156760b44f47ab928ab793b8892b (patch)
tree1b93c269e60c09c83624914c290aa3211c079c5c
parent46f590a6fd5a37ba057fbe622462ec63830059f2 (diff)
downloadqt-debug-pkgbuild-55dc505616f9156760b44f47ab928ab793b8892b.tar.gz
qt-debug-pkgbuild-55dc505616f9156760b44f47ab928ab793b8892b.zip
Update Qt to arch -4
-rw-r--r--qt5/PKGBUILD12
-rw-r--r--qt5/qlockfile-deadlock.patch112
2 files changed, 120 insertions, 4 deletions
diff --git a/qt5/PKGBUILD b/qt5/PKGBUILD
index 30c3093..e1f0aae 100644
--- a/qt5/PKGBUILD
+++ b/qt5/PKGBUILD
@@ -1,4 +1,4 @@
-# $Id: PKGBUILD 235956 2015-04-09 18:55:40Z heftig $
+# $Id: PKGBUILD 238307 2015-05-01 03:05:41Z fyan $
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Andrea Scarpino <andrea@archlinux.org>
@@ -28,7 +28,7 @@ pkgname=('qt5-base'
'qt5-x11extras'
'qt5-xmlpatterns')
pkgver=5.4.1
-pkgrel=3
+pkgrel=4
arch=('i686' 'x86_64')
url='http://qt-project.org/'
license=('GPL3' 'LGPL' 'FDL' 'custom')
@@ -42,13 +42,14 @@ makedepends=('libxcb' 'xcb-proto' 'xcb-util' 'xcb-util-image' 'xcb-util-wm' 'xcb
groups=('qt' 'qt5')
_pkgfqn="qt-everywhere-opensource-src-${pkgver}"
source=("http://download.qt-project.org/official_releases/qt/${pkgver%.*}/${pkgver}/single/${_pkgfqn}.tar.xz"
- 'assistant.desktop' 'designer.desktop' 'linguist.desktop' 'qdbusviewer.desktop' 'glib-2.43.patch')
+ 'assistant.desktop' 'designer.desktop' 'linguist.desktop' 'qdbusviewer.desktop' 'glib-2.43.patch' 'qlockfile-deadlock.patch')
md5sums=('7afb5f9235d8d42b5b6e832442a32a5d'
'b2897dd6a2967bccf8f10e397aafee55'
'76e150b20178d2d43801f7367232e5f7'
'188da8f4c87316e730ebf1c6217bf5a0'
'322b419b16c75d4de0ee7ad0a246caa1'
- 'bf756a3061e1b30b28df85dcf0c90df3')
+ 'bf756a3061e1b30b28df85dcf0c90df3'
+ '30d219401f77e536d215addc420b634c')
prepare() {
cd ${_pkgfqn}
@@ -56,6 +57,9 @@ prepare() {
# for glib 2.43+ https://bugreports.qt.io/browse/QTBUG-44714
(cd qtwebkit; patch -p1 -i "$srcdir/glib-2.43.patch")
+ # https://bugs.kde.org/show_bug.cgi?id=345901
+ (cd qtbase; patch -p1 -i "$srcdir/qlockfile-deadlock.patch")
+
# Build qmake using Arch {C,LD}FLAGS
# This also sets default {C,CXX,LD}FLAGS for projects built using qmake
sed -i -e "s|^\(QMAKE_CFLAGS_RELEASE.*\)|\1 ${CFLAGS}|" \
diff --git a/qt5/qlockfile-deadlock.patch b/qt5/qlockfile-deadlock.patch
new file mode 100644
index 0000000..5c59127
--- /dev/null
+++ b/qt5/qlockfile-deadlock.patch
@@ -0,0 +1,112 @@
+From f58e882b7594c59b6050d3c87562fcf836d10f60 Mon Sep 17 00:00:00 2001
+From: Olivier Goffart <ogoffart@woboq.com>
+Date: Tue, 14 Apr 2015 10:58:26 +0200
+Subject: QLockFile: fix deadlock when the lock file is corrupted
+
+[ChangeLog][QtCore][QLockFile] Fixed a deadlock when the lock file
+is corrupted.
+
+Task-number: QTBUG-44771
+Change-Id: Ic490b09d70ff1cc1733b64949889a73720b2d0f3
+Reviewed-by: David Faure <david.faure@kdab.com>
+---
+ src/corelib/io/qlockfile_unix.cpp | 10 +++++-----
+ src/corelib/io/qlockfile_win.cpp | 22 +++++++++++-----------
+ tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp | 17 +++++++++++++++++
+ 3 files changed, 33 insertions(+), 16 deletions(-)
+
+diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp
+index bf1015a..dc9f8f7 100644
+--- a/src/corelib/io/qlockfile_unix.cpp
++++ b/src/corelib/io/qlockfile_unix.cpp
+@@ -181,11 +181,11 @@ bool QLockFilePrivate::isApparentlyStale() const
+ {
+ qint64 pid;
+ QString hostname, appname;
+- if (!getLockInfo(&pid, &hostname, &appname))
+- return false;
+- if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
+- if (::kill(pid, 0) == -1 && errno == ESRCH)
+- return true; // PID doesn't exist anymore
++ if (getLockInfo(&pid, &hostname, &appname)) {
++ if (hostname.isEmpty() || hostname == QString::fromLocal8Bit(localHostName())) {
++ if (::kill(pid, 0) == -1 && errno == ESRCH)
++ return true; // PID doesn't exist anymore
++ }
+ }
+ const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime());
+ return staleLockTime > 0 && age > staleLockTime;
+diff --git a/src/corelib/io/qlockfile_win.cpp b/src/corelib/io/qlockfile_win.cpp
+index f9f2909..3587c7b 100644
+--- a/src/corelib/io/qlockfile_win.cpp
++++ b/src/corelib/io/qlockfile_win.cpp
+@@ -115,21 +115,21 @@ bool QLockFilePrivate::isApparentlyStale() const
+ {
+ qint64 pid;
+ QString hostname, appname;
+- if (!getLockInfo(&pid, &hostname, &appname))
+- return false;
+
+ // On WinRT there seems to be no way of obtaining information about other
+ // processes due to sandboxing
+ #ifndef Q_OS_WINRT
+- if (hostname == QString::fromLocal8Bit(localHostName())) {
+- HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
+- if (!procHandle)
+- return true;
+- // We got a handle but check if process is still alive
+- DWORD dwR = ::WaitForSingleObject(procHandle, 0);
+- ::CloseHandle(procHandle);
+- if (dwR == WAIT_TIMEOUT)
+- return true;
++ if (getLockInfo(&pid, &hostname, &appname)) {
++ if (hostname == QString::fromLocal8Bit(localHostName())) {
++ HANDLE procHandle = ::OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid);
++ if (!procHandle)
++ return true;
++ // We got a handle but check if process is still alive
++ DWORD dwR = ::WaitForSingleObject(procHandle, 0);
++ ::CloseHandle(procHandle);
++ if (dwR == WAIT_TIMEOUT)
++ return true;
++ }
+ }
+ #endif // !Q_OS_WINRT
+ const qint64 age = QFileInfo(fileName).lastModified().msecsTo(QDateTime::currentDateTime());
+diff --git a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+index 77bef94..12bea67 100644
+--- a/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
++++ b/tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp
+@@ -58,6 +58,7 @@ private slots:
+ void staleLongLockFromBusyProcess();
+ void staleLockRace();
+ void noPermissions();
++ void corruptedLockFile();
+
+ public:
+ QString m_helperApp;
+@@ -415,5 +416,21 @@ void tst_QLockFile::noPermissions()
+ QCOMPARE(int(lockFile.error()), int(QLockFile::PermissionError));
+ }
+
++void tst_QLockFile::corruptedLockFile()
++{
++ const QString fileName = dir.path() + "/corruptedLockFile";
++
++ {
++ // Create a empty file. Typically the result of a computer crash or hard disk full.
++ QFile file(fileName);
++ QVERIFY(file.open(QFile::WriteOnly));
++ }
++
++ QLockFile secondLock(fileName);
++ secondLock.setStaleLockTime(100);
++ QVERIFY(secondLock.tryLock(10000));
++ QCOMPARE(int(secondLock.error()), int(QLockFile::NoError));
++}
++
+ QTEST_MAIN(tst_QLockFile)
+ #include "tst_qlockfile.moc"
+--
+cgit v0.11.0
+