From 320b394ff8543c01ea4bf53ed194f7ebe92628b2 Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Fri, 27 Feb 2026 03:13:28 -0500 Subject: [PATCH] rpm: Use %config(noreplace) for the config file (#932) Currently, when upgrading the RPM, if the upstream `zrepl.yml` is changed in the update, the user's `zrepl.yml` will be renamed to `zrepl.yml.rpmsave` and the new `zrepl.yml` is installed in its place. This commit changes the behavior so that the user's config remains in place and the new upstream config is installed to `zrepl.yml.rpmnew` instead. --- This was never a problem before because `packaging/systemd-default-zrepl.yml` was the same since the initial release. RPM leaves edited config files alone with the upstream config file doesn't change. However, v0.7.0 changed the file with: 9c63736489569adf07537b9b01dc5e84f23f9651. So with this update, RPM detects an upstream config change during the update and moves the user's config according to `%config`'s rules (https://www.cl.cam.ac.uk/~jw35/docs/rpm_config.html). `%config(noreplace)` prevents this from happening. Signed-off-by: Andrew Gunnerson --- packaging/rpm/zrepl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/rpm/zrepl.spec b/packaging/rpm/zrepl.spec index f712a2d..b14d00d 100644 --- a/packaging/rpm/zrepl.spec +++ b/packaging/rpm/zrepl.spec @@ -69,7 +69,7 @@ cp -a internal/config/samples %{buildroot}%{_datadir}/ %{_bindir}/zrepl %config %{_unitdir}/zrepl.service %dir %{_sysconfdir}/zrepl -%config %{_sysconfdir}/zrepl/zrepl.yml +%config(noreplace) %{_sysconfdir}/zrepl/zrepl.yml %{_datadir}/zsh/site-functions/_zrepl %{_datadir}/bash-completion/completions/zrepl %{_datadir}/doc/zrepl