From 2015b4fddd0b4899b4ec3c4bb960a39f833b62f7 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Tue, 5 Apr 2011 15:20:10 +0200 Subject: [PATCH] Fail template package remove if there are VMs based on it (#154) And remove DispVM based on it. --- templates.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/templates.spec b/templates.spec index 5b1499a..e8ba689 100644 --- a/templates.spec +++ b/templates.spec @@ -115,7 +115,12 @@ qvm-template-commit %{template_name} %preun if [ "$1" = 0 ] ; then # 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