From a505ac7724215dd08fc4ae17fdd2577469c06117 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 23 Apr 2003 15:44:24 +0000 Subject: fix for bug 3814. --- urpm.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'urpm.pm') diff --git a/urpm.pm b/urpm.pm index 7755eac3..dca1b418 100644 --- a/urpm.pm +++ b/urpm.pm @@ -217,7 +217,7 @@ sub sync_curl { if (@ftp_files) { my ($cur_ftp_file, %ftp_files_info); - require Date::Manip; + eval { require Date::Manip }; #- prepare to get back size and time stamp of each file. open CURL, join(" ", map { "'$_'" } "/usr/bin/curl", @@ -231,8 +231,10 @@ sub sync_curl { } if (/Last-Modified:\s*(.*)/) { !$cur_ftp_file || exists($ftp_files_info{$cur_ftp_file}{time}) and $cur_ftp_file = shift @ftp_files; - $ftp_files_info{$cur_ftp_file}{time} = Date::Manip::ParseDate($1); - $ftp_files_info{$cur_ftp_file}{time} =~ s/(\d{6}).{4}(.*)/$1$2/; #- remove day and hour. + eval { + $ftp_files_info{$cur_ftp_file}{time} = Date::Manip::ParseDate($1); + $ftp_files_info{$cur_ftp_file}{time} =~ s/(\d{6}).{4}(.*)/$1$2/; #- remove day and hour. + }; } } close CURL; @@ -247,7 +249,7 @@ sub sync_curl { #- use less. foreach (keys %ftp_files_info) { my ($lfile) = /\/([^\/]*)$/ or next; #- strange if we can't parse it correctly. - my $ltime = Date::Manip::ParseDate(scalar gmtime((stat $1)[9])); + my $ltime = eval { Date::Manip::ParseDate(scalar gmtime((stat $1)[9])) }; $ltime =~ s/(\d{6}).{4}(.*)/$1$2/; #- remove day and hour. -s $lfile == $ftp_files_info{$_}{size} && $ftp_files_info{$_}{time} eq $ltime or push @ftp_files, $_; -- cgit v1.2.1