From: cajus Date: Thu, 24 Jan 2008 07:28:24 +0000 (+0000) Subject: Added dependency check when removing a plugin X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cd14033a90e07b37860a4932c5ccbbc5d85e342c;p=gosa.git Added dependency check when removing a plugin git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8573 594d385d-05f5-0310-b6e9-bd551577e9d8 --- 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";