Commit cbdb0feb authored by Guillaume Sadegh's avatar Guillaume Sadegh
Browse files

* src/sanity/readme.test: A script to check whether all the

directories referenced in README exist.
* src/sanity/Makefile.am: Adjust to call `readme.test' when make
check is invoked.
parent 3633fced
2010-01-24 Guillaume Sadegh <sadegh@lrde.epita.fr>
* src/sanity/readme.test: A script to check whether all the
directories referenced in README exist.
* src/sanity/Makefile.am: Adjust to call `readme.test' when make
check is invoked.
2010-01-24 Guillaume Sadegh <sadegh@lrde.epita.fr>
Update the README.
......
......@@ -34,6 +34,8 @@ check-local:
$(SHELL) $(srcdir)/80columns.test $(TESTHEADER)
INCDIR='$(top_srcdir)/src' \
$(SHELL) $(srcdir)/style.test $(TESTHEADER)
top_srcdir='$(top_srcdir)' \
$(PERL) $(srcdir)/readme.test
# Ensure we have not forgotten to include an header.
installcheck-local:
......
#! /usr/bin/perl -w
# -*- cperl -*-
# Check that all the directories in the README exist.
# Also has an option --list to print directories which are
# documented in the README.
use strict;
use warnings;
local $\ = "\n";
my $top_srcdir = $ENV{top_srcdir} || "../../";
my $list_mode = ($#ARGV != -1 && $ARGV[0] eq "--list");
unless (-f "$top_srcdir/README")
{
print STDERR "$top_srcdir/README not found";
exit 2;
}
open(FD, "$top_srcdir/README");
my @directory = ();
my $exit_status = 0;
while (<FD>)
{
# We consider Third party software?
# last if (/^Third party software$/);
next unless (m{^(\s*)(\S+/)\s+});
my $level = length($1) / 3;
my $name = $2;
$directory[$level] = $name;
$#directory = $level;
my $filename = join "", @directory;
# Use globbing on the filename.
for my $directory (glob("$top_srcdir/$filename"))
{
if ($list_mode)
{
print "$directory";
}
else
{
unless (-d $directory || -f $directory)
{
print STDERR "$directory does not exist.";
$exit_status = 1;
}
}
}
}
close(FD);
exit $exit_status;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment