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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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;
 
-- 
2.19.2

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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux