From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9AF821382C5 for ; Wed, 6 Jan 2021 21:08:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3F88FE085A; Wed, 6 Jan 2021 21:08:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 15BB9E085A for ; Wed, 6 Jan 2021 21:08:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C99E0340F6C for ; Wed, 6 Jan 2021 21:07:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 80C2132B for ; Wed, 6 Jan 2021 21:07:58 +0000 (UTC) From: "Andreas Sturmlechner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas Sturmlechner" Message-ID: <1609967218.b3a2c01693cb2d53d5fd730c26ceae43f2972afb.asturm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: kde-frameworks/baloo/, kde-frameworks/baloo/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: kde-frameworks/baloo/baloo-5.77.0-r1.ebuild kde-frameworks/baloo/files/baloo-5.77.0-no-error-w-o-index.patch kde-frameworks/baloo/files/baloo-5.77.0-strip-trailing-slash.patch X-VCS-Directories: kde-frameworks/baloo/ kde-frameworks/baloo/files/ X-VCS-Committer: asturm X-VCS-Committer-Name: Andreas Sturmlechner X-VCS-Revision: b3a2c01693cb2d53d5fd730c26ceae43f2972afb X-VCS-Branch: master Date: Wed, 6 Jan 2021 21:07:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: a423add1-9552-45a3-a557-d3594a425f28 X-Archives-Hash: 99bd2536eb5f972b1c7275c684ad4652 commit: b3a2c01693cb2d53d5fd730c26ceae43f2972afb Author: Andreas Sturmlechner gentoo org> AuthorDate: Wed Jan 6 16:52:20 2021 +0000 Commit: Andreas Sturmlechner gentoo org> CommitDate: Wed Jan 6 21:06:58 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3a2c016 kde-frameworks/baloo: Fix index corruption, fix error w/o index a) [BasicIndexingJob] Strip trailing slash from folders Upstream commit 9b61371fdefbd538938f20cdc87eed03d170fa5b KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=430273 Thanks-to: josef64 (in #gentoo-kde IRC) b) Avoid errors for application startup if no baloo index was ever created Upstream commit d102b01ee59d93de3fe18c12364ea69a85ea723f Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner gentoo.org> kde-frameworks/baloo/baloo-5.77.0-r1.ebuild | 40 +++++++++++ .../files/baloo-5.77.0-no-error-w-o-index.patch | 77 ++++++++++++++++++++++ .../files/baloo-5.77.0-strip-trailing-slash.patch | 34 ++++++++++ 3 files changed, 151 insertions(+) diff --git a/kde-frameworks/baloo/baloo-5.77.0-r1.ebuild b/kde-frameworks/baloo/baloo-5.77.0-r1.ebuild new file mode 100644 index 00000000000..ac7ba502832 --- /dev/null +++ b/kde-frameworks/baloo/baloo-5.77.0-r1.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +ECM_TEST="forceoptional" +PVCUT=$(ver_cut 1-2) +QTMIN=5.15.1 +VIRTUALX_REQUIRED="test" +inherit ecm kde.org + +DESCRIPTION="Framework for searching and managing metadata" +LICENSE="LGPL-2+" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +IUSE="" + +DEPEND=" + >=dev-db/lmdb-0.9.17 + >=dev-qt/qtdbus-${QTMIN}:5 + >=dev-qt/qtdeclarative-${QTMIN}:5 + >=dev-qt/qtgui-${QTMIN}:5 + >=dev-qt/qtwidgets-${QTMIN}:5 + =kde-frameworks/kconfig-${PVCUT}*:5 + =kde-frameworks/kcoreaddons-${PVCUT}*:5 + =kde-frameworks/kcrash-${PVCUT}*:5 + =kde-frameworks/kdbusaddons-${PVCUT}*:5 + =kde-frameworks/kfilemetadata-${PVCUT}*:5 + =kde-frameworks/ki18n-${PVCUT}*:5 + =kde-frameworks/kidletime-${PVCUT}*:5 + =kde-frameworks/kio-${PVCUT}*:5 + =kde-frameworks/solid-${PVCUT}*:5 +" +RDEPEND="${DEPEND}" + +RESTRICT+=" test" # bug 624250 + +PATCHES=( + "${FILESDIR}/${P}-strip-trailing-slash.patch" + "${FILESDIR}/${P}-no-error-w-o-index.patch" +) diff --git a/kde-frameworks/baloo/files/baloo-5.77.0-no-error-w-o-index.patch b/kde-frameworks/baloo/files/baloo-5.77.0-no-error-w-o-index.patch new file mode 100644 index 00000000000..d49cc8f6d9d --- /dev/null +++ b/kde-frameworks/baloo/files/baloo-5.77.0-no-error-w-o-index.patch @@ -0,0 +1,77 @@ +From d102b01ee59d93de3fe18c12364ea69a85ea723f Mon Sep 17 00:00:00 2001 +From: Christoph Cullmann +Date: Thu, 31 Dec 2020 15:44:40 +0000 +Subject: [PATCH] avoid errors for application startup if no baloo index was + ever created + +use case: + + * a KDE application started e.g. in an non-KDE Plasma environment + * a KDE application started with baloo indexing disabled + +you normally will get: + +kf.kio.slaves.tags: tag fetch failed: "Failed to open the database" +kf.kio.slaves.tags: "tags:/" list() invalid url + +Now this is not issued if no index database exist. +--- + src/engine/database.cpp | 6 ++++++ + src/engine/database.h | 7 +++++++ + src/lib/taglistjob.cpp | 7 +++++++ + 3 files changed, 20 insertions(+) + +diff --git a/src/engine/database.cpp b/src/engine/database.cpp +index 427210d0..ac93426c 100644 +--- a/src/engine/database.cpp ++++ b/src/engine/database.cpp +@@ -247,3 +247,9 @@ QString Database::path() const + QMutexLocker locker(&m_mutex); + return m_path; + } ++ ++bool Database::isAvailable() const ++{ ++ QMutexLocker locker(&m_mutex); ++ return QFileInfo::exists(m_path + QStringLiteral("/index")); ++} +diff --git a/src/engine/database.h b/src/engine/database.h +index 0f43b623..26d21101 100644 +--- a/src/engine/database.h ++++ b/src/engine/database.h +@@ -73,6 +73,13 @@ public: + */ + QString path() const; + ++ /** ++ * Is the database available for use? ++ * For example if indexing is disabled or the indexer did never run this is false. ++ * @return database available ++ */ ++ bool isAvailable() const; ++ + private: + /** + * serialize access, as open might be called from multiple threads +diff --git a/src/lib/taglistjob.cpp b/src/lib/taglistjob.cpp +index cea57889..58945cc7 100644 +--- a/src/lib/taglistjob.cpp ++++ b/src/lib/taglistjob.cpp +@@ -33,7 +33,14 @@ TagListJob::~TagListJob() + void TagListJob::start() + { + Database *db = globalDatabaseInstance(); ++ + if (!db->open(Database::ReadOnlyDatabase)) { ++ // if we have no index, we have no tags ++ if (!db->isAvailable()) { ++ emitResult(); ++ return; ++ } ++ + setError(UserDefinedError); + setErrorText(QStringLiteral("Failed to open the database")); + emitResult(); +-- +GitLab + diff --git a/kde-frameworks/baloo/files/baloo-5.77.0-strip-trailing-slash.patch b/kde-frameworks/baloo/files/baloo-5.77.0-strip-trailing-slash.patch new file mode 100644 index 00000000000..ab9c7639799 --- /dev/null +++ b/kde-frameworks/baloo/files/baloo-5.77.0-strip-trailing-slash.patch @@ -0,0 +1,34 @@ +From 9b61371fdefbd538938f20cdc87eed03d170fa5b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Stefan=20Br=C3=BCns?= +Date: Sat, 12 Dec 2020 19:01:45 +0100 +Subject: [PATCH] [BasicIndexingJob] Strip trailing slash from folders + +If BasicIndexingJob is called with a path with a trailing slash, the +search for the last slash (separating name from parent path) goes wrong. + +This was wrong already earlier, but with commit 47ebc15844f6b8a8 +("[Document] Add parent document ID and populate it") this caused +document and parent id to be the same. + +CCBUG: 430273 +--- + src/file/basicindexingjob.cpp | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/file/basicindexingjob.cpp b/src/file/basicindexingjob.cpp +index e00c6a2b..c0f18ddd 100644 +--- a/src/file/basicindexingjob.cpp ++++ b/src/file/basicindexingjob.cpp +@@ -23,6 +23,9 @@ BasicIndexingJob::BasicIndexingJob(const QString& filePath, const QString& mimet + , m_mimetype(mimetype) + , m_indexingLevel(level) + { ++ if (m_filePath.endsWith(QChar('/'))) { ++ m_filePath.chop(1); ++ } + } + + namespace { +-- +GitLab +