From 0a22d0ce3fb19c8946f1296e9977d0ad5b8450b9bf4ac6260467f8c55a207760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Mon, 24 Jun 2024 16:22:20 +0000 Subject: [PATCH] Accepting request 1183023 from home:danishprakash:branches:devel:microos While migrating config files from /etc/containers/ to /usr/share/containers/, preserve config files *if* modified by the user. OBS-URL: https://build.opensuse.org/request/show/1183023 OBS-URL: https://build.opensuse.org/package/show/devel:microos/libcontainers-common?expand=0&rev=42 --- libcontainers-common.changes | 6 ++++++ libcontainers-common.spec | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/libcontainers-common.changes b/libcontainers-common.changes index 20a86ed..ac671ca 100644 --- a/libcontainers-common.changes +++ b/libcontainers-common.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jun 24 13:32:55 UTC 2024 - Danish Prakash + +- While migrating config files from /etc/containers/ to /usr/share/containers/, + preserve config files *if* modified by the user. + ------------------------------------------------------------------- Mon Jun 24 07:46:23 UTC 2024 - Dan Čermák diff --git a/libcontainers-common.spec b/libcontainers-common.spec index 84ce10b..884e17f 100644 --- a/libcontainers-common.spec +++ b/libcontainers-common.spec @@ -208,10 +208,20 @@ install -D -m 0644 %{SOURCE3} %{buildroot}/%{_sysconfdir}/containers/policy.json install -D -m 0644 %{SOURCE6} %{buildroot}/%{_sysconfdir}/containers/registries.conf.default install -D -m 0644 registries.conf.suse %{buildroot}/%{_sysconfdir}/containers/registries.conf.suse +%pre +for i in %{_sysconfdir}/containers/{mounts.conf,seccomp.json,storage.conf} ; do + test -f ${i}.rpmsave && mv -v ${i}.rpmsave ${i}.rpmsave.old ||: +done + %post # Comment out ostree_repo if it's blank [boo#1189893] if [ -f %{_sysconfdir}/containers/storage.conf ]; then sed -i 's/ostree_repo = ""/\#ostree_repo = ""/g' %{_sysconfdir}/containers/storage.conf; fi +%posttrans +for i in %{_sysconfdir}/containers/{mounts.conf,seccomp.json,storage.conf} ; do + test -f ${i}.rpmsave && mv -v ${i}.rpmsave ${i} ||: +done + %files %dir %{_sysconfdir}/containers %dir %{_sysconfdir}/containers/oci