summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-04-28 20:43:27 +0200
committerAlexander Larsson <alexl@redhat.com>2016-04-28 20:43:27 +0200
commit6112eb14709ad37b9bf518ee4eeaccb39844f1f2 (patch)
tree081568fe124874f384439fcf921b8c68df6681b8 /app
parentc0f2304f8163d19548fd9ca11737d90cb912ad85 (diff)
downloadxdg-app-6112eb14709ad37b9bf518ee4eeaccb39844f1f2.tar.gz
oci: Move the extra files (ref/metadata/commit) too rootfs
Saving them in the image means they will be transferred with it, increasing the chances that the commit can be recreated from the image.
Diffstat (limited to 'app')
-rw-r--r--app/xdg-app-builtins-build-bundle.c10
-rw-r--r--app/xdg-app-builtins-build-import-bundle.c10
2 files changed, 10 insertions, 10 deletions
diff --git a/app/xdg-app-builtins-build-bundle.c b/app/xdg-app-builtins-build-bundle.c
index 57d3039..51ef9c2 100644
--- a/app/xdg-app-builtins-build-bundle.c
+++ b/app/xdg-app-builtins-build-bundle.c
@@ -816,24 +816,24 @@ build_oci (OstreeRepo *repo, GFile *file,
if (!opt_runtime && g_file_query_exists (export, NULL))
{
- opts.path_prefix = "export/";
+ opts.path_prefix = "rootfs/export/";
if (!ostree_repo_export_tree_to_archive (repo, &opts, (OstreeRepoFile*)export, a,
cancellable, error))
return FALSE;
}
opts.path_prefix = NULL;
- if (!add_file (a, "metadata", repo, metadata, &opts, cancellable, error))
+ if (!add_file (a, "rootfs/metadata", repo, metadata, &opts, cancellable, error))
return FALSE;
- if (!add_file_from_data (a, "ref",
+ if (!add_file_from_data (a, "rootfs/ref",
repo,
full_branch,
strlen (full_branch),
&opts, cancellable, error))
return FALSE;
- if (!add_file_from_data (a, "commit",
+ if (!add_file_from_data (a, "rootfs/commit",
repo,
g_variant_get_data (commit_data),
g_variant_get_size (commit_data),
@@ -842,7 +842,7 @@ build_oci (OstreeRepo *repo, GFile *file,
if (commit_metadata != NULL)
{
- if (!add_file_from_data (a, "commitmeta",
+ if (!add_file_from_data (a, "rootfs/commitmeta",
repo,
g_variant_get_data (commit_metadata),
g_variant_get_size (commit_metadata),
diff --git a/app/xdg-app-builtins-build-import-bundle.c b/app/xdg-app-builtins-build-import-bundle.c
index 06ecc89..12b9096 100644
--- a/app/xdg-app-builtins-build-import-bundle.c
+++ b/app/xdg-app-builtins-build-import-bundle.c
@@ -99,10 +99,10 @@ import_oci (OstreeRepo *repo, GFile *file,
if (!ostree_repo_file_ensure_resolved ((OstreeRepoFile*)archive_root, error))
return FALSE;
- ref = g_file_get_child (archive_root, "ref");
- metadata = g_file_get_child (archive_root, "metadata");
- commit = g_file_get_child (archive_root, "commit");
- commitmeta = g_file_get_child (archive_root, "commitmeta");
+ ref = g_file_resolve_relative_path (archive_root, "rootfs/ref");
+ metadata = g_file_resolve_relative_path (archive_root, "rootfs/metadata");
+ commit = g_file_resolve_relative_path (archive_root, "rootfs/commit");
+ commitmeta = g_file_resolve_relative_path (archive_root, "rootfs/commitmeta");
if (!g_file_query_exists (ref, NULL))
return xdg_app_fail (error, "Required file ref not in tarfile");
@@ -125,7 +125,7 @@ import_oci (OstreeRepo *repo, GFile *file,
if (!g_file_query_exists (files, NULL))
return xdg_app_fail (error, "Required directory %s not in tarfile", files_source);
- export = g_file_get_child (archive_root, "export");
+ export = g_file_resolve_relative_path (archive_root, "rootfs/export");
if (!g_file_load_contents (commit, cancellable,
&commit_data, &commit_size,