pull: Move pull and pull_onedir back into ostree-repo.c
They call pull_with_options, which will fail anyway. Closes: #327 Approved by: cgwalters
This commit is contained in:
parent
da5cb099a6
commit
693b4ec4be
|
|
@ -1738,49 +1738,6 @@ validate_variant_is_csum (GVariant *csum,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* documented in ostree-repo.c */
|
|
||||||
gboolean
|
|
||||||
ostree_repo_pull (OstreeRepo *self,
|
|
||||||
const char *remote_name,
|
|
||||||
char **refs_to_fetch,
|
|
||||||
OstreeRepoPullFlags flags,
|
|
||||||
OstreeAsyncProgress *progress,
|
|
||||||
GCancellable *cancellable,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
return ostree_repo_pull_one_dir (self, remote_name, NULL, refs_to_fetch, flags, progress, cancellable, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Documented in ostree-repo.c */
|
|
||||||
gboolean
|
|
||||||
ostree_repo_pull_one_dir (OstreeRepo *self,
|
|
||||||
const char *remote_name,
|
|
||||||
const char *dir_to_pull,
|
|
||||||
char **refs_to_fetch,
|
|
||||||
OstreeRepoPullFlags flags,
|
|
||||||
OstreeAsyncProgress *progress,
|
|
||||||
GCancellable *cancellable,
|
|
||||||
GError **error)
|
|
||||||
{
|
|
||||||
GVariantBuilder builder;
|
|
||||||
g_autoptr(GVariant) options = NULL;
|
|
||||||
|
|
||||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
|
||||||
|
|
||||||
if (dir_to_pull)
|
|
||||||
g_variant_builder_add (&builder, "{s@v}", "subdir",
|
|
||||||
g_variant_new_variant (g_variant_new_string (dir_to_pull)));
|
|
||||||
g_variant_builder_add (&builder, "{s@v}", "flags",
|
|
||||||
g_variant_new_variant (g_variant_new_int32 (flags)));
|
|
||||||
if (refs_to_fetch)
|
|
||||||
g_variant_builder_add (&builder, "{s@v}", "refs",
|
|
||||||
g_variant_new_variant (g_variant_new_strv ((const char *const*) refs_to_fetch, -1)));
|
|
||||||
|
|
||||||
options = g_variant_ref_sink (g_variant_builder_end (&builder));
|
|
||||||
return ostree_repo_pull_with_options (self, remote_name, options,
|
|
||||||
progress, cancellable, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Load the summary from the cache if the provided .sig file is the same as the
|
/* Load the summary from the cache if the provided .sig file is the same as the
|
||||||
cached version. */
|
cached version. */
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
||||||
|
|
@ -3697,7 +3697,6 @@ ostree_repo_read_commit (OstreeRepo *self,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_LIBSOUP
|
|
||||||
/**
|
/**
|
||||||
* ostree_repo_pull:
|
* ostree_repo_pull:
|
||||||
* @self: Repo
|
* @self: Repo
|
||||||
|
|
@ -3734,9 +3733,7 @@ ostree_repo_pull (OstreeRepo *self,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
return ostree_repo_pull_one_dir (self, remote_name, NULL, refs_to_fetch, flags, progress, cancellable, error);
|
||||||
"This version of ostree was built without libsoup, and cannot fetch over HTTP");
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3763,12 +3760,24 @@ ostree_repo_pull_one_dir (OstreeRepo *self,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
|
GVariantBuilder builder;
|
||||||
"This version of ostree was built without libsoup, and cannot fetch over HTTP");
|
g_autoptr(GVariant) options = NULL;
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
|
||||||
|
|
||||||
|
if (dir_to_pull)
|
||||||
|
g_variant_builder_add (&builder, "{s@v}", "subdir",
|
||||||
|
g_variant_new_variant (g_variant_new_string (dir_to_pull)));
|
||||||
|
g_variant_builder_add (&builder, "{s@v}", "flags",
|
||||||
|
g_variant_new_variant (g_variant_new_int32 (flags)));
|
||||||
|
if (refs_to_fetch)
|
||||||
|
g_variant_builder_add (&builder, "{s@v}", "refs",
|
||||||
|
g_variant_new_variant (g_variant_new_strv ((const char *const*) refs_to_fetch, -1)));
|
||||||
|
|
||||||
|
options = g_variant_ref_sink (g_variant_builder_end (&builder));
|
||||||
|
return ostree_repo_pull_with_options (self, remote_name, options,
|
||||||
|
progress, cancellable, error);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* _formatted_time_remaining_from_seconds
|
* _formatted_time_remaining_from_seconds
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue