summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-04-20 09:55:13 +0200
committerAlexander Larsson <alexl@redhat.com>2016-04-20 09:55:13 +0200
commit5392f2d629a5f7c12456a9ae125e21ddf93933d3 (patch)
tree2999eae679dc041914678edd00bb28fe78cfa033 /app
parentcfd3f303b18b009a6eed5bb1d3eaf8980cdf7b64 (diff)
downloadxdg-app-5392f2d629a5f7c12456a9ae125e21ddf93933d3.tar.gz
common: Break out xdg_app_mtree_create_root helper
Diffstat (limited to 'app')
-rw-r--r--app/xdg-app-builtins-build-export.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/app/xdg-app-builtins-build-export.c b/app/xdg-app-builtins-build-export.c
index e8e531c..345f93b 100644
--- a/app/xdg-app-builtins-build-export.c
+++ b/app/xdg-app-builtins-build-export.c
@@ -341,26 +341,8 @@ xdg_app_builtin_build_export (int argc, char **argv, GCancellable *cancellable,
mtree = ostree_mutable_tree_new ();
- {
- g_autoptr(GVariant) dirmeta = NULL;
- g_autoptr(GFileInfo) file_info = g_file_info_new ();
- g_autofree guchar *csum;
- g_autofree char *checksum = NULL;
-
- g_file_info_set_name (file_info, "/");
- g_file_info_set_file_type (file_info, G_FILE_TYPE_DIRECTORY);
- g_file_info_set_attribute_uint32 (file_info, "unix::uid", 0);
- g_file_info_set_attribute_uint32 (file_info, "unix::gid", 0);
- g_file_info_set_attribute_uint32 (file_info, "unix::mode", 040755);
-
- dirmeta = ostree_create_directory_metadata (file_info, NULL);
- if (!ostree_repo_write_metadata (repo, OSTREE_OBJECT_TYPE_DIR_META, NULL,
- dirmeta, &csum, cancellable, error))
- goto out;
-
- checksum = ostree_checksum_from_bytes (csum);
- ostree_mutable_tree_set_metadata_checksum (mtree, checksum);
- }
+ if (!xdg_app_mtree_create_root (repo, mtree, cancellable, error))
+ goto out;
if (!ostree_mutable_tree_ensure_dir (mtree, "files", &files_mtree, error))
goto out;