X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fupdate-gosa;h=186947d5afd344da366bd9848bf60c923afd40c9;hb=b382319f3d9e2fce951386ca25e577ada368084f;hp=de343937cd9aa74e1a39fdcfa2dfc2e90e383213;hpb=7ae2da9e21e5148385a41863bdbf64dcb182cd55;p=gosa.git diff --git a/gosa-core/update-gosa b/gosa-core/update-gosa index de343937c..186947d5a 100755 --- a/gosa-core/update-gosa +++ b/gosa-core/update-gosa @@ -290,7 +290,14 @@ function install_plugin($file) /* Check if dependencies are fullfilled */ foreach ($depends as $dep){ - if (!in_array($dep, $provides)){ + $found= false; + foreach ($provides as $provide => $dummy){ + if ($dep == $provide){ + $found= true; + break; + } + } + if (!$found){ echo "! Error: plugin depends on '$dep', but this is not installed\n\n"; exit (3); } @@ -375,7 +382,7 @@ function install_plugin($file) function remove_plugin($name) { - global $description; + global $description, $depends; /* Load plugin list */ load_plugins(); @@ -386,6 +393,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";