1opam-source(1)                    Opam Manual                   opam-source(1)
2
3
4

NAME

6       opam-source - Get the source of an opam package.
7

SYNOPSIS

9       opam source [OPTION]... PACKAGE
10

DESCRIPTION

12       Downloads the source for a given package to a local directory for
13       development, bug fixing or documentation purposes.
14

ARGUMENTS

16       PACKAGE (required)
17           A package name with an optional version constraint
18

OPTIONS

20       --dev-repo
21           Get the latest version-controlled source rather than the release
22           archive
23
24       --dir=DIR
25           The directory where to put the source.
26
27       --pin
28           Pin the package to the downloaded source (see `opam pin').
29

COMMON OPTIONS

31       These options are common to all commands.
32
33       --best-effort
34           Don't fail if all requested packages can't be installed: try to
35           install as many as possible. Note that not all external solvers may
36           support this option (recent versions of aspcud or mccs should).
37
38       --color=WHEN
39           Colorize the output. WHEN must be one of `always', `never' or
40           `auto'.
41
42       --criteria=CRITERIA
43           Specify user preferences for dependency solving for this run.
44           Overrides both $OPAMCRITERIA and $OPAMUPGRADECRITERIA. For details
45           on the supported language, and the external solvers available, see
46           http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html. A
47           general guide to using solver preferences can be found at
48           http://www.dicosmo.org/Articles/usercriteria.pdf.
49
50       --cudf=FILENAME
51           Debug option: Save the CUDF requests sent to the solver to
52           FILENAME-<n>.cudf.
53
54       --debug
55           Print debug message to stderr. This is equivalent to setting
56           $OPAMDEBUG to "true".
57
58       --debug-level=LEVEL
59           Like --debug, but allows specifying the debug level (--debug sets
60           it to 1). Equivalent to setting $OPAMDEBUG to a positive integer.
61
62       --git-version
63           Print the git version of opam, if set (i.e. you are using a
64           development version), and exit.
65
66       --help[=FMT] (default=auto)
67           Show this help in format FMT. The value FMT must be one of `auto',
68           `pager', `groff' or `plain'. With `auto', the format is `pager` or
69           `plain' whenever the TERM env var is `dumb' or undefined.
70
71       --ignore-pin-depends
72           Ignore extra pins required by packages that get pinned, either
73           manually through opam pin or through opam install DIR. This is
74           equivalent to setting IGNOREPINDEPENDS=true.
75
76       --json=FILENAME
77           Save the results of the opam run in a computer-readable file. If
78           the filename contains the character `%', it will be replaced by an
79           index that doesn't overwrite an existing file. Similar to setting
80           the $OPAMJSON variable.
81
82       --no-auto-upgrade
83           When configuring or updating a repository that is written for an
84           earlier opam version (1.2), opam internally converts it to the
85           current format. This disables this behaviour. Note that
86           repositories should define their format version in a 'repo' file at
87           their root, or they will be assumed to be in the older format. It
88           is, in any case, preferable to upgrade the repositories manually
89           using opam admin upgrade [--mirror URL] when possible.
90
91       --no-self-upgrade
92           Opam will replace itself with a newer binary found at OPAMROOT/opam
93           if present. This disables this behaviour.
94
95       -q, --quiet
96           Disables --verbose.
97
98       --root=ROOT
99           Use ROOT as the current root path. This is equivalent to setting
100           $OPAMROOT to ROOT.
101
102       --safe, --readonly
103           Make sure nothing will be automatically updated or rewritten.
104           Useful for calling from completion scripts, for example. Will fail
105           whenever such an operation is needed ; also avoids waiting for
106           locks, skips interactive questions and overrides the $OPAMDEBUG
107           variable.
108
109       --solver=CMD
110           Specify the CUDF solver to use for resolving package installation
111           problems. This is either a predefined solver (this version of opam
112           supports builtin-mccs+lp(), builtin-mccs+glpk, aspcud, mccs,
113           aspcud-old, packup), or a custom command that should contain the
114           variables %{input}%, %{output}%, %{criteria}%, and optionally
115           %{timeout}%.
116
117       --strict
118           Fail whenever an error is found in a package definition or a
119           configuration file. The default is to continue silently if
120           possible.
121
122       --switch=SWITCH
123           Use SWITCH as the current compiler switch. This is equivalent to
124           setting $OPAMSWITCH to SWITCH.
125
126       --use-internal-solver, --no-aspcud
127           Disable any external solver, and use the built-in one (this
128           requires that opam has been compiled with a built-in solver).
129
130       -v, --verbose
131           Be more verbose. One -v shows all package commands, repeat to also
132           display commands called internally (e.g. tar, curl, patch etc.)
133           Repeating n times is equivalent to setting $OPAMVERBOSE to "n".
134
135       --version
136           Show version information.
137
138       -w, --working-dir
139           Whenever updating packages that are bound to a local,
140           version-controlled directory, update to the current working state
141           of their source instead of the last committed state, or the ref
142           they are pointing to. This only affects packages explicitly listed
143           on the command-line.
144
145       -y, --yes
146           Answer yes to all yes/no questions without prompting. This is
147           equivalent to setting $OPAMYES to "true".
148

ENVIRONMENT VARIABLES

150       Opam makes use of the environment variables listed here. Boolean
151       variables should be set to "0", "no", "false" or the empty string to
152       disable, "1", "yes" or "true" to enable.
153
154       OPAMCOLOR, when set to always or never, sets a default value for the
155       --color option.
156
157       OPAMCRITERIA specifies user preferences for dependency solving. The
158       default value depends on the solver version, use `config report` to
159       know the current setting. See also option --criteria
160
161       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
162       for more options.
163
164       OPAMDEBUG see options `--debug' and `--debug-level'.
165
166       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
167
168       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
169       fails. 0 to print all.
170
171       OPAMEXTERNALSOLVER see option `--solver'.
172
173       OPAMFETCH specifies how to download files: either `wget', `curl' or a
174       custom command where variables %{url}%, %{out}%, %{retry}%,
175       %{compress}% and %{checksum}% will be replaced. Overrides the
176       'download-command' value from the main config file.
177
178       OPAMJOBS sets the maximum number of parallel workers to run.
179
180       OPAMJSON log json output to the given file (use character `%' to index
181       the files)
182
183       OPAMLOCK see option `--lock'.
184
185       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
186       in an earlier format to the current one, on 'update' or 'init'.
187
188       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
189       some backups. This skips some finalisers and may also help to get more
190       reliable backtraces
191
192       OPAMLOCKRETRIES sets the number of tries after which OPAM gives up
193       acquiring its lock and fails. <= 0 means infinite wait.
194
195       OPAMNO answer no to any question asked.
196
197       OPAMNOASPCUD see option `--no-aspcud'.
198
199       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
200
201       OPAMPINKINDAUTO sets whether version control systems should be detected
202       when pinning to a local path. Enabled by default since 1.3.0.
203
204       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
205       available (e.g. for `opam install`).
206
207       OPAMRETRY sets the number of tries before failing downloads.
208
209       OPAMROOT see option `--root'. This is automatically set by `opam env
210       --root=DIR --set-root'.
211
212       OPAMROOTISOK don't complain when running as root.
213
214       OPAMSAFE see option `--safe'
215
216       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
217       compatibility testing only.
218
219       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
220       60.0, set to 0 for unlimited. Note that all solvers may not support
221       this option.
222
223       OPAMSTATUSLINE display a dynamic status line showing what's currently
224       going on on the terminal. (one of one of `always', `never' or `auto')
225
226       OPAMSWITCH see option `--switch'. Automatically set by `opam env
227       --switch=SWITCH --set-switch'.
228
229       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
230       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
231       are set. See also option --criteria
232
233       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
234
235       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
236       or `auto'). By default `auto', which is determined from the locale).
237
238       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
239       Implies OPAMUTF8. This is set by default on OSX only.
240
241       OPAMVAR_var overrides the contents of the variable var when
242       substituting `%{var}%` strings in `opam` files.
243
244       OPAMVAR_package_var overrides the contents of the variable package:var
245       when substituting `%{package:var}%` strings in `opam` files.
246
247       OPAMVERBOSE see option `--verbose'.
248
249       OPAMYES see option `--yes'.
250

EXIT STATUS

252       As an exception to the following, the `exec' command returns 127 if the
253       command was not found or couldn't be executed, and the command's exit
254       value otherwise.
255
256       0   Success, or true for boolean queries.
257
258       1   False. Returned when a boolean return value is expected, e.g. when
259           running with --check, or for queries like opam lint.
260
261       2   Bad command-line arguments, or command-line arguments pointing to
262           an invalid context (e.g. file not following the expected format).
263
264       5   Not found. You requested something (package, version, repository,
265           etc.) that couldn't be found.
266
267       10  Aborted. The operation required confirmation, which wasn't given.
268
269       15  Could not acquire the locks required for the operation.
270
271       20  There is no solution to the user request. This can be caused by
272           asking to install two incompatible packages, for example.
273
274       30  Error in package definition, or other metadata files. Using
275           --strict raises this error more often.
276
277       31  Package script error. Some package operations were unsuccessful.
278           This may be an error in the packages or an incompatibility with
279           your system. This can be a partial error.
280
281       40  Sync error. Could not fetch some remotes from the network. This can
282           be a partial error.
283
284       50  Configuration error. Opam or system configuration doesn't allow
285           operation, and needs fixing.
286
287       60  Solver failure. The solver failed to return a sound answer. It can
288           be due to a broken external solver, or an error in solver
289           configuration.
290
291       99  Internal error. Something went wrong, likely due to a bug in opam
292           itself.
293
294       130 User interrupt. SIGINT was received, generally due to the user
295           pressing Ctrl-C.
296

FURTHER DOCUMENTATION

298       See https://opam.ocaml.org/doc.
299

AUTHORS

301       Vincent Bernardoff <vb@luminar.eu.org>
302       Raja Boujbel <raja.boujbel@ocamlpro.com>
303       Roberto Di Cosmo <roberto@dicosmo.org>
304       Thomas Gazagnaire <thomas@gazagnaire.org>
305       Louis Gesbert <louis.gesbert@ocamlpro.com>
306       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
307       Anil Madhavapeddy <anil@recoil.org>
308       Guillem Rieu <guillem.rieu@ocamlpro.com>
309       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
310       Frederic Tuong <tuong@users.gforge.inria.fr>
311

BUGS

313       Check bug reports at https://github.com/ocaml/opam/issues.
314
315
316
317Opam 2.0.1                                                      opam-source(1)
Impressum