From 94c4f7a4c9379a5cd0b24bbf0f8532ceb9c90f07 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Apr 09 2018 10:17:11 +0000 Subject: new upstream release (0.4) --- diff --git a/.gitignore b/.gitignore index c1ec88d..2454293 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /authselect-0.3.tar.gz /authselect-0.3.1.tar.gz /authselect-0.3.2.tar.gz +/authselect-0.4.tar.gz diff --git a/authselect.spec b/authselect.spec index 21d9209..66a32f1 100644 --- a/authselect.spec +++ b/authselect.spec @@ -1,5 +1,5 @@ Name: authselect -Version: 0.3.2 +Version: 0.4 Release: 1%{?dist} Summary: Configures authentication and identity sources from supported profiles URL: https://github.com/pbrezina/authselect @@ -136,7 +136,45 @@ find $RPM_BUILD_ROOT -name "*.a" -exec rm -f {} \; %{_mandir}/man8/authselect.8* %{_mandir}/man7/authselect-migration.7* +%global updatefile %{_localstatedir}/lib/rpm-state/%{name}.update-profile + +%pre libs +rm -f "%{updatefile}" +if [ $1 -gt 1 ] ; then + # Check that authselect cli is installed, otherwise there is nothing to do. + rpm -q %{name} &> /dev/null + if [ $? -ne 0 ] ; then + exit 0 + fi + + # This is an upgrade. Check that the current configuration is valid + # and store the information for later use in posttrans. The check must + # be done here (before profiles are updated), otherwise it would return + # an error if the new profile is different from the old one but selected. + %{_bindir}/authselect check &> /dev/null + if [ $? -eq 0 ]; then + touch "%{updatefile}" + fi +fi + +exit 0 + +%posttrans libs +if [ -f "%{updatefile}" ]; then + # This is an upgrade. Update current profile if possible. + PROFILE=`%{_bindir}/authselect current --raw` + if [ $? -eq 0 ]; then + %{_bindir}/authselect select $PROFILE --force &> /dev/null + fi + rm -f "%{updatefile}" +fi + +exit 0 + %changelog +* Mon Apr 9 2018 Pavel Březina - 0.4-1 +- rebasing to 0.4 + * Tue Mar 6 2018 Pavel Březina - 0.3.2-1 - rebasing to 0.3.2 - authselect-compat now only suggests packages, not recommends diff --git a/sources b/sources index cf5e47e..b336ef7 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (authselect-0.3.2.tar.gz) = cff1a5cb4b78cb7d69814849c4554e1707028b8f634521902cae2be3cf6b60362728d24322df6536f0a5b67da6e1feca13125eb3afa711524c499102090c5aa8 +SHA512 (authselect-0.4.tar.gz) = 5d2ed1080943f270dcfe9825f3d81bf471860648846729ca2b0847f659fbc84558abaab0570a600a9dc8d896832404da94058085237c8ee9be1fcf5a6e4fd212