[samba] Fix downgrade with alternatives.

asn asn at fedoraproject.org
Wed Nov 26 09:32:58 UTC 2014


commit 8745bd9ea6b02d8b67f97c163c1deb79b10952a9
Author: Andreas Schneider <asn at cryptomilk.org>
Date:   Wed Nov 26 10:32:16 2014 +0100

    Fix downgrade with alternatives.

 samba.spec |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/samba.spec b/samba.spec
index e846496..a5cd33b 100644
--- a/samba.spec
+++ b/samba.spec
@@ -724,7 +724,16 @@ fi
                                 libwbclient.so%{libwbc_alternatives_suffix} %{_libdir}/samba/wbclient/libwbclient.so 10
 
 %preun -n libwbclient-devel
-%{_sbindir}/update-alternatives --remove libwbclient.so%{libwbc_alternatives_suffix} %{_libdir}/samba/wbclient/libwbclient.so
+# alternatives checks if the file which should be removed is a link or not, but
+# not if it points to the /etc/alternatives directory or to some other place.
+# When downgrading to a version where alternatives is not used and
+# libwbclient.so is a link and not a file it will be removed. The following
+# check removes the alternatives files manually if that is the case.
+if [ "`readlink %{_libdir}/libwbclient.so`" == "libwbclient.so.0.11" ]; then
+    /bin/rm -f /etc/alternatives/libwbclient.so%{libwbc_alternatives_suffix} /var/lib/alternatives/libwbclient.so%{libwbc_alternatives_suffix} 2> /dev/null
+else
+    %{_sbindir}/update-alternatives --remove libwbclient.so%{libwbc_alternatives_suffix} %{_libdir}/samba/wbclient/libwbclient.so
+fi
 
 %endif # with_libwbclient
 


More information about the scm-commits mailing list