pull: Support --mirror option

There's several use cases for calling into ostree itself to do
mirroring, instead of using bare rsync.  For example, it's a bit more
efficient as it doesn't require syncing the objects/ directory.

https://bugzilla.gnome.org/show_bug.cgi?id=728351
This commit is contained in:
Colin Walters committed 2014-06-16 17:14:13 -04:00
1 parent 4ac27caefd
commit 6a5e66b152
4 files changed
+19 -3

No files matched your search

+2 -2
View File
@@ -1262,8 +1262,8 @@ ostree_repo_pull (OstreeRepo *self,
}
else
{
ostree_repo_transaction_set_ref (pull_data->repo, pull_data->remote_name, ref, checksum);
gboolean is_mirror = (pull_data->flags & OSTREE_REPO_PULL_FLAGS_MIRROR) > 0;
ostree_repo_transaction_set_ref (pull_data->repo, is_mirror ? NULL : pull_data->remote_name, ref, checksum);
}
}
+3 -1
View File
@@ -510,9 +510,11 @@ gboolean ostree_repo_prune (OstreeRepo *self,
/**
* OstreeRepoPullFlags:
* @OSTREE_REPO_PULL_FLAGS_NONE: No special options for pull
* @OSTREE_REPO_PULL_FLAGS_MIRROR: Write out refs suitable for mirrors
*/
typedef enum {
OSTREE_REPO_PULL_FLAGS_NONE
OSTREE_REPO_PULL_FLAGS_NONE,
OSTREE_REPO_PULL_FLAGS_MIRROR
} OstreeRepoPullFlags;
gboolean ostree_repo_pull (OstreeRepo *self,