builder: allow the index parser to parse files with no sections

Gracefully handle files with no sections; extend the validate.sh test
to try to validate an empty file.
builder: do not parse the same repository file name twice

When parsing the repository configuration files, track the file names
parsed, and in case of same file name in multiple location consider only
the one in the directory coming before others in the prioritised list of
paths.

This way it is possible to "shadow" a configuration file in a system
path with one with the same name in a local directory, for example.