build: Fix support for flatpak-build and subdir extensions

In this case we need to create a tmpfs on the extension point
so that the real mountpoint can be created.
This commit is contained in:
Alexander Larsson
2017-02-01 17:56:16 +01:00
parent 56fe910fc1
commit 668a8d817b

View File

@@ -76,6 +76,7 @@ flatpak_builtin_build (int argc, char **argv, GCancellable *cancellable, GError
g_autofree char *runtime_ref = NULL;
g_autofree char *extensionof_ref = NULL;
g_autofree char *extension_point = NULL;
g_autofree char *extension_tmpfs_point = NULL;
g_autoptr(GKeyFile) metakey = NULL;
g_autoptr(GKeyFile) runtime_metakey = NULL;
g_autoptr(GPtrArray) argv_array = NULL;
@@ -228,10 +229,14 @@ flatpak_builtin_build (int argc, char **argv, GCancellable *cancellable, GError
{
app_files = flatpak_deploy_get_files (extensionof_deploy);
app_files_ro = TRUE;
if (x_subdir != NULL)
extension_tmpfs_point = g_build_filename ("/app", x_dir, NULL);
extension_point = g_build_filename ("/app", x_dir, x_subdir, NULL);
}
else
{
if (x_subdir != NULL)
extension_tmpfs_point = g_build_filename ("/usr", x_dir, NULL);
extension_point = g_build_filename ("/usr", x_dir, x_subdir, NULL);
}
}
@@ -275,6 +280,11 @@ flatpak_builtin_build (int argc, char **argv, GCancellable *cancellable, GError
"--dir", "/app",
NULL);
if (extension_tmpfs_point)
add_args (argv_array,
"--tmpfs", extension_tmpfs_point,
NULL);
if (extension_point)
add_args (argv_array,
"--bind", flatpak_file_get_path_cached (res_files), extension_point,