diff --git a/builder/builder-manifest.c b/builder/builder-manifest.c index 9fb9be49c..859209cce 100644 --- a/builder/builder-manifest.c +++ b/builder/builder-manifest.c @@ -956,16 +956,36 @@ builder_manifest_get_id (BuilderManifest *self) return self->id; } +/* Dashes are only valid in the last part of the app id, so + we replace them with underscore so we can suffix the id */ +static char * +make_valid_id_prefix (const char *orig_id) +{ + char *id, *t; + + id = g_strdup (orig_id); + t = strchr (id, '-'); + while (t != NULL) + { + *t = '_'; + t = strchr (t + 1, '-'); + } + + return id; +} + char * builder_manifest_get_locale_id (BuilderManifest *self) { - return g_strdup_printf ("%s.Locale", self->id); + g_autofree char *id = make_valid_id_prefix (self->id); + return g_strdup_printf ("%s.Locale", id); } char * builder_manifest_get_debug_id (BuilderManifest *self) { - return g_strdup_printf ("%s.Debug", self->id); + g_autofree char *id = make_valid_id_prefix (self->id); + return g_strdup_printf ("%s.Debug", id); } const char * @@ -977,7 +997,15 @@ builder_manifest_get_id_platform (BuilderManifest *self) char * builder_manifest_get_locale_id_platform (BuilderManifest *self) { - return g_strdup_printf ("%s.Locale", self->id_platform); + char *res = NULL; + + if (self->id_platform != NULL) + { + g_autofree char *id = make_valid_id_prefix (self->id_platform); + res = g_strdup_printf ("%s.Locale", id); + } + + return res; } BuilderOptions *