map #1

  • //
  • guest/
  • richard_geiger/
  • utils/
  • cvs2p4/
  • bin/
  • map
  • View
  • Commits
  • Open Download .zip Download (2 KB)
#!/usr/local/bin/perl
# -*-Fundamental-*-

open(BRTAGS, "<brtags.txt") || die;

while (<BRTAGS>)
  {
    chomp;
    $Brtags{$_} = 1;
  }

close BRTAGS;

open(TAGS, "<tags.txt") || die;

while (<TAGS>)
  {
    chomp;

    ($tag, $mapping) = split(/\t+/, $_);

    $branch = "UNMAPPED";

    if ($tag =~ /^(.*)-\d{3}$/ && $Brtags{"$1-br"})
      { $branch = "$1-br"; }
    elsif ($tag =~ /^OLDphoebe-\d\d\d[a-z]{0,1}-(\d+-\d+)$/ && $Brtags{"OLDphoebe-$1-br"})
      { $branch = "OLDphoebe-$1-br"; }
    if ($mapping eq "UNMAPPED" && $branch eq "UNMAPPED")
      {
        if ($tag =~ /[_\-]branch[_\-]?point$/i 
              || $tag =~ /[_\-]bp$/i
              || $tag =~ /^branch[_\-]point/i
              || $tag =~ /[_\-]br[_\-](point|base)$/i)
          { $result = "BRANCHPOINT-DROPPED"; }
        else
          { $result = "UNMAPPED"; }
      }
    elsif ($mapping eq "UNMAPPED")
      { $result = "$branch [F]"; }
    elsif ($branch eq "UNMAPPED")
      { $result = "$mapping [H]"; }
    elsif ($branch eq $mapping)
      { $result = "$branch [B]"; }
    else
      { $result = "F-B-COLLISION"; }

    if ($result eq "UNMAPPED" || $result eq "F-B-COLLISION")
      {
        if    ($tag =~ /^OLDphoebe-2-0-/) { $result = "OLDphoebe-2-0-br [M]"; }
        elsif ($tag =~ /^cp-1-/) { $result = "main [M]"; }

      }

    print "$tag\t$mapping\t$branch\t$result\n";

    if (! defined($tally{$result}))
      { $tally{$result} = 1; }
    else
      { $tally{$result}++; }
  }

$nmapped = 0;
$nother = 0;
foreach my $key (sort(keys(%tally)))
  {
    if ($key =~ /^(UNMAPPED|F-B-COLLISION|BRANCHPOINT-DROPPED)$/)
      { printf ("%20s %d\n", $key, $tally{$key}) }
    elsif ($key =~ /\[.\]/)
      { $nmapped++; }
    else
      { $nother++; } 
  }

printf ("%20s %d\n", "mapped", $nmapped);
printf ("%20s %d\n", "other", $nother);

# Change User Description Committed
#17 5688 Richard Geiger consistently invoke perl via PATH
#16 5616 Richard Geiger a fix for precision!
#15 5563 Richard Geiger Life is a corner case.
"UNMAPPED-COLLISION tags in tags.txt now indicate what collided better.
Fix srcdiff to handle odd Log expansion corner case that was causing
flase positives.
#14 5496 Richard Geiger recognize "*-base" as branch points.
#13 5493 Richard Geiger update
#12 5492 Richard Geiger Use excludes lists correctly!
#11 5491 Richard Geiger checkpoint
#10 5489 Richard Geiger New checkpoint; now has multi-mod exclude_* files.
#9 5475 Richard Geiger Treat tags missing in the global map as warnings,
and print html-friendly messages.
#8 5474 Richard Geiger honer exclude files.
#7 5473 Richard Geiger checkpoint.
#6 5471 Richard Geiger Try using either brmap.pl or ../brmap.pl
#5 5470 Richard Geiger The Neverending Story.
#4 5453 Richard Geiger checkpoint
#3 5449 Richard Geiger gearing up for 2.6.0 release...
#2 5441 Richard Geiger checkpoint.
#1 5440 Richard Geiger branch mapping adjunct, for summarizing the
coverage from the heuristic plus any mappingfunctions.
Prerelease!