[Bio] / FigKernelScripts / merge_translation_rules.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/merge_translation_rules.pl

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

revision 1.1, Mon Dec 1 20:46:40 2003 UTC revision 1.2, Tue Dec 23 17:38:35 2003 UTC
# Line 1  Line 1 
1    
2  $usage = "usage: merge_translation_rules Existing Proposed > Good 2> conflicts";  $usage = "usage: merge_translation_rules Existing Proposed From > Good ";
3    
4  (($existing = shift @ARGV) &&  (($existing = shift @ARGV) &&
5   ($proposed = shift @ARGV)   ($proposed = shift @ARGV) &&
6     ($who_from = shift @ARGV)
7  )  )
8      || die $usage;      || die $usage;
9    
10  $trans = {};  $trans = {};
11    
12  &load($existing,$trans);  open(LOG,">>$FIG_Config::global/translation.update.results.log")
13  &load($proposed,$trans);      || die "could not open $FIG_Config::global/translation.update.results.log";
14    
15    &load($existing,$trans,"mine",\*LOG);
16    &load($proposed,$trans,$who_from,\*LOG);
17    close(LOG);
18    
19  foreach $from (sort keys(%$trans))  foreach $from (sort keys(%$trans))
20  {  {
# Line 17  Line 22 
22  }  }
23    
24  sub load {  sub load {
25      my($file) = @_;      my($file,$trans,$who_from,$fh_log) = @_;
26    
27      open(TMP,"<$file") || die "could not open $file";      open(TMP,"<$file") || die "could not open $file";
28      while (defined($_ = <TMP>))      while (defined($_ = <TMP>))
# Line 30  Line 35 
35          }          }
36          elsif ($trans->{$from} && ($trans->{$from} ne $to))          elsif ($trans->{$from} && ($trans->{$from} ne $to))
37          {          {
38              print STDERR "conflict: $from => $to\n\t$trans->{$from}\n\n";              print $fh_log "conflict\t$who_from\n$from\t$to\n$from\t$trans->{$from}\n\n";
39          }          }
40          elsif ($trans->{$to} && ($new = $trans->{$to}))          elsif ($new = $trans->{$to}))
41          {          {
42              print STDERR "BAD TO: $from => $to\n$new\n\n";              print $fh_log "target_gets_rewritten\t$who_from\n$from\t$to\n$to\t$new\n\n";
43          }          }
44          else          else
45          {          {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3