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.
tingping/wmclass
Alexander Larsson 2015-02-03 10:53:02 +01:00
parent bc460da1c5
commit 55a3f413c2
1 changed files with 4 additions and 2 deletions

View File

@ -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))