summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-04-23 15:44:24 +0000
committerFrancois Pons <fpons@mandriva.com>2003-04-23 15:44:24 +0000
commita505ac7724215dd08fc4ae17fdd2577469c06117 (patch)
tree4608885c660c01496dd32f8ccc72396af810f660 /urpm.pm
parentf781f1349f99779400f34836ea03ef7028188998 (diff)
downloadurpmi-a505ac7724215dd08fc4ae17fdd2577469c06117.tar
urpmi-a505ac7724215dd08fc4ae17fdd2577469c06117.tar.gz
urpmi-a505ac7724215dd08fc4ae17fdd2577469c06117.tar.bz2
urpmi-a505ac7724215dd08fc4ae17fdd2577469c06117.tar.xz
urpmi-a505ac7724215dd08fc4ae17fdd2577469c06117.zip
fix for bug 3814.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm10
1 files changed, 6 insertions, 4 deletions
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, $_;