summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-12-10 18:15:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-12-10 18:15:10 +0000
commit6ff8022a9fcd1a160bb1631f06b467a105620b41 (patch)
treeeb20fca9b3345895d404e99479f8dc16c8c07316 /perl-install
parente45c1bc02e56d14d98827eb8ebb8696f0e7a6517 (diff)
downloaddrakx-6ff8022a9fcd1a160bb1631f06b467a105620b41.tar
drakx-6ff8022a9fcd1a160bb1631f06b467a105620b41.tar.gz
drakx-6ff8022a9fcd1a160bb1631f06b467a105620b41.tar.bz2
drakx-6ff8022a9fcd1a160bb1631f06b467a105620b41.tar.xz
drakx-6ff8022a9fcd1a160bb1631f06b467a105620b41.zip
enable http:// in auto_install file location
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/http.pm6
-rw-r--r--perl-install/install_any.pm7
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