From 993fb5b3ade9c1a4417e019475be24fd7114232275fef0ed01b3e5908bac6e37 Mon Sep 17 00:00:00 2001 From: David Anes Date: Mon, 12 Sep 2022 14:18:45 +0000 Subject: [PATCH] Accepting request 1000570 from home:schubi2 - Migration to /usr/etc: Saving user changed configuration files in /etc and restoring them while an RPM update. OBS-URL: https://build.opensuse.org/request/show/1000570 OBS-URL: https://build.opensuse.org/package/show/network/atftp?expand=0&rev=54 --- atftp.changes | 6 ++++++ atftp.spec | 14 ++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/atftp.changes b/atftp.changes index ae95e67..ac94986 100644 --- a/atftp.changes +++ b/atftp.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 1 06:13:32 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Tue Jun 28 14:08:19 UTC 2022 - Stefan Schubert diff --git a/atftp.spec b/atftp.spec index 91b322c..c1faad8 100644 --- a/atftp.spec +++ b/atftp.spec @@ -93,6 +93,12 @@ if [ -f %{_sysconfdir}/sysconfig/atftpd ]; then sed -i -e "s@^\(ATFTPD_DIRECTORY=\"/tftpboot\"\)@#\1@" %{_sysconfdir}/sysconfig/atftpd fi %service_add_pre atftpd.service atftpd.socket +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/%{name} ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif %preun %service_del_preun atftpd.service atftpd.socket @@ -104,6 +110,14 @@ fi %postun %service_del_postun atftpd.service atftpd.socket +%if 0%{?suse_version} > 1500 +%posttrans +# Migration to /usr/etc, restore just created .rpmsave +for i in logrotate.d/%{name} ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif + %files %defattr(-,root,root) %license LICENSE