Skip to content

Commit

Permalink
Move locale migration after cleanup
Browse files Browse the repository at this point in the history
Otherwise, module-level cleanup can remove locale symlinks that point to
locale data installed by other modules.

Closes #154
  • Loading branch information
chrisawi committed Mar 2, 2024
1 parent 8c036e0 commit 5860dd3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
16 changes: 16 additions & 0 deletions src/builder-manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -2761,6 +2761,22 @@ builder_manifest_cleanup (BuilderManifest *self,
}
}

if (builder_context_get_separate_locales (context))
{
g_autoptr(GFile) root_dir = NULL;

if (builder_context_get_build_runtime (context))
root_dir = g_file_get_child (app_dir, "usr");
else
root_dir = g_file_get_child (app_dir, "files");

if (!builder_migrate_locale_dirs (root_dir, error))
{
g_prefix_error (error, "Can't migrate locale dirs: ");
return FALSE;
}
}

app_root = g_file_get_child (app_dir, "files");

appdata_source = builder_manifest_find_appdata_file (self, app_root);
Expand Down
16 changes: 0 additions & 16 deletions src/builder-module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1916,22 +1916,6 @@ builder_module_build_helper (BuilderModule *self,

builder_set_term_title (_("Post-Install %s"), self->name);

if (builder_context_get_separate_locales (context))
{
g_autoptr(GFile) root_dir = NULL;

if (builder_context_get_build_runtime (context))
root_dir = g_file_get_child (app_dir, "usr");
else
root_dir = g_file_get_child (app_dir, "files");

if (!builder_migrate_locale_dirs (root_dir, error))
{
g_prefix_error (error, "module %s: ", self->name);
return FALSE;
}
}

if (self->post_install)
{
for (i = 0; self->post_install[i] != NULL; i++)
Expand Down

0 comments on commit 5860dd3

Please sign in to comment.