Now yum upgrade will deregister the virt classes, make
libvirt-cim not workable. This patch fixed it from now on.
Signed-off-by: Wenchao Xia <xiawenc(a)linux.vnet.ibm.com>
---
libvirt-cim.spec.in | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in
index d78eee7..3def978 100644
--- a/libvirt-cim.spec.in
+++ b/libvirt-cim.spec.in
@@ -104,18 +104,22 @@ rm -fr $RPM_BUILD_ROOT
-r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
%preun
-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
+#Deregister only in uninstall, do nothing in upgrade.
+if [ "$1" = "0" ]; then
+ echo "Deleting registered classes in libvirt-cim..."
+ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n @CIM_VIRT_NS@ \
-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
+ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/interop \
-r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true
-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
+ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/PG_InterOp \
-r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true
-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
+ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/cimv2 \
-r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true
+fi
%postun -p /sbin/ldconfig
--
1.7.1
Show replies by date