diff options
author | Oliver Tappe | 2008-04-06 15:40:09 +0200 |
---|---|---|
committer | Oliver Tappe | 2008-04-06 15:40:09 +0200 |
commit | 5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d (patch) | |
tree | 036281d5a9b6d847c4bfc92f3c52f96a6ada2df0 /os-plugins/OpenSLX/OSPlugin | |
parent | * Instead of passing all known attributes of the current system into each plu... (diff) | |
download | core-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 'os-plugins/OpenSLX/OSPlugin')
-rw-r--r-- | os-plugins/OpenSLX/OSPlugin/Base.pm | 2 | ||||
-rw-r--r-- | os-plugins/OpenSLX/OSPlugin/Engine.pm | 40 |
2 files changed, 8 insertions, 34 deletions
diff --git a/os-plugins/OpenSLX/OSPlugin/Base.pm b/os-plugins/OpenSLX/OSPlugin/Base.pm index 9d4f6657..f974cdc0 100644 --- a/os-plugins/OpenSLX/OSPlugin/Base.pm +++ b/os-plugins/OpenSLX/OSPlugin/Base.pm @@ -303,7 +303,7 @@ sub copyRequiredFilesIntoInitramfs { my $self = shift; my $targetPath = shift; - my $attrs = shift; + my $attrs = shift; my $makeInitRamFSEngine = shift; return; diff --git a/os-plugins/OpenSLX/OSPlugin/Engine.pm b/os-plugins/OpenSLX/OSPlugin/Engine.pm index 6a587afd..091cd135 100644 --- a/os-plugins/OpenSLX/OSPlugin/Engine.pm +++ b/os-plugins/OpenSLX/OSPlugin/Engine.pm @@ -462,39 +462,13 @@ sub _loadPlugin # if there's a distro folder, instantiate the most appropriate distro class my $distro; if (-d "$self->{'plugin-path'}/OpenSLX/Distro") { - unshift @INC, $self->{'plugin-path'}; - my $distroName = $self->distroName(); - $distroName =~ tr{.-}{__}; - my @distroModules; - while($distroName =~ m{^(.+)_[^_]*$}) { - push @distroModules, $distroName; - $distroName = $1; - } - push @distroModules, $distroName; - push @distroModules, 'Base'; - for my $distroModule (@distroModules) { - my $loaded = eval { - vlog(1, "trying distro-module $distroModule..."); - $distro = instantiateClass( - 'OpenSLX::Distro::' . $distroModule, - { - pathToClass => $self->{'plugin-path'}, - acceptMissing => 1, - } - ); - return 0 if !$distro; - vlog(1, "using $distroModule."); - 1; - }; - last if $loaded; - if (!defined $loaded) { - vlog(0, _tr( - "Error when trying to load distro module '%s':\n%s", - $distroModule, $@ - )); - } - } - shift @INC; + my $pluginBasePath = "$openslxConfig{'base-path'}/lib/plugins"; + my $distroScope = $plugin->{name} . '::OpenSLX::Distro'; + $distro = loadDistroModule({ + distroName => $self->distroName(), + distroScope => $distroScope, + pathToClass => $pluginBasePath, + }); if (!$distro) { die _tr( 'unable to load any distro module for vendor-OS %s in plugin %s', |