From bc5cfafb26b7e81ef796f05c2930afa09bdba36b Mon Sep 17 00:00:00 2001 From: Sam Spilsbury Date: Tue, 27 Mar 2018 16:57:40 +0700 Subject: [PATCH] builtins: Support '@' tag in extension names Closes: #1531 Approved by: alexlarsson --- app/flatpak-builtins-build-init.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/flatpak-builtins-build-init.c b/app/flatpak-builtins-build-init.c index 9a730cef..f0bb090b 100644 --- a/app/flatpak-builtins-build-init.c +++ b/app/flatpak-builtins-build-init.c @@ -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); } }