From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 17 02:10:02 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5879C106566B for ; Wed, 17 Sep 2008 02:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 29A418FC0A for ; Wed, 17 Sep 2008 02:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m8H2A2NR090777 for ; Wed, 17 Sep 2008 02:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m8H2A2ji090776; Wed, 17 Sep 2008 02:10:02 GMT (envelope-from gnats) Resent-Date: Wed, 17 Sep 2008 02:10:02 GMT Resent-Message-Id: <200809170210.m8H2A2ji090776@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Edwin Groothuis Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8E1A1065672 for ; Wed, 17 Sep 2008 02:06:37 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: from mail5out.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) by mx1.freebsd.org (Postfix) with ESMTP id 0A3D88FC13 for ; Wed, 17 Sep 2008 02:06:35 +0000 (UTC) (envelope-from edwin@mavetju.org) Received: by mail5out.barnet.com.au (Postfix, from userid 1001) id 33CD92218C03; Wed, 17 Sep 2008 12:06:33 +1000 (EST) Received: from mail5auth.barnet.com.au (mail5.barnet.com.au [202.83.178.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail5auth.barnet.com.au", Issuer "*.barnet.com.au" (verified OK)) by mail5.barnet.com.au (Postfix) with ESMTP id D987221B5B15 for ; Wed, 17 Sep 2008 12:06:32 +1000 (EST) Received: from k7.mavetju (ppp121-44-125-22.lns10.syd6.internode.on.net [121.44.125.22]) by mail5auth.barnet.com.au (Postfix) with ESMTP id 6E5312218BFD for ; Wed, 17 Sep 2008 12:06:32 +1000 (EST) Received: by k7.mavetju (Postfix, from userid 1001) id 083151C2; Wed, 17 Sep 2008 12:06:35 +1000 (EST) Message-Id: <20080917020635.083151C2@k7.mavetju> Date: Wed, 17 Sep 2008 12:06:35 +1000 (EST) From: Edwin Groothuis To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: misc/127428: [patch] Add check-script for share/misc/iso639 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Edwin Groothuis List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Sep 2008 02:10:02 -0000 >Number: 127428 >Category: misc >Synopsis: [patch] Add check-script for share/misc/iso639 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Sep 17 02:10:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Edwin Groothuis >Release: FreeBSD 7.0-RELEASE-p1 i386 >Organization: - >Environment: System: FreeBSD k7.mavetju 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #2: Wed May 28 08:12:56 EST 2008 edwin@k7.mavetju:/usr/src/sys/i386/compile/k7 i386 >Description: Small perl script for in head/tools/tools/iso. >How-To-Repeat: >Fix: --- share/misc/iso639.old 2008-09-17 12:04:50.000000000 +1000 +++ share/misc/iso639 2008-09-17 12:05:52.000000000 +1000 @@ -27,9 +27,17 @@ # # For general discussion about ISO language codes, write to: iso639@dkuug.dk +# +# Download the file http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt +# and run head/tools/tools/iso/check-iso639.pl to see if everything is up +# to date. +# + +# # a2: ISO 639-1 Alpha-2 code # bib: ISO 639-2/B bibliographic code # term: ISO 639-2/B terminology code +# # a2 bib term name aa aar aar Afar [~/iso] edwin@k7>cat check-iso639.pl #!/usr/bin/perl -w # # $FreeBSD$ # # This script compares the file iso639 (from head/share/misc) with the file # ISO-639-2_8859-1.txt (from # http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt) to see if there # any differences. # # Created by Edwin Groothuis for the FreeBSD project. # use strict; use Data::Dumper; my %old = (); { open(FIN, "iso639") or die "Cannot open iso639 (should be in head/share/misc)"; my @lines = ; close(FIN); chomp(@lines); foreach my $l (@lines) { next if ($l =~ /^#/); next if ($l eq ""); die "Bad line: $l\n" if ($l !~ /^([a-z\-]*)[ \t]+([a-z\-]+)[ \t]+([a-z\-]+)[ \t]+(.*)/); my $a2 = $1; my $bib = $2; my $term = $3; my $name = $4; $old{$bib}{a2} = $a2; $old{$bib}{bib} = $bib; $old{$bib}{term} = $term; $old{$bib}{name} = $name; } } my %new = (); { open(FIN, "ISO-639-2_8859-1.txt") or die "Cannot open ISO-639-2_8859-1.txt, which can be retrieved from http://www.loc.gov/standards/iso639-2/ISO-639-2_utf-8.txt"; my @lines = ; close(FIN); chomp(@lines); foreach my $l (@lines) { my @a = split(/\|/, $l); my $a2 = $a[2]; my $bib = $a[0]; my $term = $a[1]; my $name = $a[3]; $term = $bib if ($term eq ""); $new{$bib}{a2} = $a2; $new{$bib}{bib} = $bib; $new{$bib}{term} = $term; $new{$bib}{name} = $name; } } { my $c = 0; foreach my $bib (sort(keys(%old))) { next if (defined $new{$bib}); print "In old but not new: $old{$bib}{a2}\t$old{$bib}{bib}\t$old{$bib}{term}\t$old{$bib}{name}\n"; $c++; } print "Found $c issues\n"; } { my $c = 0; foreach my $bib (sort(keys(%new))) { next if (defined $old{$bib}); print "In new but not old: $new{$bib}{a2}\t$new{$bib}{bib}\t$new{$bib}{term}\t$new{$bib}{name}\n"; $c++; } print "Found $c issues\n"; } { my $c = 0; foreach my $bib (sort(keys(%old))) { next if (!defined $new{$bib}); next if ($old{$bib}{a2} eq $new{$bib}{a2} && $old{$bib}{bib} eq $new{$bib}{bib} && $old{$bib}{term} eq $new{$bib}{term} && $old{$bib}{name} eq $new{$bib}{name}); print "In old: $old{$bib}{a2}\t$old{$bib}{bib}\t$old{$bib}{term}\t$old{$bib}{name}\n"; print "In new: $new{$bib}{a2}\t$new{$bib}{bib}\t$new{$bib}{term}\t$new{$bib}{name}\n"; $c++; } print "Found $c issues\n"; } >Release-Note: >Audit-Trail: >Unformatted: