aboutsummaryrefslogtreecommitdiff
path: root/bpkg/rep-add.cli
blob: 3bfd537f40292f58e6e0365f5aec231ce9e7f5c6 (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
// file      : bpkg/rep-add.cli
// copyright : Copyright (c) 2014-2019 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

include <libbpkg/manifest.hxx>;

include <bpkg/configuration.cli>;

"\section=1"
"\name=bpkg-rep-add"
"\summary=add repository to configuration"

namespace bpkg
{
  {
    "<options> <rep-loc> <tag> <branch> <commit-id>",

    "\h|SYNOPSIS|

     \c{\b{bpkg rep-add}|\b{add} [<options>] <rep-loc>...}

     \h|DESCRIPTION|

     The \cb{rep-add} command adds the specified package repositories to the
     configuration. The repository location <rep-loc> is a URL or a directory
     path. If a repository with the same canonical name already exists in the
     configuration, then its location is replaced with the specified.

     Note that this command doesn't fetch the list of available packages for
     the newly added repository. For that, use the \l{bpkg-rep-fetch(1)}
     command, normally, after adding all the repositories you wish to use.

     Currently three types of repositories are supported: archive-based
     \cb{pkg}, directory-based \cb{dir}, and version control-based \cb{git}.
     See \l{bpkg-repository-types(1)} for details on their structure and URL
     format.

     Normally the repository type can be automatically guessed by examining
     its URL (for example, the presence of the \cb{.git} extension) or, in
     case of a local repository, its content (for example, the presence of the
     \cb{.git/} subdirectory). Without any identifying information the
     \cb{pkg} type is assumed unless explicitly specified with the \cb{--type}
     option or in the URL scheme. Note, however, that the \cb{dir} repository
     type is never guessed since it is not easily distinguishable from local
     \cb{pkg} and \cb{git} repositories.
     "
  }

  class rep_add_options: configuration_options
  {
    "\h|REP-ADD OPTIONS|"

    repository_type --type
    {
      "<type>",
      "Specify the repository type with valid values being \cb{pkg}, \cb{dir},
       and \cb{git}."
    }
  };
}