repo-pull: Allow pulling only one directory

Changes the pull API to allow pulling only a single directory instead
of the whole deployment.  This option is utilized by the check-diff
option in rpm-ostree.

Add a new state directory to hold <checksum>.commitpartial files, so
we know that we've only downloaded partial state.
This commit is contained in:
Anne LoVerso authored and Colin Walters committed 2014-08-20 15:09:32 -04:00
1 parent 6a55d2c32f
commit 3742c32945
10 files changed
+264 -16

No files matched your search

+23
View File
@@ -35,6 +35,23 @@ typedef struct {
guint64 freed_bytes;
} OtPruneData;
static gboolean
prune_commitpartial_file (OstreeRepo *repo,
const char *checksum,
GCancellable *cancellable,
GError **error)
{
gboolean ret = FALSE;
gs_unref_object GFile *objpath = ot_gfile_resolve_path_printf (repo->repodir, "state/%s.commitpartial", checksum);
if (!ot_gfile_ensure_unlinked (objpath, cancellable, error))
goto out;
ret = TRUE;
out:
return ret;
}
static gboolean
maybe_prune_loose_object (OtPruneData *data,
OstreeRepoPruneFlags flags,
@@ -54,6 +71,12 @@ maybe_prune_loose_object (OtPruneData *data,
{
guint64 storage_size = 0;
if (objtype == OSTREE_OBJECT_TYPE_COMMIT)
{
if (!prune_commitpartial_file (data->repo, checksum, cancellable, error))
goto out;
}
if (!ostree_repo_query_object_storage_size (data->repo, objtype, checksum,
&storage_size, cancellable, error))
goto out;