From 3cdb8ffacef094feffc823e8aa3472bb29e90849 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Mar 17 2020 16:09:29 +0000 Subject: Do not remove mdns from nsswitch.conf during upgrade %post needs to be moved to %posttrans in order to fix the issue since %postun is run from the old buggy package. --- diff --git a/nss-mdns.spec b/nss-mdns.spec index 2746966..8320cfb 100644 --- a/nss-mdns.spec +++ b/nss-mdns.spec @@ -1,6 +1,6 @@ Name: nss-mdns Version: 0.14.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: glibc plugin for .local name resolution License: LGPLv2+ @@ -40,6 +40,7 @@ rm -rf $RPM_BUILD_ROOT %post %{?ldconfig} +%posttrans function mod_nss() { if [ -f "$1" ] ; then # sed-fu to add mdns4_minimal to the hosts line of /etc/nsswitch.conf @@ -73,15 +74,17 @@ function mod_nss() { fi } -FILE="$(readlink /etc/nsswitch.conf || echo /etc/nsswitch.conf)" -if [ "$FILE" = "/etc/authselect/nsswitch.conf" ] && authselect check &>/dev/null; then - mod_nss "/etc/authselect/user-nsswitch.conf" - authselect apply-changes &> /dev/null || : -else - mod_nss "$FILE" - # also apply the same changes to user-nsswitch.conf to affect - # possible future authselect configuration - mod_nss "/etc/authselect/user-nsswitch.conf" +if [ "$1" -eq 0 ] ; then + FILE="$(readlink /etc/nsswitch.conf || echo /etc/nsswitch.conf)" + if [ "$FILE" = "/etc/authselect/nsswitch.conf" ] && authselect check &>/dev/null; then + mod_nss "/etc/authselect/user-nsswitch.conf" + authselect apply-changes &> /dev/null || : + else + mod_nss "$FILE" + # also apply the same changes to user-nsswitch.conf to affect + # possible future authselect configuration + mod_nss "/etc/authselect/user-nsswitch.conf" + fi fi %ldconfig_postun @@ -94,6 +97,9 @@ fi %changelog +* Tue Mar 17 2020 Pavel Březina - 0.14.1-7 +- Do not remove mdns from nsswitch.conf during upgrade + * Wed Jan 29 2020 Fedora Release Engineering - 0.14.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild