From 2a997dde3d1b567f7c7e61b9b42702b34743300e Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 9 Apr 2009 11:21:31 +0000 Subject: (get_file_and_size) be more compatible with older http code for error management --- perl-install/install/http.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'perl-install/install/http.pm') diff --git a/perl-install/install/http.pm b/perl-install/install/http.pm index bca1f7362..5de087d61 100644 --- a/perl-install/install/http.pm +++ b/perl-install/install/http.pm @@ -29,7 +29,7 @@ sub get_file_and_size_ { } } -sub get_file_and_size { +sub get_file_and_size1 { my ($url) = @_; # can be used for ftp urls (with http proxy) @@ -55,9 +55,13 @@ sub get_file_and_size { } my $res = urpm::download::sync_url($urpm, $url, dir => $cachedir); - $res or die N("retrieval of [%s] failed", $file) . "\n"; - open(my $f, $file); - (-s $file, $f); + if ($res) { + open(my $f, $file); + (-s $file, $f); + } else { + log::l("retrieval of [$file] failed"); + undef; + } } 1; -- cgit v1.2.1