builtins: Support '@' tag in extension names

Closes: #1531
Approved by: alexlarsson
This commit is contained in:
Sam Spilsbury
2018-03-27 16:57:40 +07:00
committed by Atomic Bot
parent b6d1a20223
commit bc5cfafb26

View File

@@ -74,14 +74,20 @@ ensure_extensions (FlatpakDeploy *src_deploy, const char *default_branch,
for (i = 0; src_extensions[i] != NULL; i++)
{
const char *requested_extension = src_extensions[i];
g_autofree char *requested_extension_name = NULL;
gboolean found = FALSE;
/* Remove any '@' from the name */
flatpak_parse_extension_with_tag (requested_extension,
&requested_extension_name,
NULL);
for (l = extensions; l != NULL; l = l->next)
{
FlatpakExtension *ext = l->data;
if (strcmp (ext->installed_id, requested_extension) == 0 ||
strcmp (ext->id, requested_extension) == 0)
if (strcmp (ext->installed_id, requested_extension_name) == 0 ||
strcmp (ext->id, requested_extension_name) == 0)
{
if (!ext->is_unmaintained)
{
@@ -128,7 +134,7 @@ ensure_extensions (FlatpakDeploy *src_deploy, const char *default_branch,
if (!found)
{
g_list_free_full (extensions, (GDestroyNotify) flatpak_extension_free);
return flatpak_fail (error, _("Requested extension %s not installed"), requested_extension);
return flatpak_fail (error, _("Requested extension %s not installed"), requested_extension_name);
}
}