From cd14033a90e07b37860a4932c5ccbbc5d85e342c Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 24 Jan 2008 07:28:24 +0000 Subject: [PATCH] Added dependency check when removing a plugin git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8573 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/update-gosa | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gosa-core/update-gosa b/gosa-core/update-gosa index de343937c..9d3b2738d 100755 --- a/gosa-core/update-gosa +++ b/gosa-core/update-gosa @@ -375,7 +375,7 @@ function install_plugin($file) function remove_plugin($name) { - global $description; + global $description, $depends; /* Load plugin list */ load_plugins(); @@ -386,6 +386,14 @@ function remove_plugin($name) exit (1); } + /* Depends? */ + foreach ($depends as $sname => $pl_depends){ + if (!in_array($name, $pl_depends)){ + echo "! Error: plugin '$sname' depends on '$name' - cannot remove it\n\n"; + exit (1); + } + } + /* Load information */ if (!file_exists(PLUGSTATE_DIR."/$name/plugin.lst")){ echo "! Error: cannot remove plugin '$name' - no install history found\n\n"; -- 2.30.2