From bedc0270e72071dd027f998629f6d633700c5b89 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sep 24 2024 14:35:29 +0000 Subject: Move yum/dnf protection removal config file under /usr https://github.com/uapi-group/specifications/issues/76 Actually, add a new file under /usr, but keep the old file in /etc because it's still needed for dnf. The new file in the new location is useful because it means that we get the correct behaviour even when /etc is emptied (on systems with new dnf version). dnf5 reads the new location: https://github.com/rpm-software-management/dnf5/issues/1107 https://github.com/rpm-software-management/dnf5/pull/1110 --- diff --git a/systemd.spec b/systemd.spec index cb4f895..b1d69a4 100644 --- a/systemd.spec +++ b/systemd.spec @@ -71,9 +71,6 @@ Source2: split-files.py Source3: purge-nobody-user Source4: test_sysusers_defined.py -# Prevent accidental removal of the systemd package -Source5: yum-protect-systemd.conf - Source6: inittab Source7: sysctl.conf.README Source8: systemd-journal-remote.xml @@ -942,8 +939,18 @@ touch %{buildroot}%{_localstatedir}/lib/systemd/random-seed touch %{buildroot}%{_localstatedir}/lib/systemd/timesync/clock touch %{buildroot}%{_localstatedir}/lib/private/systemd/journal-upload/state -# Install yum protection fragment -install -Dm0644 %{SOURCE5} %{buildroot}/etc/dnf/protected.d/systemd.conf +# Install yum protection config. Old location in /etc. +mkdir -p %{buildroot}/etc/dnf/protected.d/ +cat >%{buildroot}/etc/dnf/protected.d/systemd.conf <%{buildroot}/usr/share/dnf5/libdnf.conf.d/protect-systemd.conf <