summaryrefslogtreecommitdiffstats
path: root/openlmi-providers.spec
diff options
context:
space:
mode:
authorRadek Novacek <rnovacek@redhat.com>2014-01-14 10:29:01 +0100
committerRadek Novacek <rnovacek@redhat.com>2014-01-21 15:40:04 +0100
commit8ef9b8fb289d287f7000c5c9f30568f76e0de94a (patch)
tree091fcac777240f14def4ee55c5302b8cfa8e21de /openlmi-providers.spec
parent5db061fb6aa8aa5c6f77bc0a9d04d35ccfdaeb82 (diff)
downloadopenlmi-providers-8ef9b8fb289d287f7000c5c9f30568f76e0de94a.tar.gz
openlmi-providers-8ef9b8fb289d287f7000c5c9f30568f76e0de94a.tar.xz
openlmi-providers-8ef9b8fb289d287f7000c5c9f30568f76e0de94a.zip
spec: fix openlmi-pcp spec scripts
This commit disables automatic registration of openlmi-pcp because the mof and reg files don't exist when package is installed It also adds a check if the openlmi-pcp provider is installed when uninstalling.
Diffstat (limited to 'openlmi-providers.spec')
-rw-r--r--openlmi-providers.spec30
1 files changed, 14 insertions, 16 deletions
diff --git a/openlmi-providers.spec b/openlmi-providers.spec
index d7ba7e9..bd8d88a 100644
--- a/openlmi-providers.spec
+++ b/openlmi-providers.spec
@@ -837,10 +837,13 @@ fi >> %logfile 2>&1
%pre -n openlmi-pcp
if [ "$1" -gt 1 ]; then
- %{_bindir}/openlmi-mof-register -v %{providers_version} unregister \
- %{_datadir}/%{name}/60_LMI_PCP.mof \
- %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof \
- %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg || :;
+ # Only unregister when the provider was already registered
+ if [ -e %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof ]; then
+ %{_bindir}/openlmi-mof-register -v %{providers_version} unregister \
+ %{_datadir}/%{name}/60_LMI_PCP.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg || :;
+ fi
fi >> %logfile 2>&1
%pre -n openlmi-journald
@@ -931,14 +934,6 @@ if [ "$1" -ge 1 ]; then
%{_datadir}/%{name}/90_LMI_Hardware_Profile_DMTF.mof || :;
fi >> %logfile 2>&1
-%post -n openlmi-pcp
-if [ "$1" -ge 1 ]; then
- %{_bindir}/openlmi-mof-register -v %{providers_version} register \
- %{_datadir}/%{name}/60_LMI_PCP.mof \
- %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof \
- %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg || :;
-fi >> %logfile 2>&1
-
%post -n openlmi-journald
if [ "$1" -ge 1 ]; then
%{_bindir}/openlmi-mof-register -v %{providers_version} register \
@@ -1029,10 +1024,13 @@ fi >> %logfile 2>&1
%preun -n openlmi-pcp
if [ "$1" -eq 0 ]; then
- %{_bindir}/openlmi-mof-register -v %{providers_version} unregister \
- %{_datadir}/%{name}/60_LMI_PCP.mof \
- %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof \
- %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg || :;
+ # Only unregister when the provider was already registered
+ if [ -e %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof ]; then
+ %{_bindir}/openlmi-mof-register -v %{providers_version} unregister \
+ %{_datadir}/%{name}/60_LMI_PCP.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg || :;
+ fi
fi >> %logfile 2>&1
%preun -n openlmi-journald