[ostree] prune: Don't fail if a to-be-pruned object doesn't exist
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] prune: Don't fail if a to-be-pruned object doesn't exist
- Date: Tue, 16 Jul 2013 14:03:43 +0000 (UTC)
commit 272274f0afdd7c470956a09565918efb6af13bce
Author: Colin Walters <walters verbum org>
Date: Tue Jul 16 10:01:58 2013 -0400
prune: Don't fail if a to-be-pruned object doesn't exist
Previously, if a prune was interrupted, further attempts would fail.
It's just better to silently continue here.
src/libostree/ostree-repo-prune.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/src/libostree/ostree-repo-prune.c b/src/libostree/ostree-repo-prune.c
index 0f173d5..5260e33 100644
--- a/src/libostree/ostree-repo-prune.c
+++ b/src/libostree/ostree-repo-prune.c
@@ -56,15 +56,17 @@ maybe_prune_loose_object (OtPruneData *data,
{
gs_unref_object GFileInfo *info = NULL;
- if ((info = g_file_query_info (objf, OSTREE_GIO_FAST_QUERYINFO,
- G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
- cancellable, error)) == NULL)
+ if (!ot_gfile_query_info_allow_noent (objf, OSTREE_GIO_FAST_QUERYINFO,
+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+ &info, cancellable, error))
goto out;
- if (!gs_file_unlink (objf, cancellable, error))
- goto out;
-
- data->freed_bytes += g_file_info_get_size (info);
+ if (info)
+ {
+ if (!gs_file_unlink (objf, cancellable, error))
+ goto out;
+ data->freed_bytes += g_file_info_get_size (info);
+ }
}
if (OSTREE_OBJECT_TYPE_IS_META (objtype))
data->n_unreachable_meta++;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]