Check that all directories are documented.
* src/sanity/readme.test: For each AC_OUTPUT Makefile, check that the directory is documented in README. Also skip non distributed directories in readme.test. * README: Fit on 80 columns.
This commit is contained in:
parent
9f41e397d5
commit
06f0fe1d40
3 changed files with 58 additions and 7 deletions
|
|
@ -1,5 +1,13 @@
|
||||||
2010-01-24 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
2010-01-24 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
||||||
|
Check that all directories are documented.
|
||||||
|
|
||||||
|
* src/sanity/readme.test: For each AC_OUTPUT Makefile, check that
|
||||||
|
the directory is documented in README. Also skip non distributed
|
||||||
|
directories in readme.test.
|
||||||
|
* README: Fit on 80 columns.
|
||||||
|
|
||||||
|
2010-01-24 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
* README: Typo.
|
* README: Typo.
|
||||||
|
|
||||||
2010-01-24 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
2010-01-24 Alexandre Duret-Lutz <adl@lrde.epita.fr>
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,38 @@
|
||||||
#! /usr/bin/perl -w
|
#! /usr/bin/perl -w
|
||||||
# -*- cperl -*-
|
# -*- cperl -*-
|
||||||
|
#
|
||||||
# Check that all the directories in the README exist.
|
# Copyright (C) 2010 Laboratoire de Recherche et Développement de
|
||||||
|
# l'Epita (LRDE).
|
||||||
|
#
|
||||||
|
# This file is part of Spot, a model checking library.
|
||||||
|
#
|
||||||
|
# Spot is free software; you can redistribute it and/or modify it
|
||||||
|
# under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation; either version 2 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# Spot is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||||
|
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||||
|
# License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with Spot; see the file COPYING. If not, write to the Free
|
||||||
|
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
# 02111-1307, USA.
|
||||||
|
#
|
||||||
|
# Check that all the directories documented in README exist, and that
|
||||||
|
# all directories listed in configure.ac are documented.
|
||||||
|
#
|
||||||
# Also has an option --list to print directories which are
|
# Also has an option --list to print directories which are
|
||||||
# documented in the README.
|
# documented.
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
local $\ = "\n";
|
local $\ = "\n";
|
||||||
my $top_srcdir = $ENV{top_srcdir} || "../../";
|
my $top_srcdir = $ENV{top_srcdir} || "../../";
|
||||||
|
my $top_srcdir_len = length($top_srcdir) + 1;
|
||||||
my $list_mode = ($#ARGV != -1 && $ARGV[0] eq "--list");
|
my $list_mode = ($#ARGV != -1 && $ARGV[0] eq "--list");
|
||||||
|
|
||||||
unless (-f "$top_srcdir/README")
|
unless (-f "$top_srcdir/README")
|
||||||
|
|
@ -18,12 +41,17 @@ unless (-f "$top_srcdir/README")
|
||||||
exit 2;
|
exit 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
open(FD, "$top_srcdir/README");
|
open(FD, "$top_srcdir/README")
|
||||||
|
or die "$!: cannot open $top_srcdir/README";
|
||||||
my @directory = ();
|
my @directory = ();
|
||||||
my $exit_status = 0;
|
my $exit_status = 0;
|
||||||
|
|
||||||
|
my %documenteddirs;
|
||||||
|
|
||||||
while (<FD>)
|
while (<FD>)
|
||||||
{
|
{
|
||||||
|
# Skip non-distributed directories.
|
||||||
|
next if /Not distributed/i;
|
||||||
# We consider Third party software?
|
# We consider Third party software?
|
||||||
# last if (/^Third party software$/);
|
# last if (/^Third party software$/);
|
||||||
next unless (m{^(\s*)(\S+/)\s+});
|
next unless (m{^(\s*)(\S+/)\s+});
|
||||||
|
|
@ -37,15 +65,17 @@ while (<FD>)
|
||||||
# Use globbing on the filename.
|
# Use globbing on the filename.
|
||||||
for my $directory (glob("$top_srcdir/$filename"))
|
for my $directory (glob("$top_srcdir/$filename"))
|
||||||
{
|
{
|
||||||
|
my $striped = substr($directory, $top_srcdir_len);
|
||||||
|
$documenteddirs{$striped} = 1;
|
||||||
if ($list_mode)
|
if ($list_mode)
|
||||||
{
|
{
|
||||||
print "$directory";
|
print "$striped";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unless (-d $directory || -f $directory)
|
unless (-d $directory || -f $directory)
|
||||||
{
|
{
|
||||||
print STDERR "$directory does not exist.";
|
print STDERR "$directory mentioned in README does not exist.";
|
||||||
$exit_status = 1;
|
$exit_status = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -54,4 +84,17 @@ while (<FD>)
|
||||||
|
|
||||||
close(FD);
|
close(FD);
|
||||||
|
|
||||||
|
open(FD, "$top_srcdir/configure.ac")
|
||||||
|
or die "$!: cannot open $top_srcdir/configure.ac";
|
||||||
|
while (<FD>)
|
||||||
|
{
|
||||||
|
next unless m{\s*(\S+/)Makefile};
|
||||||
|
unless (exists $documenteddirs{$1})
|
||||||
|
{
|
||||||
|
print STDERR "$1 directory undocumented in README.";
|
||||||
|
$exit_status = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
close(FD);
|
||||||
|
|
||||||
exit $exit_status;
|
exit $exit_status;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue