Package: mirror
Severity: important
Tags: patch
mirror has fallen behind the times a bit in parsing directory listings and
can no longer handle the latest GNU ls output in an en_US locale. I ran
into this when mirror stopped being able to parse a remote ls-lR file and
wanted to delete the complete contents of the mirror. The new output is:
windlord:~> env LC_ALL=en_US.UTF-8 ls -l mirror-*
-rw-r--r-- 1 eagle root 553 2006-01-28 12:36 mirror-1
-rw-r--r-- 1 eagle root 549 2006-01-28 12:38 mirror-2
Attached are two patches that together fix this problem. One patch is to
lsparse.pl to recognize the new format (it otherwise really wants to find
a month name), and the other is to dateconv.pl to understand this date
format.
-- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12-1-686
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)
--- dateconv.pl.orig 2006-01-28 12:29:00.000000000 -0800
+++ dateconv.pl 2006-01-28 12:36:24.000000000 -0800
@@ -93,6 +93,10 @@
elsif( $date =~ /^(\w\w\w)\s+(\d+)\s+(\d\d)\s+(\d+):(\d+)$/ ){
($mon, $day, $year, $hours, $mins) = ($1, $2, $3, $4, $5);
}
+ # new Unix style
+ elsif( $date =~ /^(\d\d\d\d)-(\d\d)-(\d\d)\s+(\d+):(\d+)/ ){
+ ($year, $mon, $day, $hours, $mins) = ($1, $2, $3, $4, $5);
+ }
# VMS, Supertcp, DOS style
elsif( $date =~ /(\d+)-(\S+)-(\d+)\s+(\d+):(\d+)/ ){
($day, $mon, $year, $hours, $mins) = ($1, $2, $3, $4, $5);
--- lsparse.pl.orig 1998-05-29 12:04:23.000000000 -0700
+++ lsparse.pl 2006-01-28 12:37:52.000000000 -0800
@@ -189,7 +189,7 @@
$non_crud = "";
}
- if(
/^([\-FlrwxsStTdDam]{10}).*\D(\d+)\s*([A-Za-z]{3}\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/
){
+ if(
/^([\-FlrwxsStTdDam]{10}).*\D(\d+)\s*([A-Za-z]{3}\s+\d+\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/
||
/^([\-FlrwxsStTdDam]{10}).*\D(\d+)\s*(\d{4}-\d\d-\d\d\s*(\d+:\d+|\d\d\d\d))\s+(.*)\n/
){
local( $kind, $size, $lsdate, $file ) = ($1, $2, $3,
$5);
if( $file eq '.' || $file eq '..' ){