From 11397ed657348bbc6d79db23e67cedd470f10b011f36a0147547f9a4e98af8f3 Mon Sep 17 00:00:00 2001 From: Nicolas Morey-Chaisemartin Date: Thu, 6 Sep 2018 15:42:12 +0000 Subject: [PATCH] Accepting request 633761 from home:NMoreyChaisemartin:branches:science:HPC - Fix handling of mpi-selector during updates (bsc#1098653) OBS-URL: https://build.opensuse.org/request/show/633761 OBS-URL: https://build.opensuse.org/package/show/science:HPC/mvapich2?expand=0&rev=47 --- mvapich2.changes | 5 +++++ mvapich2.spec | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) 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