[Libosinfo] [libosinfo PATCH 1/1] db: improve _guess_os_from_media() checks

Cole Robinson crobinso at redhat.com
Tue Jan 15 20:13:02 UTC 2019


On 01/14/2019 11:08 AM, Fabiano Fidêncio wrote:
> Do not check against a distro which doesn't have *any* of the values we
> use to check as match_regex() would just match whatever we compare to
> it.
> 
> Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> ---
>   osinfo/osinfo_db.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
> index a12cee8..5696279 100644
> --- a/osinfo/osinfo_db.c
> +++ b/osinfo/osinfo_db.c
> @@ -577,6 +577,13 @@ osinfo_db_guess_os_from_media_internal(OsinfoDb *db,
>               const gchar *os_application = osinfo_media_get_application_id(os_media);
>               gint64 os_vol_size = osinfo_media_get_volume_size(os_media);
>   
> +            if (os_volume == NULL &&
> +                os_system == NULL &&
> +                os_publisher == NULL &&
> +                os_application == NULL &&
> +                os_vol_size <= 0)
> +                continue;
> +
>               if (os_vol_size <= 0)
>                   os_vol_size = media_vol_size;
>   
> 

Reviewed-by: Cole Robinson <crobinso at redhat.com>

- Cole




More information about the Libosinfo mailing list