man-pages/man1/opam-source.1.html
2021-03-31 01:06:50 +01:00

400 lines
18 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of OPAM-SOURCE</TITLE>
</HEAD><BODY>
<H1>OPAM-SOURCE</H1>
Section: Opam Manual (1)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
<P>
opam&#45;source &#45; Get the source of an opam package&#46;
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
<B>opam source</B> [<I>OPTION</I>]&#46;&#46;&#46; <I>PACKAGE</I>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
Downloads the source for a given package to a local directory for development, bug fixing or documentation purposes&#46;
<A NAME="lbAE">&nbsp;</A>
<H2>ARGUMENTS</H2>
<DL COMPACT>
<DT id="1"><I>PACKAGE</I> (required)<DD>
A package name with an optional version constraint
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="2"><B>&#45;&#45;dev&#45;repo</B><DD>
Get the latest version&#45;controlled source rather than the release archive
<DT id="3"><B>&#45;&#45;dir</B>=<I>DIR</I><DD>
The directory where to put the source&#46;
<DT id="4"><B>&#45;&#45;pin</B><DD>
Pin the package to the downloaded source (see `opam pin&#39;)&#46;
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>COMMON OPTIONS</H2>
<P>
These options are common to all commands&#46;
<DL COMPACT>
<DT id="5"><B>&#45;&#45;best&#45;effort</B><DD>
Don&#39;t fail if all requested packages can&#39;t be installed: try to install as many as possible&#46; Note that not all external solvers may support this option (recent versions of <I>aspcud</I> or <I>mccs</I> should)&#46; This is equivalent to setting <B>$OPAMBESTEFFORT</B> environment variable&#46;
<DT id="6"><B>&#45;&#45;color</B>=<I>WHEN</I><DD>
Colorize the output&#46; <I>WHEN</I> must be one of `always&#39;, `never&#39; or `auto&#39;&#46;
<DT id="7"><B>&#45;&#45;criteria</B>=<I>CRITERIA</I><DD>
Specify user <I>preferences</I> for dependency solving for this run&#46; Overrides both <B>$OPAMCRITERIA</B> and <B>$OPAMUPGRADECRITERIA</B>&#46; For details on the supported language, and the external solvers available, see <I> <A HREF="http://opam">http://opam</A>&#46;ocaml&#46;org/doc/External_solvers&#46;html</I>&#46; A general guide to using solver preferences can be found at <I> <A HREF="http://www">http://www</A>&#46;dicosmo&#46;org/Articles/usercriteria&#46;pdf</I>&#46;
<DT id="8"><B>&#45;&#45;cudf</B>=<I>FILENAME</I><DD>
Debug option: Save the CUDF requests sent to the solver to <I>FILENAME</I>&#45;&lt;n&gt;&#46;cudf&#46;
<DT id="9"><B>&#45;&#45;debug</B><DD>
Print debug message to stderr&#46; This is equivalent to setting <B>$OPAMDEBUG</B> to &quot;true&quot;&#46;
<DT id="10"><B>&#45;&#45;debug&#45;level</B>=<I>LEVEL</I><DD>
Like <B>&#45;&#45;debug</B>, but allows specifying the debug level (<B>&#45;&#45;debug</B> sets it to 1)&#46; Equivalent to setting <B>$OPAMDEBUG</B> to a positive integer&#46;
<DT id="11"><B>&#45;&#45;git&#45;version</B><DD>
Print the git version of opam, if set (i&#46;e&#46; you are using a development version), and exit&#46;
<DT id="12"><B>&#45;&#45;help</B>[=<I>FMT</I>] (default=auto)<DD>
Show this help in format <I>FMT</I>&#46; The value <I>FMT</I> must be one of `auto&#39;, `pager&#39;, `groff&#39; or `plain&#39;&#46; With `auto&#39;, the format is `pager` or `plain&#39; whenever the <B>TERM</B> env var is `dumb&#39; or undefined&#46;
<DT id="13"><B>&#45;&#45;ignore&#45;pin&#45;depends</B><DD>
Ignore extra pins required by packages that get pinned, either manually through <I>opam pin</I> or through <I>opam install DIR</I>&#46; This is equivalent to setting <B>IGNOREPINDEPENDS=true</B>&#46;
<DT id="14"><B>&#45;&#45;json</B>=<I>FILENAME</I><DD>
Save the results of the opam run in a computer&#45;readable file&#46; If the filename contains the character `%&#39;, it will be replaced by an index that doesn&#39;t overwrite an existing file&#46; Similar to setting the <B>$OPAMJSON</B> variable&#46;
<DT id="15"><B>&#45;&#45;no&#45;aspcud</B><DD>
Deprecated&#46;
<DT id="16"><B>&#45;&#45;no&#45;auto&#45;upgrade</B><DD>
When configuring or updating a repository that is written for an earlier opam version (1&#46;2), opam internally converts it to the current format&#46; This disables this behaviour&#46; Note that repositories should define their format version in a &#39;repo&#39; file at their root, or they will be assumed to be in the older format&#46; It is, in any case, preferable to upgrade the repositories manually using <I>opam admin upgrade [&#45;&#45;mirror URL]</I> when possible&#46;
<DT id="17"><B>&#45;&#45;no&#45;self&#45;upgrade</B><DD>
Opam will replace itself with a newer binary found at <B>OPAMROOT/opam</B> if present&#46; This disables this behaviour&#46;
<DT id="18"><B>&#45;q</B>, <B>&#45;&#45;quiet</B><DD>
Disables <B>&#45;&#45;verbose</B>&#46;
<DT id="19"><B>&#45;&#45;root</B>=<I>ROOT</I><DD>
Use <I>ROOT</I> as the current root path&#46; This is equivalent to setting <B>$OPAMROOT</B> to <I>ROOT</I>&#46;
<DT id="20"><B>&#45;&#45;safe</B>, <B>&#45;&#45;readonly</B><DD>
Make sure nothing will be automatically updated or rewritten&#46; Useful for calling from completion scripts, for example&#46; Will fail whenever such an operation is needed ; also avoids waiting for locks, skips interactive questions and overrides the <B>$OPAMDEBUG</B> variable&#46; This is equivalent to set environment variable <B>$OPAMSAFE</B>&#46;
<DT id="21"><B>&#45;&#45;solver</B>=<I>CMD</I><DD>
Specify the CUDF solver to use for resolving package installation problems&#46; This is either a predefined solver (this version of opam supports builtin&#45;mccs+lp(), builtin&#45;mccs+glpk, aspcud, mccs, aspcud&#45;old, packup), or a custom command that should contain the variables %{input}%, %{output}%, %{criteria}%, and optionally %{timeout}%&#46; This is equivalent to setting <B>$OPAMEXTERNALSOLVER</B>&#46;
<DT id="22"><B>&#45;&#45;strict</B><DD>
Fail whenever an error is found in a package definition or a configuration file&#46; The default is to continue silently if possible&#46;
<DT id="23"><B>&#45;&#45;switch</B>=<I>SWITCH</I><DD>
Use <I>SWITCH</I> as the current compiler switch&#46; This is equivalent to setting <B>$OPAMSWITCH</B> to <I>SWITCH</I>&#46;
<DT id="24"><B>&#45;&#45;use&#45;internal&#45;solver</B><DD>
Disable any external solver, and use the built&#45;in one (this requires that opam has been compiled with a built&#45;in solver)&#46; This is equivalent to setting <B>$OPAMNOASPCUD</B> or <B>$OPAMUSEINTERNALSOLVER</B>&#46;
<DT id="25"><B>&#45;v</B>, <B>&#45;&#45;verbose</B><DD>
Be more verbose&#46; One <B>&#45;v</B> shows all package commands, repeat to also display commands called internally (e&#46;g&#46; <I>tar</I>, <I>curl</I>, <I>patch</I> etc&#46;) Repeating <I>n</I> times is equivalent to setting <B>$OPAMVERBOSE</B> to &quot;<I>n</I>&quot;&#46;
<DT id="26"><B>&#45;&#45;version</B><DD>
Show version information&#46;
<DT id="27"><B>&#45;w</B>, <B>&#45;&#45;working&#45;dir</B><DD>
Whenever updating packages that are bound to a local, version&#45;controlled directory, update to the current working state of their source instead of the last committed state, or the ref they are pointing to&#46; This only affects packages explicitly listed on the command&#45;line&#46;It can also be set with <B>$OPAMWORKINGDIR</B>&#46;
<DT id="28"><B>&#45;y</B>, <B>&#45;&#45;yes</B><DD>
Answer yes to all yes/no questions without prompting&#46; This is equivalent to setting <B>$OPAMYES</B> to &quot;true&quot;&#46;
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>ENVIRONMENT VARIABLES</H2>
<P>
Opam makes use of the environment variables listed here&#46; Boolean variables should be set to &quot;0&quot;, &quot;no&quot;, &quot;false&quot; or the empty string to disable, &quot;1&quot;, &quot;yes&quot; or &quot;true&quot; to enable&#46;
<P>
<I>OPAMALLPARENS</I> surround all filters with parenthesis
<P>
<I>OPAMAUTOREMOVE</I> see remove option `&#45;&#45;auto&#45;remove`
<P>
<I>OPAMBESTEFFORT</I> see option `&#45;&#45;best&#45;effort`
<P>
<I>OPAMBESTEFFORTPREFIXCRITERIA</I> sets the string that must be prepended to the criteria when the `&#45;&#45;best&#45;effort` option is set, and is expected to maximise the `opam&#45;query` property in the solution
<P>
<I>OPAMCOLOR</I>, when set to <I>always</I> or <I>never</I>, sets a default value for the &#45;&#45;color option&#46;
<P>
<I>OPAMCRITERIA</I> specifies user <I>preferences</I> for dependency solving&#46; The default value depends on the solver version, use `config report` to know the current setting&#46; See also option &#45;&#45;criteria
<P>
<I>OPAMCUDFFILE file</I> save the cudf graph to <I>file</I>&#45;actions&#45;explicit&#46;dot
<P>
<I>OPAMCURL</I> can be used to select a given &#39;curl&#39; program&#46; See <I>OPAMFETCH</I> for more options&#46;
<P>
<I>OPAMDEBUG</I> see options `&#45;&#45;debug&#39; and `&#45;&#45;debug&#45;level&#39;&#46;
<P>
<I>OPAMDOWNLOADJOBS</I> sets the maximum number of simultaneous downloads&#46;
<P>
<I>OPAMDRYRUN</I> see option `&#45;&#45;dry&#45;run`
<P>
<I>OPAMEDITOR</I> sets the editor to use for opam file editing, overrides <I>$EDITOR</I> and <I>$VISUAL</I>
<P>
<I>OPAMERRLOGLEN</I> sets the number of log lines printed when a sub&#45;process fails&#46; 0 to print all&#46;
<P>
<I>OPAMEXTERNALSOLVER</I> see option `&#45;&#45;solver&#39;&#46;
<P>
<I>OPAMFAKE</I> see option `&#45;&#45;fake`
<P>
<I>OPAMFETCH</I> specifies how to download files: either `wget&#39;, `curl&#39; or a custom command where variables <B>%{url}%</B>, <B>%{out}%</B>, <B>%{retry}%</B>, <B>%{compress}%</B> and <B>%{checksum}%</B> will be replaced&#46; Overrides the &#39;download&#45;command&#39; value from the main config file&#46;
<P>
<I>OPAMFIXUPCRITERIA</I> same as <I>OPAMUPGRADECRITERIA</I>, but specific to fixup
<P>
<I>OPAMIGNORECONSTRAINTS</I> see install option `&#45;&#45;ignore&#45;constraints&#45;on`
<P>
<I>OPAMIGNOREPINDEPENDS</I> see option `&#45;&#45;ignore&#45;pin&#45;depends`
<P>
<I>OPAMJOBS</I> sets the maximum number of parallel workers to run&#46;
<P>
<I>OPAMJSON</I> log json output to the given file (use character `%&#39; to index the files)
<P>
<I>OPAMLOCKED</I> see install option `&#45;&#45;locked`
<P>
<I>OPAMLOGS logdir</I> sets log directory, default is a temporary directory in /tmp
<P>
<I>OPAMMAKECMD</I> set the system make command to use
<P>
<I>OPAMNOAUTOUPGRADE</I> disables automatic internal upgrade of repositories in an earlier format to the current one, on &#39;update&#39; or &#39;init&#39;&#46;
<P>
<I>OPAMKEEPLOGS</I> tells opam to not remove some temporary command logs and some backups&#46; This skips some finalisers and may also help to get more reliable backtraces
<P>
<I>OPAMLOCKRETRIES</I> sets the number of tries after which opam gives up acquiring its lock and fails&#46; &lt;= 0 means infinite wait&#46;
<P>
<I>OPAMMERGEOUT</I> merge process outputs, stderr on stdout
<P>
<I>OPAMNO</I> answer no to any question asked&#46;
<P>
<I>OPAMNOASPCUD</I> Deprecated&#46;
<P>
<I>OPAMNOCHECKSUMS</I> enables option &#45;&#45;no&#45;checksums when available&#46;
<P>
<I>OPAMNOSELFUPGRADE</I> see option `&#45;&#45;no&#45;self&#45;upgrade&#39;&#46;
<P>
<I>OPAMPINKINDAUTO</I> sets whether version control systems should be detected when pinning to a local path&#46; Enabled by default since 1&#46;3&#46;0&#46;
<P>
<I>OPAMPRECISETRACKING</I> fine grain tracking of directories
<P>
<I>OPAMREQUIRECHECKSUMS</I> Enables option `&#45;&#45;require&#45;checksums&#39; when available (e&#46;g&#46; for `opam install`)&#46;
<P>
<I>OPAMRETRES</I> sets the number of tries before failing downloads&#46;
<P>
<I>OPAMROOT</I> see option `&#45;&#45;root&#39;&#46; This is automatically set by `opam env &#45;&#45;root=DIR &#45;&#45;set&#45;root&#39;&#46;
<P>
<I>OPAMROOTISOK</I> don&#39;t complain when running as root&#46;
<P>
<I>OPAMSAFE</I> see option `&#45;&#45;safe&#39;
<P>
<I>OPAMSHOW</I> see option `&#45;&#45;show`
<P>
<I>OPAMSKIPUPDATE</I> see option `&#45;&#45;skip&#45;updates`
<P>
<I>OPAMSKIPVERSIONCHECKS</I> bypasses some version checks&#46; Unsafe, for compatibility testing only&#46;
<P>
<I>OPAMSOLVERTIMEOUT</I> change the time allowance of the solver&#46; Default is 60&#46;0, set to 0 for unlimited&#46; Note that all solvers may not support this option&#46;
<P>
<I>OPAMSTATUSLINE</I> display a dynamic status line showing what&#39;s currently going on on the terminal&#46; (one of one of `always&#39;, `never&#39; or `auto&#39;)
<P>
<I>OPAMSTATS</I> display stats at the end of command
<P>
<I>OPAMSTRICT</I> fail on inconsistencies (file reading, switch import, etc&#46;)
<P>
<I>OPAMSWITCH</I> see option `&#45;&#45;switch&#39;&#46; Automatically set by `opam env &#45;&#45;switch=SWITCH &#45;&#45;set&#45;switch&#39;&#46;
<P>
<I>OPAMUNLOCKBASE</I> see install option `&#45;&#45;unlock&#45;base`
<P>
<I>OPAMUPGRADECRITERIA</I> specifies user <I>preferences</I> for dependency solving when performing an upgrade&#46; Overrides <I>OPAMCRITERIA</I> in upgrades if both are set&#46; See also option &#45;&#45;criteria
<P>
<I>OPAMUSEINTERNALSOLVER</I> see option `&#45;&#45;use&#45;internal&#45;solver&#39;&#46;
<P>
<I>OPAMUSEOPENSSL</I> force openssl use for hash computing
<P>
<I>OPAMUTF8</I> use UTF8 characters in output (one of one of `always&#39;, `never&#39; or `auto&#39;)&#46; By default `auto&#39;, which is determined from the locale)&#46;
<P>
<I>OPAMUTF8MSGS</I> use extended UTF8 characters (camels) in opam messages&#46; Implies <I>OPAMUTF8</I>&#46; This is set by default on OSX only&#46;
<P>
<I>OPAMVALIDATIONHOOK hook</I> if set, uses the `%{hook%}` command to validate an opam repository update
<P>
<I>OPAMVAR_var</I> overrides the contents of the variable <I>var</I> when substituting `%{var}%` strings in `opam` files&#46;
<P>
<I>OPAMVAR_package_var</I> overrides the contents of the variable <I>package:var</I> when substituting `%{package:var}%` strings in `opam` files&#46;
<P>
<I>OPAMVERBOSE</I> see option `&#45;&#45;verbose&#39;&#46;
<P>
<I>OPAMWORKINGDIR</I> see option `&#45;&#45;working&#45;dir`
<P>
<I>OPAMYES</I> see option `&#45;&#45;yes&#39;&#46;
<A NAME="lbAI">&nbsp;</A>
<H2>EXIT STATUS</H2>
<P>
As an exception to the following, the `exec&#39; command returns 127 if the command was not found or couldn&#39;t be executed, and the command&#39;s exit value otherwise&#46;
<DL COMPACT>
<DT id="29">0<DD>
Success, or true for boolean queries&#46;
<DT id="30">1<DD>
False&#46; Returned when a boolean return value is expected, e&#46;g&#46; when running with <B>&#45;&#45;check</B>, or for queries like <B>opam lint</B>&#46;
<DT id="31">2<DD>
Bad command&#45;line arguments, or command&#45;line arguments pointing to an invalid context (e&#46;g&#46; file not following the expected format)&#46;
<DT id="32">5<DD>
Not found&#46; You requested something (package, version, repository, etc&#46;) that couldn&#39;t be found&#46;
<DT id="33">10<DD>
Aborted&#46; The operation required confirmation, which wasn&#39;t given&#46;
<DT id="34">15<DD>
Could not acquire the locks required for the operation&#46;
<DT id="35">20<DD>
There is no solution to the user request&#46; This can be caused by asking to install two incompatible packages, for example&#46;
<DT id="36">30<DD>
Error in package definition, or other metadata files&#46; Using <B>&#45;&#45;strict</B> raises this error more often&#46;
<DT id="37">31<DD>
Package script error&#46; Some package operations were unsuccessful&#46; This may be an error in the packages or an incompatibility with your system&#46; This can be a partial error&#46;
<DT id="38">40<DD>
Sync error&#46; Could not fetch some remotes from the network&#46; This can be a partial error&#46;
<DT id="39">50<DD>
Configuration error&#46; Opam or system configuration doesn&#39;t allow operation, and needs fixing&#46;
<DT id="40">60<DD>
Solver failure&#46; The solver failed to return a sound answer&#46; It can be due to a broken external solver, or an error in solver configuration&#46;
<DT id="41">99<DD>
Internal error&#46; Something went wrong, likely due to a bug in opam itself&#46;
<DT id="42">130<DD>
User interrupt&#46; SIGINT was received, generally due to the user pressing Ctrl&#45;C&#46;
</DL>
<A NAME="lbAJ">&nbsp;</A>
<H2>FURTHER DOCUMENTATION</H2>
<P>
See <A HREF="https://opam">https://opam</A>&#46;ocaml&#46;org/doc&#46;
<A NAME="lbAK">&nbsp;</A>
<H2>AUTHORS</H2>
<P>
Vincent Bernardoff &lt;<A HREF="mailto:vb@luminar">vb@luminar</A>&#46;eu&#46;org&gt;
<P>
<P>
Raja Boujbel &lt;raja&#46;<A HREF="mailto:boujbel@ocamlpro">boujbel@ocamlpro</A>&#46;com&gt;
<P>
<P>
Roberto Di Cosmo &lt;<A HREF="mailto:roberto@dicosmo">roberto@dicosmo</A>&#46;org&gt;
<P>
<P>
Thomas Gazagnaire &lt;<A HREF="mailto:thomas@gazagnaire">thomas@gazagnaire</A>&#46;org&gt;
<P>
<P>
Louis Gesbert &lt;louis&#46;<A HREF="mailto:gesbert@ocamlpro">gesbert@ocamlpro</A>&#46;com&gt;
<P>
<P>
Fabrice Le Fessant &lt;Fabrice&#46;<A HREF="mailto:Le_fessant@inria">Le_fessant@inria</A>&#46;fr&gt;
<P>
<P>
Anil Madhavapeddy &lt;<A HREF="mailto:anil@recoil">anil@recoil</A>&#46;org&gt;
<P>
<P>
Guillem Rieu &lt;guillem&#46;<A HREF="mailto:rieu@ocamlpro">rieu@ocamlpro</A>&#46;com&gt;
<P>
<P>
Ralf Treinen &lt;ralf&#46;treinen@pps&#46;jussieu&#46;fr&gt;
<P>
<P>
Frederic Tuong &lt;<A HREF="mailto:tuong@users">tuong@users</A>&#46;gforge&#46;inria&#46;fr&gt;
<A NAME="lbAL">&nbsp;</A>
<H2>BUGS</H2>
<P>
Check bug reports at <A HREF="https://github">https://github</A>&#46;com/ocaml/opam/issues&#46;
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="43"><A HREF="#lbAB">NAME</A><DD>
<DT id="44"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="45"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="46"><A HREF="#lbAE">ARGUMENTS</A><DD>
<DT id="47"><A HREF="#lbAF">OPTIONS</A><DD>
<DT id="48"><A HREF="#lbAG">COMMON OPTIONS</A><DD>
<DT id="49"><A HREF="#lbAH">ENVIRONMENT VARIABLES</A><DD>
<DT id="50"><A HREF="#lbAI">EXIT STATUS</A><DD>
<DT id="51"><A HREF="#lbAJ">FURTHER DOCUMENTATION</A><DD>
<DT id="52"><A HREF="#lbAK">AUTHORS</A><DD>
<DT id="53"><A HREF="#lbAL">BUGS</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:21 GMT, March 31, 2021
</BODY>
</HTML>