builder: Remove all SDK extension from the platform

Instead of hardoding the locale and debug one.
This allows us to have SDK-specific extensions that
are not in the platform
tingping/wmclass
Alexander Larsson 2017-03-16 18:46:56 +01:00
parent 459e1c2b31
commit 9a62c456e3
1 changed files with 9 additions and 6 deletions

View File

@ -2339,10 +2339,9 @@ builder_manifest_create_platform (BuilderManifest *self,
g_autoptr(GFile) metadata = g_file_get_child (app_dir, "metadata");
g_autoptr(GFile) dest_metadata = g_file_get_child (app_dir, "metadata.platform");
g_autoptr(GKeyFile) keyfile = g_key_file_new ();
g_autofree char *sdk_locale_id = builder_manifest_get_locale_id (self);
g_autofree char *sdk_debug_id = builder_manifest_get_debug_id (self);
g_autofree char *sdk_locale_group = g_strdup_printf ("Extension %s", sdk_locale_id);
g_autofree char *sdk_debug_group = g_strdup_printf ("Extension %s", sdk_debug_id);
g_auto(GStrv) groups = NULL;
g_autofree char *sdk_group_prefix = g_strdup_printf ("Extension %s.", self->id);
int j;
if (!g_key_file_load_from_file (keyfile,
flatpak_file_get_path_cached (metadata),
@ -2355,8 +2354,12 @@ builder_manifest_create_platform (BuilderManifest *self,
g_key_file_set_string (keyfile, "Runtime", "name", self->id_platform);
g_key_file_remove_group (keyfile, sdk_locale_group, NULL);
g_key_file_remove_group (keyfile, sdk_debug_group, NULL);
groups = g_key_file_get_groups (keyfile, NULL);
for (j = 0; groups[j] != NULL; j++)
{
if (g_str_has_prefix (groups[j], sdk_group_prefix))
g_key_file_remove_group (keyfile, groups[j], NULL);
}
if (!g_key_file_save_to_file (keyfile,
flatpak_file_get_path_cached (dest_metadata),