diff --git a/mvapich2.changes b/mvapich2.changes index f20dc5b..8e14bf7 100644 --- a/mvapich2.changes +++ b/mvapich2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 5 06:54:33 UTC 2018 - nmoreychaisemartin@suse.com + +- Fix handling of mpi-selector during updates (bsc#1098653) + ------------------------------------------------------------------- Sun Aug 19 09:21:45 UTC 2018 - eich@suse.com diff --git a/mvapich2.spec b/mvapich2.spec index cdeaabc..258cc2b 100644 --- a/mvapich2.spec +++ b/mvapich2.spec @@ -429,8 +429,10 @@ mkdir -p %{buildroot}%{_sysconfdir}/rpm %post /sbin/ldconfig %if %{without hpc} +# Always register. We might be already registered in the case of an udate +# but mpi-selector handles it fine /usr/bin/mpi-selector \ - --register %{name}%{?pack_suff}-%{version} \ + --register %{name}%{?pack_suff} \ --source-dir %{p_bindir} \ --yes %endif @@ -438,7 +440,14 @@ mkdir -p %{buildroot}%{_sysconfdir}/rpm %postun /sbin/ldconfig %if %{without hpc} -/usr/bin/mpi-selector --unregister %{name}%{?pack_suff}-%{version} --yes --silent +# Only unregister when uninstalling +if [ "$1" == "0" ]; then + /usr/bin/mpi-selector --unregister %{name}%{?pack_suff} --yes + # Deregister the default if we are uninstalling it + if [ "$(/usr/bin/mpi-selector --system --query)" == "%{name}%{?pack_suff}"]; then + /usr/bin/mpi-selector --system --unset --yes + fi +fi %else %hpc_module_delete_if_default %endif