On Mon, Dec 10, 2018 at 01:37:37PM +0100, Fabiano Fidêncio wrote:
> From: Fabiano Fidêncio <fabi...@fidencio.org>
> 
> 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.

I'd rework the commit log a bit now that it uses
osinfo_tree_has_treeinfo();

> 
> Signed-off-by: Fabiano Fidêncio <fabi...@fidencio.org>
> ---
>  osinfo/osinfo_db.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
> index fa14c6d..bf73e25 100644
> --- a/osinfo/osinfo_db.c
> +++ b/osinfo/osinfo_db.c
> @@ -763,6 +763,9 @@ OsinfoOs *osinfo_db_guess_os_from_tree(OsinfoDb *db,
>              const gchar *os_version = 
> osinfo_tree_get_treeinfo_version(os_tree);
>              const gchar *os_arch = osinfo_tree_get_treeinfo_arch(os_tree);
>  
> +            if (!osinfo_tree_has_treeinfo(os_tree))
> +                continue;

and here, we first assume treeinfo is available by calling
osinfo_tree_get_treeinfo_*, and then we check if the ostree actually has
treeinfo. I'd move the osinfo_tree_get_treeinfo_* calls later.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Libosinfo mailing list
Libosinfo@redhat.com
https://www.redhat.com/mailman/listinfo/libosinfo

Reply via email to