3 # Copyright (c) 2002,2003 Alexey Zelkin <phantom@FreeBSD.org>
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
12 # notice, this list of conditions and the following disclaimer in the
13 # documentation and/or other materials provided with the distribution.
15 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 # cknames.pl -- this scripts checks for integrity of person lists
28 # between authors.ent, CVSROOT/access and passwd database
29 # at freefall.freebsd.org
31 # NOTE: This script is supposed to run at freefall.freebsd.org *only*
37 $accessfile = "CVSROOT/access";
38 $authorsfile = "doc/en_US.ISO8859-1/share/sgml/authors.ent";
46 $doccvsroot = "/home/dcvs";
47 $cvs_pfx = "cvs -Q -R -d ";
50 open(PASSWD, 'ypcat passwd |') || die "open passwd data: $!\n";
52 ($login,undef) = split(/:/);
53 $login =~ s/_//g; # remove _ from usernames since this
54 # character is not allowed in docbook entities
55 print "passwd user: $login\n" if $debug;
61 print "$cvs_pfx $_ $cvs_sfx $accessfile\n" if $debug;
62 open (ACCESS, "$cvs_pfx $_ $cvs_sfx $accessfile |") ||
63 die "checkout $accessfile: $!\n";
67 ($accuser, undef) = split /\s/;
69 print "access user: $accuser\n" if $debug;
70 $access{$accuser} = 1;
75 open (AUTHORS, "$cvs_pfx $doccvsroot $cvs_sfx $authorsfile |") ||
76 die "checkout $authorsfile: $!\n";
78 $author = $1 if /ENTITY a\.([^ ]+)/;
80 print "authors entity: $author\n" if $debug;
81 $authors{$author} = 1;
87 print "People listed in CVSROOT/access, but have no account\n";
88 print "----------------------------------------------------\n";
89 foreach (keys %access) {
90 print "$_\n" if (!defined $users{$_});
94 print "People listed in autors.ent, not have no account\n";
95 print "------------------------------------------------\n";
96 foreach (keys %authors) {
97 print "$_\n" if (!defined $users{$_});
101 print "People listed in CVSROOT/access, but not listed in authors.ent\n";
102 print "--------------------------------------------------------------\n";
103 foreach (keys %access) {
104 print "$_\n" if (!defined $authors{$_});