From 6ff8022a9fcd1a160bb1631f06b467a105620b41 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 10 Dec 2001 18:15:10 +0000 Subject: enable http:// in auto_install file location --- perl-install/http.pm | 6 +++--- perl-install/install_any.pm | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/perl-install/http.pm b/perl-install/http.pm index d04f90435..057764a27 100644 --- a/perl-install/http.pm +++ b/perl-install/http.pm @@ -9,12 +9,12 @@ my $sock; sub getFile { local($^W) = 0; - my ($host, $port, $path) = $ENV{URLPREFIX} =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,; + my ($url) = @_; + my ($host, $port, $path) = $url =~ m,^http://([^/:]+)(?::(\d+))?(/\S*)?$,; $host = network::resolv($host); - $path .= "/$_[0]"; $sock->close if $sock; - $_[0] eq 'XXX' and return; #- force closing connection. + $url =~ m|/XXX$| and return; #- force closing connection. $sock = IO::Socket::INET->new(PeerAddr => $host, PeerPort => $port || 80, Proto => 'tcp', diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 82f33ef50..59dbafcfd 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -131,7 +131,10 @@ sub getFile { log::l("getFile $f:$method"); my $rel = relGetFile($f); do { - if ($method =~ /crypto/i) { + if ($f =~ m|^http://|) { + require http; + http::getFile($f); + } elsif ($method =~ /crypto/i) { require crypto; crypto::getFile($f); } elsif ($::o->{method} eq "ftp") { @@ -139,7 +142,7 @@ sub getFile { ftp::getFile($rel); } elsif ($::o->{method} eq "http") { require http; - http::getFile($rel); + http::getFile("$ENV{URLPREFIX}/$rel"); } else { #- try to open the file, but examine if it is present in the repository, this allow #- handling changing a media when some of the file on the first CD has been copied -- cgit v1.2.1