@@ -197,8 +197,6 @@ find $RPM_BUILD_ROOT -name "*.a" -exec %__rm -f {} \;
197197%{_mandir}/man7/authselect-migration.7*
198198%{_sysconfdir}/bash_completion.d/authselect-completion.sh
199199
200- %global forcefile %{_localstatedir}/lib/rpm-state/%{name}.force
201-
202200%preun
203201if [ $1 == 0 ] ; then
204202 # Remove authselect symbolic links so all authselect files can be
@@ -208,16 +206,7 @@ if [ $1 == 0 ] ; then
208206 %{_bindir}/authselect opt-out
209207fi
210208
211- %pre libs
212- # Check if this is a new installation.
213- %__rm -f %{forcefile}
214- if [ $1 -eq 1 ] ; then
215- touch %{forcefile}
216- fi
217- exit 0
218-
219209%posttrans libs
220-
221210# Keep nss-altfiles for all rpm-ostree based systems.
222211# See https://github.com/authselect/authselect/issues/48
223212if test -e /run/ostree-booted; then
@@ -227,18 +216,13 @@ if test -e /run/ostree-booted; then
227216 done
228217fi
229218
230- %{_bindir}/authselect check &> /dev/null
231- if [ $? -eq 6 ]; then
232- NOBACKUP="--nobackup"
233- fi
234-
235219# If this is a new installation select the default configuration.
236- if [ -f %{forcefile} ] ; then
237- %{_bindir}/authselect select %{default_profile} --force $NOBACKUP &> /dev/null
238- %__rm -f %{forcefile}
220+ if [ $1 == 1 ] ; then
221+ %{_bindir}/authselect select %{default_profile} --force --nobackup &> /dev/null
222+ exit 0
239223fi
240224
241- # Minimal profile was removed. Switch to local.
225+ # Minimal profile was removed. Switch to local during upgrade .
242226%__sed -i '1 s/^minimal$/local/' %{_sysconfdir}/authselect/authselect.conf
243227for file in %{_sysconfdir}/authselect/custom/*/*; do
244228 link=`%{_bindir}/readlink "$file"`
0 commit comments