From aba3e0a056424a395ed79ab66cdb17d2e8b5790eea3131b0fc34142028093c1b Mon Sep 17 00:00:00 2001 From: Callum Farmer Date: Thu, 1 Sep 2022 08:10:40 +0000 Subject: [PATCH] Accepting request 1000602 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/1000602 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/firewalld?expand=0&rev=131 --- firewalld.changes | 6 ++++++ firewalld.spec | 18 +++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/firewalld.changes b/firewalld.changes index 80ab3ab..d4007d3 100644 --- a/firewalld.changes +++ b/firewalld.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 1 07:55:30 UTC 2022 - Stefan Schubert + +- Migration to /usr/etc: Saving user changed configuration files + in /etc and restoring them while an RPM update. + ------------------------------------------------------------------- Tue Aug 2 09:17:56 UTC 2022 - Marcus Meissner diff --git a/firewalld.spec b/firewalld.spec index af93f77..10339c5 100644 --- a/firewalld.spec +++ b/firewalld.spec @@ -1,7 +1,7 @@ # # spec file for package firewalld # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -43,14 +43,14 @@ BuildRequires: docbook-xsl-stylesheets # Adding tools to BuildRequires as well so they can be autodetected # Else the configure tool will set them to /bin/false BuildRequires: fdupes +BuildRequires: ebtables BuildRequires: gettext BuildRequires: glib2-devel BuildRequires: gobject-introspection BuildRequires: hicolor-icon-theme BuildRequires: intltool -BuildRequires: iptables -BuildRequires: ebtables BuildRequires: ipset +BuildRequires: iptables BuildRequires: libxslt-tools BuildRequires: python3-devel BuildRequires: systemd-rpm-macros @@ -208,6 +208,12 @@ for _f in %{?modprobe_d_files}; do [ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \ mv -f "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}.rpmsave.old" || : done +%if 0%{?suse_version} > 1500 +# Prepare for migration to /usr/etc; save any old .rpmsave +for i in logrotate.d/firewalld ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i}.rpmsave.old ||: +done +%endif %post %service_add_post firewalld.service @@ -229,6 +235,12 @@ for _f in %{?modprobe_d_files}; do [ ! -f "/etc/modprobe.d/${_f}.rpmsave" ] || \ mv -fv "/etc/modprobe.d/${_f}.rpmsave" "/etc/modprobe.d/${_f}" || : done +%if 0%{?suse_version} > 1500 +# Migration to /usr/etc, restore just created .rpmsave +for i in logrotate.d/firewalld ; do + test -f %{_sysconfdir}/${i}.rpmsave && mv -v %{_sysconfdir}/${i}.rpmsave %{_sysconfdir}/${i} ||: +done +%endif %post -n firewall-applet /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :