repositories: Refactor how we are reading metadata
This is a large rewrite of how we are discovering and reading any
repository metadata.
It first of all makes the code a little bit more straight forward by
breaking steps into their own function.
Those functions will now do "the right thing" depending whether we are
dealing with a local or remote repository and will try to read
repository metdata for local repositories, too.
If that fails, we will of course fall back and scan.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>