summaryrefslogtreecommitdiffstats
path: root/installer/OpenSLX/OSExport
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
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')
-rw-r--r--installer/OpenSLX/OSExport/Distro/Any.pm4
-rw-r--r--installer/OpenSLX/OSExport/Distro/Base.pm5
-rw-r--r--installer/OpenSLX/OSExport/Distro/Debian.pm4
-rw-r--r--installer/OpenSLX/OSExport/Distro/Fedora.pm4
-rw-r--r--installer/OpenSLX/OSExport/Distro/Gentoo.pm4
-rw-r--r--installer/OpenSLX/OSExport/Distro/Suse.pm (renamed from installer/OpenSLX/OSExport/Distro/SUSE.pm)6
-rw-r--r--installer/OpenSLX/OSExport/Distro/Ubuntu.pm4
-rw-r--r--installer/OpenSLX/OSExport/Engine.pm41
8 files changed, 29 insertions, 43 deletions
diff --git a/installer/OpenSLX/OSExport/Distro/Any.pm b/installer/OpenSLX/OSExport/Distro/Any.pm
index 59de2f32..b5f46366 100644
--- a/installer/OpenSLX/OSExport/Distro/Any.pm
+++ b/installer/OpenSLX/OSExport/Distro/Any.pm
@@ -8,8 +8,8 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# Any.pm
-# - provides generic overrides of the OpenSLX OSExport API.
+# OSExport/Distro/Any.pm
+# - provides generic overrides of the OSExport Distro API.
# -----------------------------------------------------------------------------
package OpenSLX::OSExport::Distro::Any;
diff --git a/installer/OpenSLX/OSExport/Distro/Base.pm b/installer/OpenSLX/OSExport/Distro/Base.pm
index b6fc1fae..1b3edb63 100644
--- a/installer/OpenSLX/OSExport/Distro/Base.pm
+++ b/installer/OpenSLX/OSExport/Distro/Base.pm
@@ -8,9 +8,8 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# Base.pm
-# - provides empty base of the distro-specific part of the OpenSLX
-# OSExport API.
+# OSExport/Distro/Base.pm
+# - provides base implementation of the OSExport Distro API.
# -----------------------------------------------------------------------------
package OpenSLX::OSExport::Distro::Base;
diff --git a/installer/OpenSLX/OSExport/Distro/Debian.pm b/installer/OpenSLX/OSExport/Distro/Debian.pm
index d1ae7d88..b764ab4f 100644
--- a/installer/OpenSLX/OSExport/Distro/Debian.pm
+++ b/installer/OpenSLX/OSExport/Distro/Debian.pm
@@ -8,8 +8,8 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# Debian.pm
-# - provides Debian-specific overrides of the OpenSLX OSExport API.
+# OSExport/Distro/Debian.pm
+# - provides Debian-specific overrides of the OSExport Distro API.
# -----------------------------------------------------------------------------
package OpenSLX::OSExport::Distro::Debian;
diff --git a/installer/OpenSLX/OSExport/Distro/Fedora.pm b/installer/OpenSLX/OSExport/Distro/Fedora.pm
index 4e8c0bf0..4c196bd1 100644
--- a/installer/OpenSLX/OSExport/Distro/Fedora.pm
+++ b/installer/OpenSLX/OSExport/Distro/Fedora.pm
@@ -8,8 +8,8 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# Fedora.pm
-# - provides Fedora-specific overrides of the OpenSLX OSExport API.
+# OSExport/Distro/Fedora.pm
+# - provides Fedora-specific overrides of the OSExport Distro API.
# -----------------------------------------------------------------------------
package OpenSLX::OSExport::Distro::Fedora;
diff --git a/installer/OpenSLX/OSExport/Distro/Gentoo.pm b/installer/OpenSLX/OSExport/Distro/Gentoo.pm
index 1df759dd..79fa2210 100644
--- a/installer/OpenSLX/OSExport/Distro/Gentoo.pm
+++ b/installer/OpenSLX/OSExport/Distro/Gentoo.pm
@@ -8,8 +8,8 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# Gentoo.pm
-# - provides Gentoo-specific overrides of the OpenSLX OSExport API.
+# OSExport/Distro/Gentoo.pm
+# - provides Gentoo-specific overrides of the OSExport Distro API.
# -----------------------------------------------------------------------------
package OpenSLX::OSExport::Distro::Gentoo;
diff --git a/installer/OpenSLX/OSExport/Distro/SUSE.pm b/installer/OpenSLX/OSExport/Distro/Suse.pm
index 7f5d5548..c3392f11 100644
--- a/installer/OpenSLX/OSExport/Distro/SUSE.pm
+++ b/installer/OpenSLX/OSExport/Distro/Suse.pm
@@ -8,10 +8,10 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# SUSE.pm
-# - provides SUSE-specific overrides of the OpenSLX OSExport API.
+# OSExport/Distro/Suse.pm
+# - provides SUSE-specific overrides of the OSExport Distro API.
# -----------------------------------------------------------------------------
-package OpenSLX::OSExport::Distro::SUSE;
+package OpenSLX::OSExport::Distro::Suse;
use strict;
use warnings;
diff --git a/installer/OpenSLX/OSExport/Distro/Ubuntu.pm b/installer/OpenSLX/OSExport/Distro/Ubuntu.pm
index 0f60b63f..c488ffdf 100644
--- a/installer/OpenSLX/OSExport/Distro/Ubuntu.pm
+++ b/installer/OpenSLX/OSExport/Distro/Ubuntu.pm
@@ -8,8 +8,8 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# Ubuntu.pm
-# - provides Ubuntu-specific overrides of the OpenSLX OSExport API.
+# OSExport/Distro/Ubuntu.pm
+# - provides Ubuntu-specific overrides of the OSExport Distro API.
# -----------------------------------------------------------------------------
package OpenSLX::OSExport::Distro::Ubuntu;
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;