From b7763416f8a1e4940a10336d3a8b9fbbb879f414 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 12 Feb 2018 17:30:16 +0300 Subject: Clone and fetch git repositories --- bpkg/fetch.hxx | 64 ++++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 49 insertions(+), 15 deletions(-) (limited to 'bpkg/fetch.hxx') diff --git a/bpkg/fetch.hxx b/bpkg/fetch.hxx index 4e7b271..49e144c 100644 --- a/bpkg/fetch.hxx +++ b/bpkg/fetch.hxx @@ -5,6 +5,8 @@ #ifndef BPKG_FETCH_HXX #define BPKG_FETCH_HXX +#include + #include #include @@ -14,32 +16,64 @@ namespace bpkg { + // Repository type bpkg (fetch-bpkg.cxx). + // + repository_manifests - fetch_repositories (const dir_path&, bool ignore_unknown); + bpkg_fetch_repositories (const dir_path&, bool ignore_unknown); pair - fetch_repositories (const common_options&, - const repository_location&, - bool ignore_unknown); + bpkg_fetch_repositories (const common_options&, + const repository_location&, + bool ignore_unknown); package_manifests - fetch_packages (const dir_path&, bool ignore_unknown); + bpkg_fetch_packages (const dir_path&, bool ignore_unknown); pair - fetch_packages (const common_options&, - const repository_location&, - bool ignore_unknown); + bpkg_fetch_packages (const common_options&, + const repository_location&, + bool ignore_unknown); signature_manifest - fetch_signature (const common_options&, - const repository_location&, - bool ignore_unknown); + bpkg_fetch_signature (const common_options&, + const repository_location&, + bool ignore_unknown); path - fetch_archive (const common_options&, - const repository_location&, - const path& archive, - const dir_path& destdir); + bpkg_fetch_archive (const common_options&, + const repository_location&, + const path& archive, + const dir_path& destdir); + + // Repository type git (fetch-git.cxx). + // + + // Clone git repository into destdir//. + // + void + git_clone (const common_options&, + const repository_location&, + const dir_path& destdir); + + // Fetch git repository in destdir//. + // + void + git_fetch (const common_options&, + const repository_location&, + const dir_path& destdir); + + // Low-level fetch API (fetch.cxx). + // + + // Start the process of fetching the specified URL. If out is empty, then + // fetch to STDOUT. In this case also don't show any progress unless we are + // running verbose. + // + butl::process + start_fetch (const common_options& o, + const string& url, + const path& out = path ()); } #endif // BPKG_FETCH_HXX -- cgit v1.1