summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSSetup/Engine.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-02-17 18:48:04 +0100
committerOliver Tappe2008-02-17 18:48:04 +0100
commit8d00be232670bf074e79ea8960dd2a1484bb87b8 (patch)
treed4304501db1aa968ae3c39f6f675122426c97de9 /installer/OpenSLX/OSSetup/Engine.pm
parent* added support to listing the plugins that have been installed into a (diff)
downloadcore-8d00be232670bf074e79ea8960dd2a1484bb87b8.tar.gz
core-8d00be232670bf074e79ea8960dd2a1484bb87b8.tar.xz
core-8d00be232670bf074e79ea8960dd2a1484bb87b8.zip
* Added support to slxos-setup for automatically installing the default set of
plugins (or the already defined set of plugins of an existing vendor-OS). This way, updating a vendor-OS (which might pull a new kernel) will automatically trigger the reinstallation of all plugins that had previously been installed in that vendor-OS. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1559 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSSetup/Engine.pm')
-rw-r--r--installer/OpenSLX/OSSetup/Engine.pm57
1 files changed, 55 insertions, 2 deletions
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm
index 914045fc..aeeb377d 100644
--- a/installer/OpenSLX/OSSetup/Engine.pm
+++ b/installer/OpenSLX/OSSetup/Engine.pm
@@ -440,6 +440,9 @@ sub updateVendorOS
0,
_tr("Vendor-OS '%s' updated succesfully.\n", $self->{'vendor-os-name'})
);
+
+ $self->_installPlugins();
+
return;
}
@@ -502,7 +505,7 @@ sub callChrootedFunctionForVendorOS
$self->_touchVendorOS();
vlog(
- 0,
+ 1,
_tr(
"Chrooted function for vendor-OS '%s' has finished.\n",
$self->{'vendor-os-name'}
@@ -551,6 +554,8 @@ sub addInstalledVendorOSToConfigDB
my $openslxDB = instantiateClass("OpenSLX::ConfigDB");
$openslxDB->connect();
+ my @plugins;
+
# insert new vendor-os if it doesn't already exist in DB:
my $vendorOSName = $self->{'vendor-os-name'};
my $vendorOS = $openslxDB->fetchVendorOSByFilter({'name' => $vendorOSName});
@@ -580,7 +585,7 @@ sub addInstalledVendorOSToConfigDB
}
}
else {
- my $data = {'name' => $vendorOSName,};
+ my $data = { 'name' => $vendorOSName };
if (length($self->{'clone-source'})) {
$data->{'clone_source'} = $self->{'clone-source'};
}
@@ -593,9 +598,15 @@ sub addInstalledVendorOSToConfigDB
$vendorOSName, $id
)
);
+ # install plugins from default vendor-OS into this new one
+ @plugins = $openslxDB->fetchInstalledPlugins(0);
}
$openslxDB->disconnect();
+
+ # now that we have the list of plugins, we (re-)install all of them:
+ $self->_installPlugins(\@plugins);
+
return;
}
@@ -1631,6 +1642,48 @@ sub _clone_determineIncludeExcludeList
return $includeExcludeList;
}
+sub _installPlugins
+{
+ my $self = shift;
+ my $plugins = shift;
+
+ my $isReInstall = 0;
+
+ if (!$plugins) {
+ $plugins = [];
+ my $openslxDB = instantiateClass("OpenSLX::ConfigDB");
+ $openslxDB->connect();
+ # fetch plugins from existing vendor-OS
+ my $vendorOS = $openslxDB->fetchVendorOSByFilter({
+ 'name' => $self->{'vendor-os-name'}
+ });
+ if ($vendorOS) {
+ push @$plugins, $openslxDB->fetchInstalledPlugins($vendorOS->{id});
+ $isReInstall = 1;
+ }
+ $openslxDB->disconnect();
+ }
+
+ return if ! @$plugins;
+
+ require OpenSLX::OSPlugin::Engine;
+ vlog(
+ 0,
+ $isReInstall
+ ? _tr("reinstalling plugins...\n")
+ : _tr("installing default plugins...\n")
+ );
+ for my $pluginName (@$plugins) {
+ my $pluginEngine = OpenSLX::OSPlugin::Engine->new();
+ vlog(0, _tr("\t%s\n", $pluginName));
+ $pluginEngine->initialize($pluginName, $self->{'vendor-os-name'});
+ $pluginEngine->installPlugin();
+ }
+ vlog(0, _tr("done with plugins.\n"));
+
+ return;
+}
+
################################################################################
### utility methods
################################################################################