Fixes rhbz#2021087

epel8^2
Timothée Ravier 3 years ago
parent dc6567f134
commit 182707d8e3

@ -0,0 +1,46 @@
From 21ce3b1e938c4b96154a7b00a15beef428ffce4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timoth=C3=A9e=20Ravier?= <tim@siosm.fr>
Date: Sun, 15 May 2022 15:32:50 +0200
Subject: [PATCH] kbuildsycoca: Ignore last modified time when set to UNIX
Epoch
On some systems (i.e. Fedora Kinoite), all files in /usr have a last
modified timestamp of 0 (UNIX Epoch). In this case, always assume the
file as been changed.
We only get the current time once to speed up execution as we don't need
to be accurate in this case.
BUG: 442011
See:
- https://bugzilla.redhat.com/show_bug.cgi?id=2021087
- https://discussion.fedoraproject.org/t/kinoite-installation-with-utc-timezone-breaks-kde/34293/8
---
src/sycoca/kbuildsycoca.cpp | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/sycoca/kbuildsycoca.cpp b/src/sycoca/kbuildsycoca.cpp
index 0caeccf..3b0e011 100644
--- a/src/sycoca/kbuildsycoca.cpp
+++ b/src/sycoca/kbuildsycoca.cpp
@@ -607,7 +607,15 @@ static quint32 updateHash(const QString &file, quint32 hash)
if (fi.isReadable() && fi.isFile()) {
// This was using buff.st_ctime (in Waldo's initial commit to kstandarddirs.cpp in 2001), but that looks wrong?
// Surely we want to catch manual editing, while a chmod doesn't matter much?
- hash += fi.lastModified().toSecsSinceEpoch();
+ qint64 timestamp = fi.lastModified().toSecsSinceEpoch();
+ // On some systems (i.e. Fedora Kinoite), all files in /usr have a last
+ // modified timestamp of 0 (UNIX Epoch). In this case, always assume
+ // the file as been changed.
+ if (timestamp == 0) {
+ static qint64 now = QDateTime::currentDateTimeUtc().toSecsSinceEpoch();
+ timestamp = now;
+ }
+ hash += timestamp;
}
return hash;
}
--
2.36.1

@ -4,7 +4,7 @@
Name: kf5-%{framework}
Summary: KDE Frameworks 5 Tier 3 solution for advanced plugin and service introspection
Version: 5.94.0
Release: 1%{?dist}
Release: 2%{?dist}
# mixture of LGPLv2 and LGPLv2+ (mostly the latter)
License: LGPLv2
@ -32,6 +32,10 @@ Patch100: kservice-5.15.0-xdg-menu.patch
# hide that by default, make it qCDebug instead (of qCWarning)
Patch101: kservice-5.17.0-vfolder_spam.patch
# Fix for https://bugzilla.redhat.com/show_bug.cgi?id=2021087
# Will be included in 5.95
Patch102: kbuildsycoca-Ignore-last-modified-time-when-set-to-U.patch
BuildRequires: extra-cmake-modules >= %{majmin}
BuildRequires: kf5-kconfig-devel >= %{majmin}
BuildRequires: kf5-kcoreaddons-devel >= %{majmin}
@ -106,6 +110,9 @@ mkdir -p %{buildroot}%{_kf5_datadir}/kservicetypes5
%changelog
* Tue May 17 2022 Timothée Ravier <tim@siosm.fr> - 5.94.0-2
- Fixes rhbz#2021087
* Fri May 13 2022 Rex Dieter <rdieter@fedoraproject.org> - 5.94.0-1
- 5.94.0

Loading…
Cancel
Save