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
This commit is contained in:
Dan Čermák 2024-06-24 16:22:20 +00:00 committed by Git OBS Bridge
parent a3a7402ad0
commit 0a22d0ce3f
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Jun 24 13:32:55 UTC 2024 - Danish Prakash <danish.prakash@suse.com>
- 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 <dcermak@suse.com>

View File

@ -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