summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Leeds <matthew.leeds@endlessm.com>2018-03-07 19:16:10 -0800
committerAtomic Bot <atomic-devel@projectatomic.io>2018-03-15 09:50:39 +0000
commitcd4aeab2618847f5af1903654b507f4b61eb5c28 (patch)
treec92b30498ecd0707313c20719338f7af5a17c1ed
parent817f020db3930a04751145c068ddbdf626092971 (diff)
downloadflatpak-cd4aeab2618847f5af1903654b507f4b61eb5c28.tar.gz
dir: Rename repo_pull functions for clarity
repo_pull_one_dir() and repo_pull_one_local_untrusted() used to only support pulling one directory at a time, but now support more than one, so rename them so the names are less misleading. Closes: #1475 Approved by: alexlarsson
-rw-r--r--common/flatpak-dir.c82
1 files changed, 40 insertions, 42 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index ca8b6ea2..8c228e7e 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -2396,20 +2396,18 @@ get_common_pull_options (GVariantBuilder *builder,
g_variant_new_variant (g_variant_new_uint32 (update_freq)));
}
-/* This is a copy of ostree_repo_pull_one_dir that always disables
- static deltas if subdir is used */
static gboolean
-repo_pull_one_dir (OstreeRepo *self,
- const char *remote_name,
- const char **dirs_to_pull,
- const char *ref_to_fetch,
- const char *rev_to_fetch,
- const OstreeRepoFinderResult * const *results_to_fetch,
- FlatpakPullFlags flatpak_flags,
- OstreeRepoPullFlags flags,
- OstreeAsyncProgress *progress,
- GCancellable *cancellable,
- GError **error)
+repo_pull (OstreeRepo *self,
+ const char *remote_name,
+ const char **dirs_to_pull,
+ const char *ref_to_fetch,
+ const char *rev_to_fetch,
+ const OstreeRepoFinderResult * const *results_to_fetch,
+ FlatpakPullFlags flatpak_flags,
+ OstreeRepoPullFlags flags,
+ OstreeAsyncProgress *progress,
+ GCancellable *cancellable,
+ GError **error)
{
gboolean force_disable_deltas = (flatpak_flags & FLATPAK_PULL_FLAGS_NO_STATIC_DELTAS) != 0;
g_autofree char *remote_and_branch = NULL;
@@ -2636,16 +2634,16 @@ flatpak_dir_setup_extra_data (FlatpakDir *self,
/* Pull the commits (and only the commits) to check for extra data
* again. Here we don't pass the progress because we don't want any
* reports coming out of it. */
- if (!repo_pull_one_dir (repo, repository,
- NULL,
- ref,
- rev,
- results,
- flatpak_flags,
- OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY,
- NULL,
- cancellable,
- error))
+ if (!repo_pull (repo, repository,
+ NULL,
+ ref,
+ rev,
+ results,
+ flatpak_flags,
+ OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY,
+ NULL,
+ cancellable,
+ error))
return FALSE;
extra_data_sources = flatpak_repo_get_extra_data_sources (repo, rev, cancellable, NULL);
@@ -3441,11 +3439,11 @@ flatpak_dir_pull (FlatpakDir *self,
error))
goto out;
- if (!repo_pull_one_dir (repo, repository,
- subdirs_arg ? (const char **)subdirs_arg->pdata : NULL,
- ref, rev, results, flatpak_flags, flags,
- progress,
- cancellable, error))
+ if (!repo_pull (repo, repository,
+ subdirs_arg ? (const char **)subdirs_arg->pdata : NULL,
+ ref, rev, results, flatpak_flags, flags,
+ progress,
+ cancellable, error))
{
g_prefix_error (error, _("While pulling %s from remote %s: "), ref, repository);
goto out;
@@ -3477,16 +3475,16 @@ out:
}
static gboolean
-repo_pull_one_local_untrusted (FlatpakDir *self,
- OstreeRepo *repo,
- const char *remote_name,
- const char *url,
- const char **dirs_to_pull,
- const char *ref,
- const char *checksum,
- OstreeAsyncProgress *progress,
- GCancellable *cancellable,
- GError **error)
+repo_pull_local_untrusted (FlatpakDir *self,
+ OstreeRepo *repo,
+ const char *remote_name,
+ const char *url,
+ const char **dirs_to_pull,
+ const char *ref,
+ const char *checksum,
+ OstreeAsyncProgress *progress,
+ GCancellable *cancellable,
+ GError **error)
{
/* The latter flag was introduced in https://github.com/ostreedev/ostree/pull/926 */
const OstreeRepoPullFlags flags = OSTREE_REPO_PULL_FLAGS_UNTRUSTED |OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES;
@@ -3773,10 +3771,10 @@ flatpak_dir_pull_untrusted_local (FlatpakDir *self,
/* Past this we must use goto out, so we abort the transaction on error */
- if (!repo_pull_one_local_untrusted (self, self->repo, remote_name, url,
- subdirs_arg ? (const char **)subdirs_arg->pdata : NULL,
- ref, checksum, progress,
- cancellable, error))
+ if (!repo_pull_local_untrusted (self, self->repo, remote_name, url,
+ subdirs_arg ? (const char **)subdirs_arg->pdata : NULL,
+ ref, checksum, progress,
+ cancellable, error))
{
g_prefix_error (error, _("While pulling %s from remote %s: "), ref, remote_name);
goto out;