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

ENVIRONMENT VARIABLES

155       Opam makes use of the environment variables listed here. Boolean
156       variables should be set to "0", "no", "false" or the empty string to
157       disable, "1", "yes" or "true" to enable.
158
159       OPAMALLPARENS surround all filters with parenthesis
160
161       OPAMAUTOREMOVE see remove option `--auto-remove`
162
163       OPAMBESTEFFORT see option `--best-effort`
164
165       OPAMBESTEFFORTPREFIXCRITERIA sets the string that must be prepended to
166       the criteria when the `--best-effort` option is set, and is expected to
167       maximise the `opam-query` property in the solution
168
169       OPAMCOLOR, when set to always or never, sets a default value for the
170       --color option.
171
172       OPAMCRITERIA specifies user preferences for dependency solving. The
173       default value depends on the solver version, use `config report` to
174       know the current setting. See also option --criteria
175
176       OPAMCUDFFILE file save the cudf graph to file-actions-explicit.dot
177
178       OPAMCURL can be used to select a given 'curl' program. See OPAMFETCH
179       for more options.
180
181       OPAMDEBUG see options `--debug' and `--debug-level'.
182
183       OPAMDOWNLOADJOBS sets the maximum number of simultaneous downloads.
184
185       OPAMDRYRUN see option `--dry-run`
186
187       OPAMEDITOR sets the editor to use for opam file editing, overrides
188       $EDITOR and $VISUAL
189
190       OPAMERRLOGLEN sets the number of log lines printed when a sub-process
191       fails. 0 to print all.
192
193       OPAMEXTERNALSOLVER see option `--solver'.
194
195       OPAMFAKE see option `--fake`
196
197       OPAMFETCH specifies how to download files: either `wget', `curl' or a
198       custom command where variables %{url}%, %{out}%, %{retry}%,
199       %{compress}% and %{checksum}% will be replaced. Overrides the
200       'download-command' value from the main config file.
201
202       OPAMFIXUPCRITERIA same as OPAMUPGRADECRITERIA, but specific to fixup
203
204       OPAMIGNORECONSTRAINTS see install option `--ignore-constraints-on`
205
206       OPAMIGNOREPINDEPENDS see option `--ignore-pin-depends`
207
208       OPAMJOBS sets the maximum number of parallel workers to run.
209
210       OPAMJSON log json output to the given file (use character `%' to index
211       the files)
212
213       OPAMLOCKED see install option `--locked`
214
215       OPAMLOGS logdir sets log directory, default is a temporary directory in
216       /tmp
217
218       OPAMMAKECMD set the system make command to use
219
220       OPAMNOAUTOUPGRADE disables automatic internal upgrade of repositories
221       in an earlier format to the current one, on 'update' or 'init'.
222
223       OPAMKEEPLOGS tells opam to not remove some temporary command logs and
224       some backups. This skips some finalisers and may also help to get more
225       reliable backtraces
226
227       OPAMLOCKRETRIES sets the number of tries after which opam gives up
228       acquiring its lock and fails. <= 0 means infinite wait.
229
230       OPAMMERGEOUT merge process outputs, stderr on stdout
231
232       OPAMNO answer no to any question asked.
233
234       OPAMNOASPCUD Deprecated.
235
236       OPAMNOCHECKSUMS enables option --no-checksums when available.
237
238       OPAMNOSELFUPGRADE see option `--no-self-upgrade'.
239
240       OPAMPINKINDAUTO sets whether version control systems should be detected
241       when pinning to a local path. Enabled by default since 1.3.0.
242
243       OPAMPRECISETRACKING fine grain tracking of directories
244
245       OPAMREQUIRECHECKSUMS Enables option `--require-checksums' when
246       available (e.g. for `opam install`).
247
248       OPAMRETRES sets the number of tries before failing downloads.
249
250       OPAMROOT see option `--root'. This is automatically set by `opam env
251       --root=DIR --set-root'.
252
253       OPAMROOTISOK don't complain when running as root.
254
255       OPAMSAFE see option `--safe'
256
257       OPAMSHOW see option `--show`
258
259       OPAMSKIPUPDATE see option `--skip-updates`
260
261       OPAMSKIPVERSIONCHECKS bypasses some version checks. Unsafe, for
262       compatibility testing only.
263
264       OPAMSOLVERTIMEOUT change the time allowance of the solver. Default is
265       60.0, set to 0 for unlimited. Note that all solvers may not support
266       this option.
267
268       OPAMSTATUSLINE display a dynamic status line showing what's currently
269       going on on the terminal. (one of one of `always', `never' or `auto')
270
271       OPAMSTATS display stats at the end of command
272
273       OPAMSTRICT fail on inconsistencies (file reading, switch import, etc.)
274
275       OPAMSWITCH see option `--switch'. Automatically set by `opam env
276       --switch=SWITCH --set-switch'.
277
278       OPAMUNLOCKBASE see install option `--unlock-base`
279
280       OPAMUPGRADECRITERIA specifies user preferences for dependency solving
281       when performing an upgrade. Overrides OPAMCRITERIA in upgrades if both
282       are set. See also option --criteria
283
284       OPAMUSEINTERNALSOLVER see option `--use-internal-solver'.
285
286       OPAMUSEOPENSSL force openssl use for hash computing
287
288       OPAMUTF8 use UTF8 characters in output (one of one of `always', `never'
289       or `auto'). By default `auto', which is determined from the locale).
290
291       OPAMUTF8MSGS use extended UTF8 characters (camels) in opam messages.
292       Implies OPAMUTF8. This is set by default on OSX only.
293
294       OPAMVALIDATIONHOOK hook if set, uses the `%{hook%}` command to validate
295       an opam repository update
296
297       OPAMVAR_var overrides the contents of the variable var when
298       substituting `%{var}%` strings in `opam` files.
299
300       OPAMVAR_package_var overrides the contents of the variable package:var
301       when substituting `%{package:var}%` strings in `opam` files.
302
303       OPAMVERBOSE see option `--verbose'.
304
305       OPAMWORKINGDIR see option `--working-dir`
306
307       OPAMYES see option `--yes'.
308

EXIT STATUS

310       As an exception to the following, the `exec' command returns 127 if the
311       command was not found or couldn't be executed, and the command's exit
312       value otherwise.
313
314       0   Success, or true for boolean queries.
315
316       1   False. Returned when a boolean return value is expected, e.g. when
317           running with --check, or for queries like opam lint.
318
319       2   Bad command-line arguments, or command-line arguments pointing to
320           an invalid context (e.g. file not following the expected format).
321
322       5   Not found. You requested something (package, version, repository,
323           etc.) that couldn't be found.
324
325       10  Aborted. The operation required confirmation, which wasn't given.
326
327       15  Could not acquire the locks required for the operation.
328
329       20  There is no solution to the user request. This can be caused by
330           asking to install two incompatible packages, for example.
331
332       30  Error in package definition, or other metadata files. Using
333           --strict raises this error more often.
334
335       31  Package script error. Some package operations were unsuccessful.
336           This may be an error in the packages or an incompatibility with
337           your system. This can be a partial error.
338
339       40  Sync error. Could not fetch some remotes from the network. This can
340           be a partial error.
341
342       50  Configuration error. Opam or system configuration doesn't allow
343           operation, and needs fixing.
344
345       60  Solver failure. The solver failed to return a sound answer. It can
346           be due to a broken external solver, or an error in solver
347           configuration.
348
349       99  Internal error. Something went wrong, likely due to a bug in opam
350           itself.
351
352       130 User interrupt. SIGINT was received, generally due to the user
353           pressing Ctrl-C.
354

FURTHER DOCUMENTATION

356       See https://opam.ocaml.org/doc.
357

AUTHORS

359       Vincent Bernardoff <vb@luminar.eu.org>
360       Raja Boujbel <raja.boujbel@ocamlpro.com>
361       Roberto Di Cosmo <roberto@dicosmo.org>
362       Thomas Gazagnaire <thomas@gazagnaire.org>
363       Louis Gesbert <louis.gesbert@ocamlpro.com>
364       Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
365       Anil Madhavapeddy <anil@recoil.org>
366       Guillem Rieu <guillem.rieu@ocamlpro.com>
367       Ralf Treinen <ralf.treinen@pps.jussieu.fr>
368       Frederic Tuong <tuong@users.gforge.inria.fr>
369

BUGS

371       Check bug reports at https://github.com/ocaml/opam/issues.
372
373
374
375Opam 2.0.4                                                      OPAM-SOURCE(1)
Impressum