The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

bin/iafa_lint.pl - perform sanity check on a collection of IAFA templates

SYNOPSIS

  bin/iafa_lint.pl [-ad] [-o outlinedir] [-s sourcedir]
    [file1 file2 ... fileN]

DESCRIPTION

This program performs some basic checks on the contents of a collection of IAFA templates, such as may be found on a ROADS server.

The contents of each template are checked against an outline version of that template type. Outline templates are used within the ROADS software to indicate the fields which a template may contain, and provide some of the configuration information used by the WWW based template editor.

iafa_lint.pl produces a report listing any of these problems which it finds with the IAFA templates it processes. The following checks are performed:

martian attributes/value pairs

These are neither continuation lines from previous attribute/value pairs, or the beginning of a new attribute/value pair. They may be caused by, for example, hand editing templates and forgetting to indent continuation lines by a least one space.

no space between attribute name and value

In ROADS, records must have at least one space following the colon after the attribute name and before the value. This might not be the case if the record has be hand edited or imported from another system.

presence of unexpected attributes

If attributes appear in a template but not in the outline specification for this template type, attention is drawn to them. It also serves to flag mis-spelled attribute names, e.g. Handel instead of Handle.

presence of templates which do not have an outline specification

This is effectively an error if you are using the ROADS software, since the outline information is used in a number of places. It also serves to draw notice to mis-spelled Template-Type values!

handle attribute contains whitespace characters

This is to draw your attention to any templates whose handles (unique IDs within the database) contain whitespace characters such as tabs and spaces. Whitespace should not appear in handles because this would confuse some of the ROADS tools.

template contains carriage returns

The use of older versions of the ROADS template editor tool mktemp.pl, and some external programs such as text editors and FTP clients, may result in templates containing carriage return characters - ASCII code 13. We have tried to make the ROADS tools fairly tolerant, but this may cause problems.

OPTIONS

iafa_lint.pl takes the following arguments:

-a

This argument indicates that all of the templates in the given source directory should be processed.

-d

If this argument is given, debugging information will be dumped to the standard error output stream

-o outlinedir

This argument can be used to override the default outline directory, which is where the outline versions of each template type are stored.

-s sourcedir

This argument can be used to override the default template source directory, which is where iafa_lint.pl looks for IAFA templates to check.

OUTLINE FILE FORMAT

You may need to either modify an existing outline file or create a new one, depending on whether you have invented a new template type or changed the attributes in an existing one. A set of default template outlines are distributed with the ROADS software, and can be found in the directory "\$ROADS::Config" on your installation.

It is necessary to have outline files for each template type which you will be checking using iafa_lint.pl

Each outline file must feature the Template-Type and Handle attributes. Attributes which only occur once should be written as they appear in the template, e.g. Title. Attributes which may occur multiple times should be written as variants, e.g. URI-v*. Finally, it is possible to refer to clusters of attributes drawn from another type of template by writing its name in brackets after a disambiguating prefix, e.g. Admin-(USER*).

A sample outline specification for a very short SERVICE template would look like this:

  Template-Type: SERVICE
  Handle:
  Title:
  URI-v*:
  Admin-(USER*):

Note that other information may appear after the ":" character. This is not used by iafa_lint.pl.

SEE ALSO

admin-cgi/iafa_lint.pl

COPYRIGHT

Copyright (c) 1988, Martin Hamilton <martinh@gnu.org> and Jon Knight <jon@net.lut.ac.uk>. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

It was developed by the Department of Computer Studies at Loughborough University of Technology, as part of the ROADS project. ROADS is funded under the UK Electronic Libraries Programme (eLib), the European Commission Telematics for Research Programme, and the TERENA development programme.

AUTHOR

Martin Hamilton <martinh@gnu.org>