From 55a3f413c29b31c1e83e70ecda6bbdfff44e5be1 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 3 Feb 2015 10:53:02 +0100 Subject: [PATCH] build-finish: Don't error out on exports gs_shutil_cp_a dies if the target exists, so only create the parent dir before copying. --- xdg-app-builtins-build-finish.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xdg-app-builtins-build-finish.c b/xdg-app-builtins-build-finish.c index 537512074..927cc3aaf 100644 --- a/xdg-app-builtins-build-finish.c +++ b/xdg-app-builtins-build-finish.c @@ -65,9 +65,11 @@ collect_exports (GFile *base, GCancellable *cancellable, GError **error) { g_debug ("Exporting from %s", paths[i]); gs_unref_object GFile *dest = NULL; + gs_unref_object GFile *dest_parent = NULL; dest = g_file_resolve_relative_path (export, paths[i]); - g_debug ("Ensuring export/%s exists", paths[i]); - if (!gs_file_ensure_directory (dest, TRUE, cancellable, error)) + dest_parent = g_file_get_parent (dest); + g_debug ("Ensuring export/%s parent exists", paths[i]); + if (!gs_file_ensure_directory (dest_parent, TRUE, cancellable, error)) goto out; g_debug ("Copying from files/%s", paths[i]); if (!gs_shutil_cp_a (src, dest, cancellable, error))