Commit 0a320c97 authored by sikeda's avatar sikeda
Browse files

[bug] INDEX mail command returned wrong dates and sizes of archives.

Fixed by getting them of arctxt directories.  Additionally, now sizes are shown in kilobytes.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12078 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 75244cb2
......@@ -159,10 +159,9 @@ sub select_archive {
$self->{deleted_directory} = $deleted_directory;
if ($options{info}) {
my @s = stat $arc_directory; #FIXME: arctxt would be checked.
return {
size => $s[7],
mtime => $s[9],
size => Sympa::Tools::File::get_dir_size($directory),
mtime => Sympa::Tools::File::get_mtime($directory),
};
} else {
return $arc;
......
......@@ -736,9 +736,16 @@ sub index {
my $info = $archive->select_archive($arc, info => 1);
next unless $info;
push @arcs, sprintf "%-40s %7d %s\n", $arc, $info->{size},
$language->gettext_strftime('%a, %d %b %Y %H:%M:%S',
localtime $info->{mtime});
push @arcs,
$language->gettext_sprintf(
'%-37s %5.1f kB %s',
$arc,
$info->{size} / 1024.0,
$language->gettext_strftime(
'%a, %d %b %Y %H:%M:%S',
localtime $info->{mtime}
)
) . "\n";
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment