summaryrefslogtreecommitdiffstats
path: root/perl-install/install/http.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/install/http.pm')
-rw-r--r--perl-install/install/http.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/perl-install/install/http.pm b/perl-install/install/http.pm
index 1ef8755b3..db111564c 100644
--- a/perl-install/install/http.pm
+++ b/perl-install/install/http.pm
@@ -1,11 +1,8 @@
-package install::http; # $Id$
+package install::http;
use urpm::download;
use common;
-
-# to be killed once callers got fixed
-sub close() {
-}
+use Cwd;
sub getFile {
my ($url, %o_options) = @_;
@@ -15,7 +12,7 @@ sub getFile {
sub parse_http_url {
my ($url) = @_;
- $url =~ m,^(?:http|ftp)://([^/:]+)(?::(\d+))?(/\S*)?$,;
+ $url =~ m,^(?:https?|ftp)://(?:[^:/]+:[^:/]+\@)?([^/:@]+)(?::(\d+))?(/\S*)?$,;
}
sub get_file_and_size_ {
@@ -40,6 +37,7 @@ sub get_file_and_size {
if (!$urpm) {
require install::pkgs;
$urpm = install::pkgs::empty_packages($::o->{keep_unrequested_dependencies});
+ $urpm->{options}{'curl-options'} = '-s';
}
my $cachedir = $urpm->{cachedir} || '/root';
@@ -55,6 +53,7 @@ sub get_file_and_size {
}
my $res = eval { urpm::download::sync_url($urpm, $url, %o_options, dir => $cachedir) };
+
if ($res) {
open(my $f, $file);
(-s $file, $f);