/[webpac2]/trunk/bin/isi-merge.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/bin/isi-merge.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1341 by dpavlin, Sun Sep 20 01:21:17 2009 UTC revision 1342 by dpavlin, Fri Oct 15 15:30:26 2010 UTC
# Line 4  use warnings; Line 4  use warnings;
4  use strict;  use strict;
5  use autodie;  use autodie;
6  use Digest::MD5 qw(md5_hex);  use Digest::MD5 qw(md5_hex);
7    use Digest::SHA1 qw(sha1_hex);
8  use Data::Dump qw(dump);  use Data::Dump qw(dump);
9    
10    my $use_sha1 = $ENV{SHA1} || 1;
11    
12  my @files = @ARGV;  my @files = @ARGV;
13  @files = glob '/tmp/isi.*-*.txt' unless @files;  @files = glob '/tmp/isi.*-*.txt' unless @files;
14    
15  my $path = '/tmp/isi.full.txt';  my $path = '/tmp/isi.full.txt';
16    
17    warn "# ", $#files + 1, " files to $path sha:$use_sha1\n";
18    
19  open(my $out_fh, '>', $path);  open(my $out_fh, '>', $path);
20  print $out_fh "FN ISI Export Format\nVR 1.0\n";  print $out_fh "FN ISI Export Format\nVR 1.0\n";
21    
# Line 37  foreach my $file ( sort { Line 43  foreach my $file ( sort {
43                          $rec .= $_;                          $rec .= $_;
44                  } else {                  } else {
45                          $nr++;                          $nr++;
46                          my $digest = md5_hex $rec;                          my $digest = $use_sha1 ? sha1_hex $rec : md5_hex $rec;
47                          if ( my $times = $md5->{$digest} ) {                          if ( my $times = $md5->{$digest} ) {
48                                  print STDERR 'd';                                  print STDERR 'd';
49                                  $report->{file}->{$file}->{duplicates}++;                                  $report->{file}->{$file}->{duplicates}++;

Legend:
Removed from v.1341  
changed lines
  Added in v.1342

  ViewVC Help
Powered by ViewVC 1.1.26