summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSExport/Engine.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-04-06 15:40:09 +0200
committerOliver Tappe2008-04-06 15:40:09 +0200
commit5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d (patch)
tree036281d5a9b6d847c4bfc92f3c52f96a6ada2df0 /installer/OpenSLX/OSExport/Engine.pm
parent* Instead of passing all known attributes of the current system into each plu... (diff)
downloadcore-5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d.tar.gz
core-5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d.tar.xz
core-5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d.zip
* made names of distro module consistent across OpenSLX - now the always start with
a capital letter followed by all lowercase (Debian, Fedora, Gentoo, Suse, Ubuntu) * refactored loading of distro modules into a separate function (loadDistroModule() in Basics.pm) * finished support to logging to a file in syslog plugin * worked at desktop plugin (still not working, though) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1721 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer/OpenSLX/OSExport/Engine.pm')
-rw-r--r--installer/OpenSLX/OSExport/Engine.pm41
1 files changed, 14 insertions, 27 deletions
diff --git a/installer/OpenSLX/OSExport/Engine.pm b/installer/OpenSLX/OSExport/Engine.pm
index 7aba36da..60777f07 100644
--- a/installer/OpenSLX/OSExport/Engine.pm
+++ b/installer/OpenSLX/OSExport/Engine.pm
@@ -24,7 +24,7 @@ use Exporter;
@EXPORT = qw(
%supportedExportFileSystems %supportedExportBlockDevices
- @supportedExportTypes %supportedDistros
+ @supportedExportTypes
);
use File::Basename;
@@ -34,7 +34,7 @@ use OpenSLX::Utils;
our (
%supportedExportFileSystems, %supportedExportBlockDevices,
- @supportedExportTypes, %supportedDistros
+ @supportedExportTypes,
);
%supportedExportFileSystems = (
@@ -55,15 +55,6 @@ our (
'sqfs-nbd',
);
-%supportedDistros = (
- '<any>' => {module => 'Any'},
- 'debian' => {module => 'Debian'},
- 'fedora' => {module => 'Fedora'},
- 'gentoo' => {module => 'Gentoo'},
- 'suse' => {module => 'SUSE'},
- 'ubuntu' => {module => 'Ubuntu'},
-);
-
################################################################################
### interface methods
################################################################################
@@ -213,25 +204,21 @@ sub _initialize
$self->{'export-name'} = $exportName;
$self->{'export-type'} = $exportType;
$vendorOSName =~ m[^(.+?\-[^-]+)];
- my $distroName = $1;
- $self->{'distro-name'} = $distroName;
+ $self->{'distro-name'} = lc($1);
+ my $distroName = ucfirst(lc($1));
# load module for the requested distro:
- if (!exists $supportedDistros{lc($distroName)}) {
- # try without _x86_64:
- $distroName =~ s[_x86_64$][];
- if (!exists $supportedDistros{lc($distroName)}) {
- # try basic distro-type (e.g. debian or suse):
- $distroName =~ s[-.+$][];
- if (!exists $supportedDistros{lc($distroName)}) {
- # fallback to generic implementation:
- $distroName = '<any>';
- }
- }
+ my $distro = loadDistroModule({
+ distroName => $distroName,
+ distroScope => 'OpenSLX::OSExport::Distro',
+ fallbackName => 'Any',
+ });
+ if (!$distro) {
+ die _tr(
+ 'unable to load any OSExport::Distro module for vendor-OS %s!',
+ $vendorOSName
+ );
}
- my $distroModuleName = $supportedDistros{lc($distroName)}->{module};
- my $distro =
- instantiateClass("OpenSLX::OSExport::Distro::$distroModuleName");
$distro->initialize($self);
$self->{distro} = $distro;