1 |
commit: b3a2c01693cb2d53d5fd730c26ceae43f2972afb |
2 |
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 6 16:52:20 2021 +0000 |
4 |
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 6 21:06:58 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3a2c016 |
7 |
|
8 |
kde-frameworks/baloo: Fix index corruption, fix error w/o index |
9 |
|
10 |
a) [BasicIndexingJob] Strip trailing slash from folders |
11 |
Upstream commit 9b61371fdefbd538938f20cdc87eed03d170fa5b |
12 |
KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=430273 |
13 |
Thanks-to: josef64 (in #gentoo-kde IRC) |
14 |
|
15 |
b) Avoid errors for application startup if no baloo index was ever created |
16 |
Upstream commit d102b01ee59d93de3fe18c12364ea69a85ea723f |
17 |
|
18 |
Package-Manager: Portage-3.0.12, Repoman-3.0.2 |
19 |
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org> |
20 |
|
21 |
kde-frameworks/baloo/baloo-5.77.0-r1.ebuild | 40 +++++++++++ |
22 |
.../files/baloo-5.77.0-no-error-w-o-index.patch | 77 ++++++++++++++++++++++ |
23 |
.../files/baloo-5.77.0-strip-trailing-slash.patch | 34 ++++++++++ |
24 |
3 files changed, 151 insertions(+) |
25 |
|
26 |
diff --git a/kde-frameworks/baloo/baloo-5.77.0-r1.ebuild b/kde-frameworks/baloo/baloo-5.77.0-r1.ebuild |
27 |
new file mode 100644 |
28 |
index 00000000000..ac7ba502832 |
29 |
--- /dev/null |
30 |
+++ b/kde-frameworks/baloo/baloo-5.77.0-r1.ebuild |
31 |
@@ -0,0 +1,40 @@ |
32 |
+# Copyright 1999-2021 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=7 |
36 |
+ |
37 |
+ECM_TEST="forceoptional" |
38 |
+PVCUT=$(ver_cut 1-2) |
39 |
+QTMIN=5.15.1 |
40 |
+VIRTUALX_REQUIRED="test" |
41 |
+inherit ecm kde.org |
42 |
+ |
43 |
+DESCRIPTION="Framework for searching and managing metadata" |
44 |
+LICENSE="LGPL-2+" |
45 |
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" |
46 |
+IUSE="" |
47 |
+ |
48 |
+DEPEND=" |
49 |
+ >=dev-db/lmdb-0.9.17 |
50 |
+ >=dev-qt/qtdbus-${QTMIN}:5 |
51 |
+ >=dev-qt/qtdeclarative-${QTMIN}:5 |
52 |
+ >=dev-qt/qtgui-${QTMIN}:5 |
53 |
+ >=dev-qt/qtwidgets-${QTMIN}:5 |
54 |
+ =kde-frameworks/kconfig-${PVCUT}*:5 |
55 |
+ =kde-frameworks/kcoreaddons-${PVCUT}*:5 |
56 |
+ =kde-frameworks/kcrash-${PVCUT}*:5 |
57 |
+ =kde-frameworks/kdbusaddons-${PVCUT}*:5 |
58 |
+ =kde-frameworks/kfilemetadata-${PVCUT}*:5 |
59 |
+ =kde-frameworks/ki18n-${PVCUT}*:5 |
60 |
+ =kde-frameworks/kidletime-${PVCUT}*:5 |
61 |
+ =kde-frameworks/kio-${PVCUT}*:5 |
62 |
+ =kde-frameworks/solid-${PVCUT}*:5 |
63 |
+" |
64 |
+RDEPEND="${DEPEND}" |
65 |
+ |
66 |
+RESTRICT+=" test" # bug 624250 |
67 |
+ |
68 |
+PATCHES=( |
69 |
+ "${FILESDIR}/${P}-strip-trailing-slash.patch" |
70 |
+ "${FILESDIR}/${P}-no-error-w-o-index.patch" |
71 |
+) |
72 |
|
73 |
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 |
74 |
new file mode 100644 |
75 |
index 00000000000..d49cc8f6d9d |
76 |
--- /dev/null |
77 |
+++ b/kde-frameworks/baloo/files/baloo-5.77.0-no-error-w-o-index.patch |
78 |
@@ -0,0 +1,77 @@ |
79 |
+From d102b01ee59d93de3fe18c12364ea69a85ea723f Mon Sep 17 00:00:00 2001 |
80 |
+From: Christoph Cullmann <cullmann@×××.org> |
81 |
+Date: Thu, 31 Dec 2020 15:44:40 +0000 |
82 |
+Subject: [PATCH] avoid errors for application startup if no baloo index was |
83 |
+ ever created |
84 |
+ |
85 |
+use case: |
86 |
+ |
87 |
+ * a KDE application started e.g. in an non-KDE Plasma environment |
88 |
+ * a KDE application started with baloo indexing disabled |
89 |
+ |
90 |
+you normally will get: |
91 |
+ |
92 |
+kf.kio.slaves.tags: tag fetch failed: "Failed to open the database" |
93 |
+kf.kio.slaves.tags: "tags:/" list() invalid url |
94 |
+ |
95 |
+Now this is not issued if no index database exist. |
96 |
+--- |
97 |
+ src/engine/database.cpp | 6 ++++++ |
98 |
+ src/engine/database.h | 7 +++++++ |
99 |
+ src/lib/taglistjob.cpp | 7 +++++++ |
100 |
+ 3 files changed, 20 insertions(+) |
101 |
+ |
102 |
+diff --git a/src/engine/database.cpp b/src/engine/database.cpp |
103 |
+index 427210d0..ac93426c 100644 |
104 |
+--- a/src/engine/database.cpp |
105 |
++++ b/src/engine/database.cpp |
106 |
+@@ -247,3 +247,9 @@ QString Database::path() const |
107 |
+ QMutexLocker locker(&m_mutex); |
108 |
+ return m_path; |
109 |
+ } |
110 |
++ |
111 |
++bool Database::isAvailable() const |
112 |
++{ |
113 |
++ QMutexLocker locker(&m_mutex); |
114 |
++ return QFileInfo::exists(m_path + QStringLiteral("/index")); |
115 |
++} |
116 |
+diff --git a/src/engine/database.h b/src/engine/database.h |
117 |
+index 0f43b623..26d21101 100644 |
118 |
+--- a/src/engine/database.h |
119 |
++++ b/src/engine/database.h |
120 |
+@@ -73,6 +73,13 @@ public: |
121 |
+ */ |
122 |
+ QString path() const; |
123 |
+ |
124 |
++ /** |
125 |
++ * Is the database available for use? |
126 |
++ * For example if indexing is disabled or the indexer did never run this is false. |
127 |
++ * @return database available |
128 |
++ */ |
129 |
++ bool isAvailable() const; |
130 |
++ |
131 |
+ private: |
132 |
+ /** |
133 |
+ * serialize access, as open might be called from multiple threads |
134 |
+diff --git a/src/lib/taglistjob.cpp b/src/lib/taglistjob.cpp |
135 |
+index cea57889..58945cc7 100644 |
136 |
+--- a/src/lib/taglistjob.cpp |
137 |
++++ b/src/lib/taglistjob.cpp |
138 |
+@@ -33,7 +33,14 @@ TagListJob::~TagListJob() |
139 |
+ void TagListJob::start() |
140 |
+ { |
141 |
+ Database *db = globalDatabaseInstance(); |
142 |
++ |
143 |
+ if (!db->open(Database::ReadOnlyDatabase)) { |
144 |
++ // if we have no index, we have no tags |
145 |
++ if (!db->isAvailable()) { |
146 |
++ emitResult(); |
147 |
++ return; |
148 |
++ } |
149 |
++ |
150 |
+ setError(UserDefinedError); |
151 |
+ setErrorText(QStringLiteral("Failed to open the database")); |
152 |
+ emitResult(); |
153 |
+-- |
154 |
+GitLab |
155 |
+ |
156 |
|
157 |
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 |
158 |
new file mode 100644 |
159 |
index 00000000000..ab9c7639799 |
160 |
--- /dev/null |
161 |
+++ b/kde-frameworks/baloo/files/baloo-5.77.0-strip-trailing-slash.patch |
162 |
@@ -0,0 +1,34 @@ |
163 |
+From 9b61371fdefbd538938f20cdc87eed03d170fa5b Mon Sep 17 00:00:00 2001 |
164 |
+From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@×××××××××××.de> |
165 |
+Date: Sat, 12 Dec 2020 19:01:45 +0100 |
166 |
+Subject: [PATCH] [BasicIndexingJob] Strip trailing slash from folders |
167 |
+ |
168 |
+If BasicIndexingJob is called with a path with a trailing slash, the |
169 |
+search for the last slash (separating name from parent path) goes wrong. |
170 |
+ |
171 |
+This was wrong already earlier, but with commit 47ebc15844f6b8a8 |
172 |
+("[Document] Add parent document ID and populate it") this caused |
173 |
+document and parent id to be the same. |
174 |
+ |
175 |
+CCBUG: 430273 |
176 |
+--- |
177 |
+ src/file/basicindexingjob.cpp | 3 +++ |
178 |
+ 1 file changed, 3 insertions(+) |
179 |
+ |
180 |
+diff --git a/src/file/basicindexingjob.cpp b/src/file/basicindexingjob.cpp |
181 |
+index e00c6a2b..c0f18ddd 100644 |
182 |
+--- a/src/file/basicindexingjob.cpp |
183 |
++++ b/src/file/basicindexingjob.cpp |
184 |
+@@ -23,6 +23,9 @@ BasicIndexingJob::BasicIndexingJob(const QString& filePath, const QString& mimet |
185 |
+ , m_mimetype(mimetype) |
186 |
+ , m_indexingLevel(level) |
187 |
+ { |
188 |
++ if (m_filePath.endsWith(QChar('/'))) { |
189 |
++ m_filePath.chop(1); |
190 |
++ } |
191 |
+ } |
192 |
+ |
193 |
+ namespace { |
194 |
+-- |
195 |
+GitLab |
196 |
+ |