From 10e821c1dac25f4ea2d3278fbe0ef7ece6edba3e Mon Sep 17 00:00:00 2001 From: Alexander Hoppe Date: Thu, 24 Sep 2009 13:58:31 +0000 Subject: improved way of giving package names so that it should be enough to give the name an perhaps the major version number git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3157 95ad53e4-c205-0410-b2fa-d234c58c8868 --- installer/OpenSLX/OSSetup/Engine.pm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'installer/OpenSLX/OSSetup/Engine.pm') diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 1634c95c..ba901d23 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -68,6 +68,7 @@ use vars qw(%supportedDistros); ); my %localHttpServers; +my $filelisting; ################################################################################ ### interface methods @@ -1182,10 +1183,12 @@ sub _downloadBaseFiles { my $self = shift; my $files = shift; + use vars qw(@filelisting); my $pkgSubdir = $self->{'distro-info'}->{'package-subdir'}; my @URLs = @{$self->{'baseURLs'}}; my $maxTryCount = $openslxConfig{'ossetup-max-try-count'}; + my @possiblefiles; my @foundFiles; foreach my $fileVariantStr (@$files) { @@ -1197,9 +1200,20 @@ try_next_url: $url .= "/$pkgSubdir" if length($pkgSubdir); foreach my $file (split '\s+', $fileVariantStr) { - my $basefile = basename($file); - vlog(2, "fetching <$file>..."); - if (slxsystem("wget", "-c", "-O", "$basefile", "$url/$file") == 0) { + #substitute given name with real filename including version number + my $basefile = basename($file); + my $basedir = dirname($file)."/"; + @possiblefiles = grep(/^$basefile/,@filelisting); + #selecting always the first occurence + if ($possiblefiles[0]) { + $basefile = $possiblefiles[0]; + } elsif ($basefile =~ /.*\.rpm/) { + vlog(5,"Trying suggested name because of .rpm-ending."); + } else { + die _tr("file <$basefile> not found in list received from mirror"); + } + vlog(2, "fetching <$basefile>..."); + if (slxsystem("wget", "-c", "-O", "$basefile", "$url/$basedir$basefile") == 0) { $foundFile = $basefile; last; } -- cgit v1.2.3-55-g7522