upgrade to version 5.108.0

This commit is contained in:
leeffo 2023-08-03 15:00:43 +08:00
parent 700c4ff0b3
commit eb322fe0bd
4 changed files with 82 additions and 14 deletions

Binary file not shown.

BIN
baloo-5.108.0.tar.xz Normal file

Binary file not shown.

View File

@ -9,24 +9,21 @@
Name: kf5-%{framework}
Summary: A Tier 3 KDE Frameworks 5 module that provides indexing and search functionality
Version: 5.100.0
Version: 5.108.0
Release: 1
License: (LGPLv2 or LGPLv3) and (GPLv2 or GPLv3)
URL: https://community.kde.org/Baloo
%global majmin %(echo %{version} | cut -d. -f1-2)
%global revision %(echo %{version} | cut -d. -f3)
%if %{revision} >= 50
%global stable unstable
%else
%global stable stable
%endif
%global majmin %majmin_ver_kf5
%global stable %stable_kf5
Source0: http://download.kde.org/%{stable}/frameworks/%{majmin}/%{framework}-%{version}.tar.xz
Source1: 97-kde-baloo-filewatch-inotify.conf
Source2: baloo_file_shutdown.sh
Patch100: baloo-5.67.0-baloofile_config.patch
# https://invent.kde.org/frameworks/baloo/-/merge_requests/131
Patch101: use_the_FSID_as_the_device_identifier_where_possible.patch
BuildRequires: extra-cmake-modules >= %{majmin}
BuildRequires: kf5-kconfig-devel >= %{majmin}
@ -76,12 +73,7 @@ developing applications that use %{name}.
%package file
Summary: File indexing and search for Baloo
License: LGPLv2 or LGPLv3
%if 0%{?fedora}
Obsoletes: baloo-file < 5.0.1-2
Provides: baloo-file = %{version}-%{release}
%else
Conflicts: baloo-file < 5
%endif
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description file
%{summary}.
@ -126,12 +118,17 @@ install -p -m755 -D %{SOURCE2} %{buildroot}%{_sysconfdir}/xdg/plasma-workspace/s
%find_lang balooengine5
%find_lang baloosearch5
%find_lang balooshow5
%find_lang baloo_file5
%find_lang baloo_file_extractor5
cat kio5_tags.lang kio5_baloosearch.lang kio5_timeline.lang \
balooctl5.lang balooengine5.lang baloosearch5.lang \
balooshow5.lang \
> %{name}.lang
cat baloo_file5.lang baloo_file_extractor5.lang \
> %{name}-file.lang
%check
%if 0%{?tests}
@ -150,7 +147,7 @@ make test ARGS="--output-on-failure --timeout 300" -C %{_target_platform} ||:
%{_kf5_bindir}/balooctl
%{_kf5_datadir}/qlogging-categories5/%{framework}*
%files file
%files file -f %{name}-file.lang
%{_prefix}/lib/sysctl.d/97-kde-baloo-filewatch-inotify.conf
%config(noreplace) %{_sysconfdir}/xdg/plasma-workspace/shutdown/baloo_file.sh
%{_kf5_bindir}/baloo_file
@ -186,6 +183,9 @@ make test ARGS="--output-on-failure --timeout 300" -C %{_target_platform} ||:
%changelog
* Thu Aug 03 2023 leeffo <liweiganga@uniontech.com> - 5.108.0-1
- upgrade to version 5.108.0
* Fri Feb 17 2023 peijiankang <peijiankang@kylinos.cn> - 5.100.0-1
- update verison to 5.100.0

View File

@ -0,0 +1,68 @@
From 7026ec9ab4bc28e97886e4c56ac4c7fc48d8f344 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Trnka?= <tomastrnka@gmx.com>
Date: Wed, 17 May 2023 21:07:57 +0200
Subject: [PATCH] Use the FSID as the device identifier where possible
The device number returned by stat() in st_dev is not persistent in many
cases. Btrfs subvolumes or partitions on NVMe devices are assigned
device numbers dynamically, so the resulting device ID is typically
different after every reboot, forcing Baloo to repeatedly reindex all
files.
Fortunately, filesystems like Btrfs or ext4 return a persistent
unique filesystem ID as f_fsid from statvfs(), so we can use that when
available. Other filesystems like XFS derive the FSID from the device
number of the underlying block device, so switching to the FSID does not
change anything.
CCBUG: 402154
---
src/engine/idutils.h | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/src/engine/idutils.h b/src/engine/idutils.h
index 78d881a96..606ac9dca 100644
--- a/src/engine/idutils.h
+++ b/src/engine/idutils.h
@@ -13,6 +13,8 @@
#ifdef Q_OS_WIN
# include <QFileInfo>
+#else
+# include <sys/statvfs.h>
#endif
namespace Baloo {
@@ -40,10 +42,28 @@ inline quint64 statBufToId(const QT_STATBUF& stBuf)
static_cast<quint32>(stBuf.st_ino));
}
+#ifndef Q_OS_WIN
+inline int statWithFsid(const char* path, QT_STATBUF* statBuf)
+{
+ int ret = QT_LSTAT(path, statBuf);
+ if (ret != 0) {
+ return ret;
+ }
+
+ struct statvfs fsBuf;
+ ret = statvfs(path, &fsBuf);
+ if (ret == 0 && fsBuf.f_fsid != 0) {
+ // Fold FSID into 32 bits, statBufToId would discard anything else
+ statBuf->st_dev = static_cast<quint32>(fsBuf.f_fsid ^ (fsBuf.f_fsid >> 32));
+ }
+ return ret;
+}
+#endif
+
inline int filePathToStat(const QByteArray& filePath, QT_STATBUF& statBuf)
{
#ifndef Q_OS_WIN
- return QT_LSTAT(filePath.constData(), &statBuf);
+ return statWithFsid(filePath.constData(), &statBuf);
#else
const int ret = QT_STAT(filePath.constData(), &statBuf);
const QString filePathStr = QString::fromUtf8(filePath);
--
GitLab