summaryrefslogtreecommitdiff
path: root/builder
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2016-01-18 11:36:24 +0100
committerAlexander Larsson <alexl@redhat.com>2016-01-18 11:36:24 +0100
commit701d800059b36b67d890363a2ccaf02b9a693f5f (patch)
tree75bd5c88eb1a749904dfb641ee84e8346d6346ea /builder
parentefad98815a73385b98fe8c5e78f90c7ed590e4a6 (diff)
downloadxdg-app-701d800059b36b67d890363a2ccaf02b9a693f5f.tar.gz
builder: Correctly handling non-existing app dir when applying cache
Diffstat (limited to 'builder')
-rw-r--r--builder/builder-cache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/builder/builder-cache.c b/builder/builder-cache.c
index fb9df71..4bf17f6 100644
--- a/builder/builder-cache.c
+++ b/builder/builder-cache.c
@@ -251,6 +251,7 @@ builder_cache_checkout (BuilderCache *self, const char *commit)
{
g_autoptr(GFile) root = NULL;
g_autoptr(GFileInfo) file_info = NULL;
+ g_autoptr(GError) my_error = NULL;
if (!ostree_repo_read_commit (self->repo, commit, &root, NULL, NULL, NULL))
return FALSE;
@@ -261,7 +262,8 @@ builder_cache_checkout (BuilderCache *self, const char *commit)
if (file_info == NULL)
return FALSE;
- if (!g_file_delete (self->app_dir, NULL, NULL))
+ if (!g_file_delete (self->app_dir, NULL, &my_error) &&
+ !g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
return FALSE;
/* We check out without user mode, not necessarily because we care
@@ -568,7 +570,7 @@ builder_gc (BuilderCache *self,
return FALSE;
}
- g_print ("Pruning cache");
+ g_print ("Pruning cache\n");
return ostree_repo_prune (self->repo,
OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY, -1,
&objects_total,