git » kservice.git » commit f29d190

Fix kbuildsycoca loop (FS#46320)

author Antonio Rojas
2015-09-19 09:04:43 UTC
committer Antonio Rojas
2015-09-19 09:04:43 UTC
parent 3a119479d7b1be80fc45c34f3e3ed3888591e1be

Fix kbuildsycoca loop (FS#46320)

PKGBUILD +8 -3
timestamp.patch +27 -0

diff --git a/PKGBUILD b/PKGBUILD
index 687630a..dbadb5b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
 
 pkgname=kservice
 pkgver=5.14.2
-pkgrel=1
+pkgrel=2
 pkgdesc='Advanced plugin and service introspection'
 arch=('i686' 'x86_64')
 url='https://projects.kde.org/projects/frameworks/kservice'
@@ -11,11 +11,16 @@ license=('LGPL')
 depends=('ki18n' 'kconfig' 'kcrash' 'kdbusaddons')
 makedepends=('extra-cmake-modules' 'kdoctools' 'python')
 groups=('kf5')
-source=("http://download.kde.org/stable/frameworks/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz")
-md5sums=('eca764e18afbcef5496183c96c613c91')
+source=("http://download.kde.org/stable/frameworks/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz" timestamp.patch)
+md5sums=('eca764e18afbcef5496183c96c613c91'
+         'b77b056fb6bb5adba72702fddf0feff8')
 
 prepare() {
   mkdir -p build
+
+# Fix kbuildsycoca infinite loop https://bugs.kde.org/show_bug.cgi?id=352854
+  cd $pkgname-$pkgver
+  patch -p1 -i ../timestamp.patch
 }
 
 build() {
diff --git a/timestamp.patch b/timestamp.patch
new file mode 100644
index 0000000..89af09b
--- /dev/null
+++ b/timestamp.patch
@@ -0,0 +1,27 @@
+diff --git a/src/kbuildsycoca/kbuildsycoca.cpp b/src/kbuildsycoca/kbuildsycoca.cpp
+index 827ac96..6d34235 100644
+--- a/src/kbuildsycoca/kbuildsycoca.cpp
++++ b/src/kbuildsycoca/kbuildsycoca.cpp
+@@ -515,7 +515,7 @@ void KBuildSycoca::save(QDataStream *str)
+     (*str) << qint32(0); // No more factories.
+     // Write XDG_DATA_DIRS
+     (*str) << QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).join(QString(QLatin1Char(':')));
+-    (*str) << (quint32)newTimestamp / 1000; // TODO just newTimestamp when using a new filename
++    (*str) << (quint32)(newTimestamp / 1000); // TODO just newTimestamp when using a new filename
+     (*str) << QLocale().bcp47Name();
+     // This makes it possible to trigger a ksycoca update for all users (KIOSK feature)
+     (*str) << calcResourceHash(QStringLiteral("kservices5"), QStringLiteral("update_ksycoca"));
+diff --git a/src/sycoca/ksycoca.cpp b/src/sycoca/ksycoca.cpp
+index 81c875d..44984fa 100644
+--- a/src/sycoca/ksycoca.cpp
++++ b/src/sycoca/ksycoca.cpp
+@@ -505,7 +505,7 @@ KSycoca::KSycocaHeader KSycocaPrivate::readSycocaHeader()
+     KSycocaUtilsPrivate::read(*str, header.prefixes);
+     quint32 oldTimeStamp; // compat code --> TODO remove this when switching to a different fileName
+     *str >> oldTimeStamp;
+-    header.timeStamp = oldTimeStamp * 1000;
++    header.timeStamp = static_cast<quint64>(oldTimeStamp) * 1000;
+     KSycocaUtilsPrivate::read(*str, header.language);
+     *str >> header.updateSignature;
+     KSycocaUtilsPrivate::read(*str, allResourceDirs);
+