From c81902cbeca1134cd2c8edf67c5d5992c3c32cb9d2fac8f074af419a7694fe07 Mon Sep 17 00:00:00 2001 From: David Anes Date: Mon, 12 Sep 2022 14:19:14 +0000 Subject: [PATCH] Accepting request 1000574 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/1000574 OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=674 --- apache2.changes | 6 ++++++ apache2.spec | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/apache2.changes b/apache2.changes index bd2cfd3..c6adb5f 100644 --- a/apache2.changes +++ b/apache2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 1 06:31:31 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:39:26 UTC 2022 - Stefan Schubert diff --git a/apache2.spec b/apache2.spec index 48549d1..1973cc2 100644 --- a/apache2.spec +++ b/apache2.spec @@ -955,6 +955,12 @@ exit 0 %if "%{flavor}" == "" %pre %service_add_pre apache2.service apache2.target +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/apache2 ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif exit 0 %post @@ -975,6 +981,12 @@ exit 0 %posttrans %apache_restart_if_needed +%if 0%{?suse_version} > 1500 +# Migration to /usr/etc, restore just created .rpmsave +for i in logrotate.d/apache2 ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %verifyscript %verify_permissions -e %{_sbindir}/suexec