3 # Copyright (c) 2002 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";
40 $cvsroot = $ENV{'CVSROOT'};
41 $cvsroot = "/home/ncvs" if !$cvsroot;
42 $cvs = "cvs -R -d $cvsroot co -p";
44 open(PASSWD, 'ypcat passwd |') || die "open passwd data: $!\n";
46 ($login,undef) = split(/:/);
47 $login =~ s/_//g; # remove _ from usernames since this
48 # character is not allowed in docbook entities
49 print "passwd user: $login\n" if $debug;
54 print "$cvs $accessfile\n";
55 open (ACCESS, "$cvs $accessfile |") || die "checkout $accessfile: $!\n";
59 ($accuser, undef) = split /\s/;
61 print "access user: $accuser\n" if $debug;
62 $access{$accuser} = 1;
66 open (AUTHORS, "$cvs $authorsfile |") || die "checkout $authorsfile: $!\n";
68 $author = $1 if /ENTITY a\.([^ ]+)/;
70 print "authors entity: $author\n" if $debug;
71 $authors{$author} = 1;
77 print "People listed in CVSROOT/access, but have no account\n";
78 print "----------------------------------------------------\n";
79 foreach (keys %access) {
80 print "$_\n" if (!defined $users{$_});
84 print "People listed in autors.ent, not have no account\n";
85 print "------------------------------------------------\n";
86 foreach (keys %authors) {
87 print "$_\n" if (!defined $users{$_});
91 print "People listed in CVSROOT/access, but not listed in authors.ent\n";
92 print "--------------------------------------------------------------\n";
93 foreach (keys %access) {
94 print "$_\n" if (!defined $authors{$_});