diff options
author | Alexander Hoppe | 2009-09-24 15:58:31 +0200 |
---|---|---|
committer | Alexander Hoppe | 2009-09-24 15:58:31 +0200 |
commit | 10e821c1dac25f4ea2d3278fbe0ef7ece6edba3e (patch) | |
tree | 2f1ffe2100c0f85a1d1dcde82f84fcc67773712b /installer | |
parent | removed bug which produced an error every second run of demuxer (diff) | |
download | core-10e821c1dac25f4ea2d3278fbe0ef7ece6edba3e.tar.gz core-10e821c1dac25f4ea2d3278fbe0ef7ece6edba3e.tar.xz core-10e821c1dac25f4ea2d3278fbe0ef7ece6edba3e.zip |
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
Diffstat (limited to 'installer')
-rw-r--r-- | installer/OpenSLX/OSSetup/Engine.pm | 20 |
1 files changed, 17 insertions, 3 deletions
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; } |