From eacc4f7ab66fd24cf91b171907f3757a3527bff4b1f2af3a9a18c5cac8825d79 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 29 Aug 2018 07:43:41 +0000 Subject: [PATCH] Only call u-a remove when the package is completely going away OBS-URL: https://build.opensuse.org/package/show/security:netfilter/iptables?expand=0&rev=107 --- iptables.spec | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/iptables.spec b/iptables.spec index fea32a8..6e78faf 100644 --- a/iptables.spec +++ b/iptables.spec @@ -191,7 +191,9 @@ update-alternatives \ --slave "%_sbindir/ip6tables-save" ip6tables-save "%_sbindir/xtables-legacy-multi" %postun -update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" +if test "$1" = 0; then + update-alternatives --remove iptables "%_sbindir/xtables-legacy-multi" +fi %post backend-nft update-alternatives \ @@ -209,9 +211,11 @@ update-alternatives --install "%_sbindir/ebtables" ebtables "%_sbindir/xtables-n --slave "%_sbindir/ebtables-save" ebtables-save "%_sbindir/xtables-nft-multi" %postun backend-nft -update-alternatives --remove iptables "%_sbindir/xtables-nft-multi" -update-alternatives --remove arptables "%_sbindir/xtables-nft-multi" -update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" +if test "$1" = 0; then + update-alternatives --remove iptables "%_sbindir/xtables-nft-multi" + update-alternatives --remove arptables "%_sbindir/xtables-nft-multi" + update-alternatives --remove ebtables "%_sbindir/xtables-nft-multi" +fi %post -n libipq0 -p /sbin/ldconfig %postun -n libipq0 -p /sbin/ldconfig