diff options
author | Oliver Tappe | 2008-07-23 20:27:33 +0200 |
---|---|---|
committer | Oliver Tappe | 2008-07-23 20:27:33 +0200 |
commit | c13e5631307f48236be9155aea76fc9951741020 (patch) | |
tree | 8b864474bc810a039df5bfec4cb4f67b6ac18c84 /installer/OpenSLX/OSSetup/Engine.pm | |
parent | vmchooser changes: (diff) | |
download | core-c13e5631307f48236be9155aea76fc9951741020.tar.gz core-c13e5631307f48236be9155aea76fc9951741020.tar.xz core-c13e5631307f48236be9155aea76fc9951741020.zip |
implemented plugin dependency handling:
* installing a plugin into a vendor-OS is now only possible when required
plugins are already installed
* removing a plugin from a vendor-OS is now only possible when now plugins
that depend on this one are still installed
* the config-demuxer will check the plugin depedency hierarchy and bail if
any plugin is missing
* when several plugins are being auto-installed (e.g. when copying all
plugins from the '<<<default>>>' vendor-OS) the order of the plugins is
adjusted to comply with the dependency hierarchy
* declared one single dependency: vmchooser depends on vmware (please shout
if that is incorrect)
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1936 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSSetup/Engine.pm')
-rw-r--r-- | installer/OpenSLX/OSSetup/Engine.pm | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 66c03c85..31a3eb28 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -1699,7 +1699,7 @@ sub _installPlugins } return if ! @$plugins; - + require OpenSLX::OSPlugin::Engine; vlog( 0, @@ -1707,7 +1707,11 @@ sub _installPlugins ? _tr("reinstalling plugins...\n") : _tr("installing default plugins...\n") ); - for my $pluginInfo (@$plugins) { + for my $pluginInfo ( + sort { + $self->_sortPluginsByDependency($a->{plugin_name}, $b->{plugin_name}); + } @$plugins + ) { my $pluginName = $pluginInfo->{plugin_name}; my $pluginEngine = OpenSLX::OSPlugin::Engine->new(); vlog(0, _tr("\t%s\n", $pluginName)); @@ -1721,6 +1725,23 @@ sub _installPlugins return; } +sub _sortPluginsByDependency +{ + my $self = shift; + my $pluginNameA = shift; + my $pluginNameB = shift; + + my $pluginA = OpenSLX::OSPlugin::Roster->getPlugin($pluginNameA); + if ($pluginA->dependsOnPlugin($pluginNameB)) { + return 1; + } + my $pluginB = OpenSLX::OSPlugin::Roster->getPlugin($pluginNameB); + if ($pluginB->dependsOnPlugin($pluginNameA)) { + return -1; + } + return 0; +} + ################################################################################ ### utility methods ################################################################################ |