Fail template package remove if there are VMs based on it (#154)

And remove DispVM based on it.
This commit is contained in:
Marek Marczykowski 2011-04-05 15:20:10 +02:00
parent bdaba2ddca
commit 2015b4fddd

View File

@ -115,7 +115,12 @@ qvm-template-commit %{template_name}
%preun %preun
if [ "$1" = 0 ] ; then if [ "$1" = 0 ] ; then
# no more packages left # no more packages left
qvm-remove -q --just-db %{template_name} # First remove DispVM template (even if not exists...)
qvm-remove -q %{template_name}-dvm
if ! qvm-remove -q --just-db %{template_name}; then
exit 1
fi
# we need to have it here, because rpm -U <template> # we need to have it here, because rpm -U <template>
# apparently executes %preun of the old package *after* %post of the new packages... # apparently executes %preun of the old package *after* %post of the new packages...