From 5a8c8a1638eea2ff6897046fcbc94bb42ccbe94d Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sun, 6 Apr 2008 13:40:09 +0000 Subject: * 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 --- initramfs/OpenSLX/MakeInitRamFS/Engine.pm | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'initramfs/OpenSLX/MakeInitRamFS/Engine.pm') diff --git a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm index 43374e9e..efa8d1de 100644 --- a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm +++ b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm @@ -58,18 +58,15 @@ sub new $self->{'system-name'} =~ m{^([^\-]+)-([^:\-]+)} or die "unable to extract distro-info from $self->{'system-name'}!"; - $self->{'distro-name'} = $1; + $self->{'distro-name'} = lc($1); $self->{'distro-ver'} = $2; - my %distroMap = ( - 'debian' => 'Debian', - 'suse' => 'SUSE', - 'ubuntu' => 'Ubuntu', - ); - my $distroModule = $distroMap{$self->{'distro-name'}} || 'Base'; - $self->{distro} = instantiateClass( - "OpenSLX::MakeInitRamFS::Distro::$distroModule" - ); + my $distroModule + = 'OpenSLX::MakeInitRamFS::Distro::' . ucfirst($self->{'distro-name'}); + if (!eval { $self->{distro} = instantiateClass($distroModule); }) { + $self->{distro} + = instantiateClass('OpenSLX::MakeInitRamFS::Distro::Base'); + } $self->{'lib-scanner'} = OpenSLX::LibScanner->new({ 'root-path' => $self->{'root-path'} }); -- cgit v1.2.3-55-g7522