diff options
Diffstat (limited to 'osinfo/osinfo_tree.c')
-rw-r--r-- | osinfo/osinfo_tree.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/osinfo/osinfo_tree.c b/osinfo/osinfo_tree.c index cedeadc..60deb52 100644 --- a/osinfo/osinfo_tree.c +++ b/osinfo/osinfo_tree.c @@ -463,9 +463,10 @@ OsinfoTree *osinfo_tree_new(const gchar *id, "id", id, NULL); - osinfo_entity_set_param(OSINFO_ENTITY(tree), - OSINFO_TREE_PROP_ARCHITECTURE, - architecture); + if (architecture) + osinfo_entity_set_param(OSINFO_ENTITY(tree), + OSINFO_TREE_PROP_ARCHITECTURE, + architecture); return tree; } @@ -1203,11 +1204,13 @@ OsinfoTree *osinfo_tree_create_from_treeinfo(const gchar *treeinfo, */ gboolean osinfo_tree_matches(OsinfoTree *tree, OsinfoTree *reference) { + const gchar *tree_arch = osinfo_tree_get_architecture(tree); const gchar *tree_treeinfo_family = osinfo_tree_get_treeinfo_family(tree); const gchar *tree_treeinfo_variant = osinfo_tree_get_treeinfo_variant(tree); const gchar *tree_treeinfo_version = osinfo_tree_get_treeinfo_version(tree); const gchar *tree_treeinfo_arch = osinfo_tree_get_treeinfo_arch(tree); + const gchar *reference_arch = osinfo_tree_get_architecture(reference); const gchar *reference_treeinfo_family = osinfo_tree_get_treeinfo_family(reference); const gchar *reference_treeinfo_variant = osinfo_tree_get_treeinfo_variant(reference); const gchar *reference_treeinfo_version = osinfo_tree_get_treeinfo_version(reference); @@ -1216,7 +1219,10 @@ gboolean osinfo_tree_matches(OsinfoTree *tree, OsinfoTree *reference) if (!osinfo_tree_has_treeinfo(reference)) return FALSE; - if (match_regex(reference_treeinfo_family, tree_treeinfo_family) && + if ((!tree_arch || + g_str_equal(reference_arch, tree_arch) || + g_str_equal(reference_arch, "all")) && + match_regex(reference_treeinfo_family, tree_treeinfo_family) && match_regex(reference_treeinfo_variant, tree_treeinfo_variant) && match_regex(reference_treeinfo_version, tree_treeinfo_version) && match_regex(reference_treeinfo_arch, tree_treeinfo_arch)) |