core: Store "pending" objects explicitly, fix pull to use them

Before we were creating randomly-named temporary files in repo/tmp
when downloading via pull, but that means if the download process is
interrupted, we have to redownload everything again.

Let's still keep the concept of a "transaction" where files are
stored in the repository as atomically as possible (i.e. we
do a bunch of rename() calls), but now we also have an explicit
"tmp/pending/objects" directory that contains named objects.

This allows us to then skip redownloading things that are pending.
This commit is contained in:
Colin Walters committed 2012-02-23 18:19:00 -05:00
1 parent 802959f398
commit b2ad353b42
3 files changed
+302 -228

No files matched your search

+7 -6
View File
@@ -92,12 +92,13 @@ gboolean ostree_repo_abort_transaction (OstreeRepo *self,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_has_object (OstreeRepo *self,
OstreeObjectType objtype,
const char *checksum,
gboolean *out_have_object,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_find_object (OstreeRepo *self,
OstreeObjectType objtype,
const char *checksum,
GFile **out_stored_path,
GFile **out_pending_path,
GCancellable *cancellable,
GError **error);
gboolean ostree_repo_stage_object (OstreeRepo *self,
OstreeObjectType objtype,