On Mon, Dec 10, 2018 at 1:57 PM Christophe Fergeau <[email protected]> wrote:
>
> Hey,
>
> On Sun, Dec 02, 2018 at 04:37:59PM +0100, Fabiano Fidêncio wrote:
> > Do not check against a distro that has all the treeinfo attribute as
> > NULL as match_regex() would just match whatever we compare to it.
>
> When can this happen?

When testing *any* distro :-)

For instance, in osinfo_db_guess_from_os_tree() we go through the list
of OSes testing against the one we passed, right? So, here the one
passed is the "regex" for the match_regex() and the info we get from
the OS is the "pattern".
Considering this ... we end up testing, for instance, against Fedora 6
which doesn't have the treeinfo fields. Then, if you take a look at
match_regex() code, you'll find out that we just return "true" in case
the pattern is NULL.

So, in the end, we should only try to match the treeinfo when the
system we're trying to match to provides treeinfo.

[snip]

_______________________________________________
Libosinfo mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/libosinfo

Reply via email to