summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dfc2d20)
raw | patch | inline | side by side (parent: dfc2d20)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Jan 2008 08:53:43 +0000 (08:53 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 23 Jan 2008 08:53:43 +0000 (08:53 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8550 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/update-gosa | patch | blob | history |
diff --git a/gosa-core/update-gosa b/gosa-core/update-gosa
index 3a3a207680fd06851a4fbd2bcfd6afa4e6919983..e94948b24d3d06bc38a2775f586e04eb44ca4681 100755 (executable)
--- a/gosa-core/update-gosa
+++ b/gosa-core/update-gosa
function parse_ini($file)
{
- global $description, $provides, $depends;
+ global $description, $provides, $depends, $versions, $conflicts;
$res= "";
if (file_exists($file)){
$res= $plugin['name'];
$provides[$res]= $plugin[$res];
$description[$res]= $plugin['description'];
+ $versions[$res]= $plugin['version'];
if (isset($plugin['depends'])){
$depends[$res]= explode(',', preg_replace('/\s+/', '', $plugin['depends']));
}
+ if (isset($plugin['conflicts'])){
+ $conflicts[$res]= explode(',', preg_replace('/\s+/', '', $plugin['conflicts']));
+ }
}
}
}
foreach ($dir as $entry){
if ($dir->isDir() && !preg_match('/^\./', $dir->__toString())){
$file= $dir->getPathName()."/plugin.dsc";
- if (!parse_ini($file)){
+ if (parse_ini($file) == ""){
echo "! Warning: plugin ".$dir->getPathName()." is missing declarations\n";
}
}
function list_plugins()
{
- global $description;
+ global $description, $versions;
$count= 0;
/* Load plugin list */
/* Show plugins */
foreach ($description as $name => $dsc){
if ($count == 0){
- echo "Plugin\t\t| Description\n";
- echo "------------------------------------------------------------------------\n";
+ echo "Plugin\t\t|Version |Description\n";
+ echo "----------------------------------------------------------------------------\n";
}
- echo "* $name\t\t| ".$dsc."\n";
+ $ver= $versions[$name];
+ echo "$name\t\t|$ver\t |$dsc\n";
$count++;
}
function install_plugin($file)
{
- global $description, $provides, $depends;
+ global $description, $provides, $depends, $conflicts;
/* Load plugin list */
load_plugins();
}
}
+ /* Check for conflicts */
+ foreach ($conflicts as $conf){
+ if (!in_array($conf, $provides)){
+ echo "! Warning: plugin conflicts with '$conf'\n\n";
+ }
+ }
+
/* Create plugstate directory and touch plugin.lst */
if (!mkdir (PLUGSTATE_DIR."/$name", 0755, TRUE)){
echo "Failed to create '".PLUGSTATE_DIR."/$name - aborted";
foreach ( $all as $entry ){
$source= $path."/".substr($entry->getPathName(), strlen($path) + 1);
+ /* Skip description - it belongs to the state dir */
+ if (preg_match('/\/plugin.dsc$/', $source)){
+ copy ($source, PLUGSTATE_DIR."/$name/plugin.dsc");
+ continue;
+ }
+
/* Skip well known directories */
if (preg_match('/^\.+$/', $source) || preg_match('/\/\.svn\//', $source)) {
continue;
/* Fill global values */
-$description= $provides= $depends= array();
+$description= $provides= $depends= $versions= $conflicts= array();
/* Action specified? */
if ($argc < 2){