diff options
Diffstat (limited to 'installer/OpenSLX/OSSetup/Engine.pm')
-rw-r--r-- | installer/OpenSLX/OSSetup/Engine.pm | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm index 9ae3e90a..6846eef6 100644 --- a/installer/OpenSLX/OSSetup/Engine.pm +++ b/installer/OpenSLX/OSSetup/Engine.pm @@ -588,12 +588,12 @@ sub readDistroInfo my $bootstrap_packages = $self->{distro}->{config}->{'bootstrap-packages'}; my $metapackager_packages = $self->{distro}->{config}->{'metapackager-packages'}; - my $file = "$self->{'config-distro-info-dir'}/settings"; + my $file = "$self->{'config-distro-info-dir'}/settings"; if (-e $file) { vlog(2, "reading configuration file $file..."); my $config = slurpFile($file); - if (!eval { $config } && length($@)) { + if (!eval "$config" && length($@)) { die _tr("error in config-file '%s' (%s)", $file, $@) . "\n"; } } @@ -785,9 +785,10 @@ sub startLocalURLServersAsNeeded $self->{'local-http-server-master-pid'} = $$; + my $port = 5080; foreach my $repoInfo (values %{$self->{'distro-info'}->{repository}}) { my $localURL = $repoInfo->{url} || ''; - next unless $localURL =~ m[^local:]; + next if $localURL =~ m[^\w+:]; if (!exists $self->{'local-http-servers'}->{$localURL}) { my $busyboxName = $self->hostIs64Bit() @@ -795,16 +796,20 @@ sub startLocalURLServersAsNeeded : 'busybox.i586'; my $busybox = "$openslxConfig{'base-path'}/share/busybox/$busyboxName"; - my $port = 5080; - if ($localURL =~ m[:(\d+)/]) { - $port = $1; - } my $pid = executeInSubprocess( $busybox, "httpd", '-p', $port, '-h', '/', '-f' ); - vlog(1, _tr("started local HTTP-server for URL '%s'.", $localURL)); + vlog(1, + _tr( + "started local HTTP-server for URL '%s' on port '%s'.", + $localURL, $port + ) + ); $self->{'local-http-servers'}->{$localURL} = $pid; + $repoInfo->{'url'} = "http://localhost:$port$localURL"; + $repoInfo->{'avoid-mirrors'} = 1; + $port++; } } } |