6 # This script compares the file iso639 (from head/share/misc) with the file
7 # ISO-639-2_8859-1.txt (from
8 # http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt) to see if there
11 # Created by Edwin Groothuis <edwin@FreeBSD.org> for the FreeBSD project.
19 open(FIN, "iso639") or die "Cannot open iso639 (should be in head/share/misc)";
24 foreach my $l (@lines) {
29 if ($l !~ /^([a-z\-]*)[ \t]+([a-z\-]+)[ \t]+([a-z\-]+)[ \t]+(.*)/);
36 $old{$bib}{bib} = $bib;
37 $old{$bib}{term} = $term;
38 $old{$bib}{name} = $name;
44 open(FIN, "ISO-639-2_utf-8.txt") or die "Cannot open ISO-639-2_utf-8.txt, which can be retrieved from http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt";
49 foreach my $l (@lines) {
50 my @a = split(/\|/, $l);
56 $term = $bib if ($term eq "");
59 $new{$bib}{bib} = $bib;
60 $new{$bib}{term} = $term;
61 $new{$bib}{name} = $name;
67 foreach my $bib (sort(keys(%old))) {
68 next if (defined $new{$bib});
69 print "In old but not new: $old{$bib}{a2}\t$old{$bib}{bib}\t$old{$bib}{term}\t$old{$bib}{name}\n";
72 print "Found $c issues\n";
77 foreach my $bib (sort(keys(%new))) {
78 next if (defined $old{$bib});
79 print "In new but not old: $new{$bib}{a2}\t$new{$bib}{bib}\t$new{$bib}{term}\t$new{$bib}{name}\n";
82 print "Found $c issues\n";
87 foreach my $bib (sort(keys(%old))) {
88 next if (!defined $new{$bib});
89 next if ($old{$bib}{a2} eq $new{$bib}{a2} &&
90 $old{$bib}{bib} eq $new{$bib}{bib} &&
91 $old{$bib}{term} eq $new{$bib}{term} &&
92 $old{$bib}{name} eq $new{$bib}{name});
93 print "In old: $old{$bib}{a2}\t$old{$bib}{bib}\t$old{$bib}{term}\t$old{$bib}{name}\n";
94 print "In new: $new{$bib}{a2}\t$new{$bib}{bib}\t$new{$bib}{term}\t$new{$bib}{name}\n";
97 print "Found $c issues\n";