aboutsummaryrefslogtreecommitdiff
path: root/bpkg/fetch.hxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-02-12 17:30:16 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-02-12 17:34:55 +0300
commitb7763416f8a1e4940a10336d3a8b9fbbb879f414 (patch)
tree31f1bc7427181aa81984a639d998ca4e99058199 /bpkg/fetch.hxx
parentecb1efeebaa5597bee4cfdaab7bff4007b73127d (diff)
Clone and fetch git repositories
Diffstat (limited to 'bpkg/fetch.hxx')
-rw-r--r--bpkg/fetch.hxx64
1 files changed, 49 insertions, 15 deletions
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 <libbutl/process.mxx>
+
#include <libbpkg/manifest.hxx>
#include <bpkg/types.hxx>
@@ -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<repository_manifests, string /* checksum */>
- 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<package_manifests, string /* checksum */>
- 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/<fragment>/.
+ //
+ void
+ git_clone (const common_options&,
+ const repository_location&,
+ const dir_path& destdir);
+
+ // Fetch git repository in destdir/<fragment>/.
+ //
+ 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