summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-07-31 18:47:21 +0100
committerRichard Hughes <richard@hughsie.com>2016-07-31 21:33:04 +0100
commit61abb8cad425a91b2d99a4a7915fc9256e6815a4 (patch)
treea076eb13e865638850f3252f91d5215a335060f3
parent9309f01877776d14fb8481b013972ef4440be140 (diff)
downloadappstream-glib-61abb8cad425a91b2d99a4a7915fc9256e6815a4.tar.gz
trivial: Fix the flatpak scope when using the symlink name
-rw-r--r--libappstream-glib/as-self-test.c2
-rw-r--r--libappstream-glib/as-store.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/libappstream-glib/as-self-test.c b/libappstream-glib/as-self-test.c
index b522291..6dde169 100644
--- a/libappstream-glib/as-self-test.c
+++ b/libappstream-glib/as-self-test.c
@@ -3025,7 +3025,7 @@ as_test_store_flatpak_func (void)
g_assert_cmpint (apps->len, ==, 1);
app = g_ptr_array_index (apps, 0);
g_assert_cmpstr (as_app_get_id (app), ==, "flatpak:test.desktop");
- g_assert_cmpstr (as_app_get_unique_id (app), ==, "*/flatpak/remote-name/desktop/test.desktop/x86_64/master");
+ g_assert_cmpstr (as_app_get_unique_id (app), ==, "system/flatpak/remote-name/desktop/test.desktop/x86_64/master");
g_assert_cmpstr (as_app_get_id_filename (app), ==, "test");
g_assert_cmpstr (as_app_get_origin (app), ==, "remote-name");
g_assert_cmpstr (as_app_get_source_file (app), ==, filename);
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c
index b1f50c7..00a6a77 100644
--- a/libappstream-glib/as-store.c
+++ b/libappstream-glib/as-store.c
@@ -1063,6 +1063,10 @@ as_store_from_root (AsStore *store,
str[0] = '\0';
id_prefix_app = g_strdup (source_basename);
}
+
+ /* although in ~, this is a system scope app */
+ if (g_strcmp0 (id_prefix_app, "flatpak") == 0)
+ scope = AS_APP_SCOPE_SYSTEM;
}
/* fallback */
@@ -1126,6 +1130,7 @@ as_store_from_root (AsStore *store,
as_app_set_icon_path (app, icon_path);
if (arch != NULL)
as_app_add_arch (app, arch);
+ as_app_set_scope (app, scope);
as_app_set_source_kind (app, AS_APP_SOURCE_KIND_APPSTREAM);
if (!as_app_node_parse (app, n, ctx, &error_local)) {
g_set_error (error,