Compare commits

...

2 Commits

Author SHA1 Message Date
Christian Schwarz 2d5d8d04e0 build: hard-code zrepl v0.7.0 package release 2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 08:20:12 +00:00
Andrew Gunnerson 320b394ff8 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:
9c63736489. 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 <accounts+github@chiller3.com>
2026-02-27 08:19:16 +00:00
2 changed files with 3 additions and 12 deletions
+2 -11
View File
@@ -4,17 +4,8 @@
ARTIFACTDIR := artifacts ARTIFACTDIR := artifacts
ifdef ZREPL_VERSION _ZREPL_VERSION := v0.7.0
_ZREPL_VERSION := $(ZREPL_VERSION) ZREPL_PACKAGE_RELEASE := 2
endif
ifndef _ZREPL_VERSION
_ZREPL_VERSION := $(shell git describe --always --dirty 2>/dev/null || echo "ZREPL_BUILD_INVALID_VERSION" )
ifeq ($(_ZREPL_VERSION),ZREPL_BUILD_INVALID_VERSION) # can't use .SHELLSTATUS because Debian Stretch is still on gmake 4.1
$(error cannot infer variable ZREPL_VERSION using git and variable is not overriden by make invocation)
endif
endif
ZREPL_PACKAGE_RELEASE := 1
GO := go GO := go
GOOS ?= $(shell bash -c 'source <($(GO) env) && echo "$$GOOS"') GOOS ?= $(shell bash -c 'source <($(GO) env) && echo "$$GOOS"')
+1 -1
View File
@@ -69,7 +69,7 @@ cp -a internal/config/samples %{buildroot}%{_datadir}/
%{_bindir}/zrepl %{_bindir}/zrepl
%config %{_unitdir}/zrepl.service %config %{_unitdir}/zrepl.service
%dir %{_sysconfdir}/zrepl %dir %{_sysconfdir}/zrepl
%config %{_sysconfdir}/zrepl/zrepl.yml %config(noreplace) %{_sysconfdir}/zrepl/zrepl.yml
%{_datadir}/zsh/site-functions/_zrepl %{_datadir}/zsh/site-functions/_zrepl
%{_datadir}/bash-completion/completions/zrepl %{_datadir}/bash-completion/completions/zrepl
%{_datadir}/doc/zrepl %{_datadir}/doc/zrepl