aboutsummaryrefslogtreecommitdiff
path: root/bpkg/fetch.hxx
blob: 49e144c29436410b6e1cfb0773e85d32daa3d446 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// file      : bpkg/fetch.hxx -*- C++ -*-
// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#ifndef BPKG_FETCH_HXX
#define BPKG_FETCH_HXX

#include <libbutl/process.mxx>

#include <libbpkg/manifest.hxx>

#include <bpkg/types.hxx>
#include <bpkg/utility.hxx>

#include <bpkg/common-options.hxx>

namespace bpkg
{
  // Repository type bpkg (fetch-bpkg.cxx).
  //

  repository_manifests
  bpkg_fetch_repositories (const dir_path&, bool ignore_unknown);

  pair<repository_manifests, string /* checksum */>
  bpkg_fetch_repositories (const common_options&,
                           const repository_location&,
                           bool ignore_unknown);

  package_manifests
  bpkg_fetch_packages (const dir_path&, bool ignore_unknown);

  pair<package_manifests, string /* checksum */>
  bpkg_fetch_packages (const common_options&,
                       const repository_location&,
                       bool ignore_unknown);

  signature_manifest
  bpkg_fetch_signature (const common_options&,
                        const repository_location&,
                        bool ignore_unknown);

  path
  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