mirror of
https://github.com/flatpak/flatpak.git
synced 2026-10-21 07:05:25 -04:00
builder: Skip separate locales exportation if directory doesn't exist
This will avoid errors when separate_locales is set to true but the locales directory does not exist. This is the case of many apps that do not support separate locales but haven't specifically set separate_locales to false in the configuration.
This commit is contained in:
1 parent
cfd3f303b1
commit
39279c8b8b
1 file changed
+5
-2
@@ -1633,7 +1633,7 @@ builder_manifest_finish (BuilderManifest *self,
|
||||
locale_parent_dir = g_file_resolve_relative_path (app_dir, "files/share/runtime/locale");
|
||||
}
|
||||
|
||||
if (self->separate_locales)
|
||||
if (self->separate_locales && g_file_query_exists (locale_parent_dir, NULL))
|
||||
{
|
||||
g_autoptr(GFile) metadata_file = NULL;
|
||||
g_autofree char *extension_contents = NULL;
|
||||
@@ -1720,6 +1720,7 @@ builder_manifest_create_platform (BuilderManifest *self,
|
||||
GError **error)
|
||||
{
|
||||
GFile *app_dir = builder_context_get_app_dir (context);
|
||||
g_autoptr(GFile) locale_dir = NULL;
|
||||
int i;
|
||||
|
||||
if (!self->build_runtime ||
|
||||
@@ -1779,6 +1780,8 @@ builder_manifest_create_platform (BuilderManifest *self,
|
||||
|
||||
if (!builder_migrate_locale_dirs (root_dir, error))
|
||||
return FALSE;
|
||||
|
||||
locale_dir = g_file_resolve_relative_path (root_dir, "share/runtime/locale");
|
||||
}
|
||||
|
||||
if (self->metadata_platform)
|
||||
@@ -1883,7 +1886,7 @@ builder_manifest_create_platform (BuilderManifest *self,
|
||||
}
|
||||
}
|
||||
|
||||
if (self->separate_locales)
|
||||
if (self->separate_locales && locale_dir && g_file_query_exists (locale_dir, NULL))
|
||||
{
|
||||
g_autoptr(GFile) metadata_file = NULL;
|
||||
g_autofree char *extension_contents = NULL;
|
||||
|
||||
Reference in new issue
Block a user