Commit 344db14d authored by IKEDA Soji's avatar IKEDA Soji
Browse files

tidyall

parent 8ac7be91
...@@ -8361,14 +8361,18 @@ sub do_editfile { ...@@ -8361,14 +8361,18 @@ sub do_editfile {
$file, subdir => $subdir); $file, subdir => $subdir);
} }
   
$param->{'filecontent'} = Sympa::Tools::Text::slurp($param->{'filepath'}); $param->{'filecontent'} =
Sympa::Tools::Text::slurp($param->{'filepath'});
   
unless (defined $param->{'filecontent'}) { unless (defined $param->{'filecontent'}) {
wwslog('err', 'Failed to open file %s: %m', $param->{'filepath'}); wwslog('err', 'Failed to open file %s: %m', $param->{'filepath'});
Sympa::WWW::Report::reject_report_web( Sympa::WWW::Report::reject_report_web(
'intern', 'cannot_open_file', 'intern',
{'file' => $param->{'file_path'}}, $param->{'action'}, 'cannot_open_file',
$list, $param->{'user'}{'email'}, {'file' => $param->{'file_path'}},
$param->{'action'},
$list,
$param->{'user'}{'email'},
$robot $robot
); );
web_db_log( web_db_log(
......
...@@ -151,9 +151,9 @@ sub select_archive { ...@@ -151,9 +151,9 @@ sub select_archive {
my $dh; my $dh;
unless (opendir $dh, $directory) { unless (opendir $dh, $directory) {
if ( -d $directory ) { if (-d $directory) {
$log->syslog('err', 'Failed to open archive directory %s: %s', $log->syslog('err', 'Failed to open archive directory %s: %s',
$directory, $ERRNO); $directory, $ERRNO);
} }
return; return;
} }
...@@ -221,7 +221,7 @@ sub html_fetch { ...@@ -221,7 +221,7 @@ sub html_fetch {
unless ($handle) { unless ($handle) {
if (-f $html_file) { if (-f $html_file) {
$log->syslog('err', 'Failed to open archive file %s: %s', $log->syslog('err', 'Failed to open archive file %s: %s',
$html_file, $ERRNO); $html_file, $ERRNO);
} }
return undef; return undef;
} }
...@@ -316,8 +316,11 @@ sub html_next { ...@@ -316,8 +316,11 @@ sub html_next {
unless ($self->{_html_metadatas}) { unless ($self->{_html_metadatas}) {
my $dh; my $dh;
unless (opendir $dh, $self->{arc_directory}) { unless (opendir $dh, $self->{arc_directory}) {
$log->syslog('err', 'Cannot open dir %s: %s', $self->{arc_directory}, $log->syslog(
$ERRNO); 'err',
'Cannot open dir %s: %s',
$self->{arc_directory}, $ERRNO
);
return undef; return undef;
} }
$self->{_html_metadatas} = [ $self->{_html_metadatas} = [
......
...@@ -782,7 +782,7 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) { ...@@ -782,7 +782,7 @@ if ($main::options{'dump'} or $main::options{'dump_users'}) {
} }
if ($err >= 0) { if ($err >= 0) {
print STDERR "@{$result{'errors'}}"; print STDERR "@{$result{'errors'}}";
exit 1; exit 1;
} }
exit 0; exit 0;
......
...@@ -23,17 +23,19 @@ while (<FH>) { ...@@ -23,17 +23,19 @@ while (<FH>) {
close FH; close FH;
$/ = "\n"; $/ = "\n";
open FH, "git log -m -r --name-only --no-color --pretty=raw -z @ARGV |" or die $!; open FH, "git log -m -r --name-only --no-color --pretty=raw -z @ARGV |"
or die $!;
while (<FH>) { while (<FH>) {
chomp; chomp;
if (/^committer .*? (\d+) (?:[\-\+]\d+)$/) { if (/^committer .*? (\d+) (?:[\-\+]\d+)$/) {
$commit_time = $1; $commit_time = $1;
} elsif (s/\0\0commit [a-f0-9]{40}( \(from [a-f0-9]{40}\))?$// or s/\0$//) { } elsif (s/\0\0commit [a-f0-9]{40}( \(from [a-f0-9]{40}\))?$// or s/\0$//)
my @files = delete @ls{split(/\0/, $_)}; {
@files = grep { defined $_ } @files; my @files = delete @ls{split(/\0/, $_)};
next unless @files; @files = grep { defined $_ } @files;
map { s/^/$prefix/ } @files; next unless @files;
utime $commit_time, $commit_time, @files; map {s/^/$prefix/} @files;
utime $commit_time, $commit_time, @files;
} }
last unless %ls; last unless %ls;
} }
......
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