Blame SOURCES/0004-db-improve-_guess_os_from_tree-checks.patch

4c949f
From 327e4c4f27fdedefc89317e4a42f5382fadefbf3 Mon Sep 17 00:00:00 2001
4c949f
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fabiano@fidencio.org>
4c949f
Date: Sun, 2 Dec 2018 16:37:59 +0100
4c949f
Subject: [PATCH] db: improve _guess_os_from_tree() checks
4c949f
MIME-Version: 1.0
4c949f
Content-Type: text/plain; charset=UTF-8
4c949f
Content-Transfer-Encoding: 8bit
4c949f
4c949f
Do not check against a distro which doesn't have treeinfo data as
4c949f
match_regex() would just match whatever we compare to it.
4c949f
4c949f
Signed-off-by: Fabiano FidĂȘncio <fabiano@fidencio.org>
4c949f
Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
4c949f
(cherry picked from commit 705b08bb3fa44a2266abdd5d145544c67ef0d882)
4c949f
---
4c949f
 osinfo/osinfo_db.c | 6 ++++++
4c949f
 1 file changed, 6 insertions(+)
4c949f
4c949f
diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
4c949f
index fa14c6d..4f8684a 100644
4c949f
--- a/osinfo/osinfo_db.c
4c949f
+++ b/osinfo/osinfo_db.c
4c949f
@@ -763,6 +763,12 @@ OsinfoOs *osinfo_db_guess_os_from_tree(OsinfoDb *db,
4c949f
             const gchar *os_version = osinfo_tree_get_treeinfo_version(os_tree);
4c949f
             const gchar *os_arch = osinfo_tree_get_treeinfo_arch(os_tree);
4c949f
 
4c949f
+            if (os_family == NULL &&
4c949f
+                os_variant == NULL &&
4c949f
+                os_version == NULL &&
4c949f
+                os_arch == NULL)
4c949f
+                continue;
4c949f
+
4c949f
             if (match_regex(os_family, tree_family) &&
4c949f
                 match_regex(os_variant, tree_variant) &&
4c949f
                 match_regex(os_version, tree_version) &&
4c949f
-- 
4c949f
2.21.0
4c949f