.\" Pipe this output to groff -man -Tutf8 | less .\" .TH "OPAM-PIN" 1 "" "Opam 1.2.2" "Opam Manual" .\" Disable hyphenation and ragged-right .nh .ad l .SH NAME .P opam\-pin \- Pin a given package to a specific version or source. .SH SYNOPSIS .P \fBopam pin\fR [\fIOPTION\fR]... [\fICOMMAND\fR] [\fIARG\fR]... .SH DESCRIPTION .P This command allows local customisation of the packages in a given switch. A package can be pinned to a specific upstream version, to a path containing its source, to a version\-controlled location or to a URL. If a file `NAME.opam' with \fINAME\fR matching the package name, or just `opam', is found at the root of the pinned source, it will be used as the package's definition, overriding its previous definition if any. If a directory by one of these names is found, its contents will be used, also overriding other package metadata (`descr', extra `files' subdirectory...) .SH COMMANDS .P Without argument, defaults to \fBlist\fR. .TP 4 \fBlist\fR Lists pinned packages. .TP 4 \fBadd\fR \fIPACKAGE\fR \fITARGET\fR Pins package \fIPACKAGE\fR to \fITARGET\fR, which may be a version, a path, or a URL. \fIPACKAGE\fR can be omitted if \fITARGET\fR is a local path containing a package description with a name. \fITARGET\fR can be replaced by `\-\-dev\-repo' if a package by that name is already known. OPAM will infer the kind of pinning from the format of \fITARGET\fR, using \fBpath\fR pinning by default, unless you use an explicit \fB\-\-kind\fR option. Pins to version control systems may target a specific branch or commit using \fB#branch\fR e.g. \fBgit://host/me/pkg#testing\fR. When they don't, in the special case of version\-controlled pinning to a local path, OPAM will use "mixed mode": it will only use version\-controlled files, but at their current, on\-disk version. If \fIPACKAGE\fR is not a known package name, a new package by that name will be locally created. The package version may be specified by using the format \fINAME\fR.\fIVERSION\fR for $(PACKAGE), in the source opam file, or with \fBedit\fR. .TP 4 \fBremove\fR \fINAMES\fR Unpins packages \fBNAMES\fR, restoring their definition from the repository, if any. .TP 4 \fBedit\fR \fINAME\fR Opens an editor giving you the opportunity to change the opam file that OPAM will locally use for pinned package \fBNAME\fR, including its version. To simply change the pinning target, use \fBadd\fR. The chosen editor is determined from environment variables \fBOPAM_EDITOR\fR, \fBVISUAL\fR or \fBEDITOR\fR, in order. .SH OPTIONS .TP 4 \fB\-\-dev\-repo\fR Pin to the upstream package source for the latest development version .TP 4 \fB\-e\fR, \fB\-\-edit\fR With $(opam pin add), edit the opam file as with `opam pin edit' after pinning. .TP 4 \fB\-k\fR \fIKIND\fR, \fB\-\-kind\fR=\fIKIND\fR Sets the kind of pinning. Must be one of one of `version', `path', `http', `git', `darcs', `hg' or `auto'. If unset, is inferred from the format of the target, defaulting to \fIpath\fR. If \fIauto\fR or \fIOPAMPINKINDAUTO\fR is set, a local path will be searched for version control and the pinning kind set accordingly. This is expected to become the default in a next version. .TP 4 \fB\-n\fR, \fB\-\-no\-action\fR Just record the new pinning status, and don't prompt for (re)installation or removal of affected packages. .TP 4 \fB\-s\fR, \fB\-\-short\fR Output raw lists of names, one per line, skipping any details. .SH COMMON OPTIONS .P These options are common to all commands. .TP 4 \fB\-\-color\fR=\fIWHEN\fR (absent=auto) Colorize the output. \fIWHEN\fR must be one of `always', `never' or `auto'. .TP 4 \fB\-\-criteria\fR=\fICRITERIA\fR Specify user \fIpreferences\fR for dependency solving for this run. Overrides both \fB$OPAMCRITERIA\fR and \fB$OPAMUPGRADECRITERIA\fR. For details on the supported language, and the external solvers available, see \fI http://opam.ocaml.org/doc/Specifying_Solver_Preferences.html\fR. A general guide to using solver preferences can be found at \fI http://www.dicosmo.org/Articles/usercriteria.pdf\fR. The default value is \-count(down),\-count(removed),\-notuptodate(solution),\-sum(solution,version\-lag),\-count(new) for upgrades, and \-count(removed),\-notuptodate(request),\-sum(request,version\-lag),\-count(down),\-notuptodate(changed),\-count(changed),\-notuptodate(solution),\-sum(solution,version\-lag) otherwise. .TP 4 \fB\-\-cudf\fR=\fIFILENAME\fR Debug option: Save the CUDF requests sent to the solver to \fIFILENAME\fR\-.cudf. .TP 4 \fB\-\-debug\fR Print debug message to stderr. This is equivalent to setting \fB$OPAMDEBUG\fR to "true". .TP 4 \fB\-\-debug\-level\fR=\fILEVEL\fR Like `\-\-debug', but allows specifying the debug level (`\-\-debug' sets it to 1). Equivalent to setting \fB$OPAMDEBUG\fR to a positive integer. .TP 4 \fB\-\-git\-version\fR Print the git version if it exists and exit. .TP 4 \fB\-\-help\fR[=\fIFMT\fR] (default=pager) Show this help in format \fIFMT\fR (pager, plain or groff). .TP 4 \fB\-\-no\-base\-packages\fR Do not install base packages (useful for testing purposes). This is equivalent to setting \fB$OPAMNOBASEPACKAGES\fR to a non\-empty string. .TP 4 \fB\-\-no\-self\-upgrade\fR OPAM will replace itself with a newer binary found at \fBOPAMROOT/opam\fR if present. This disables this behaviour. .TP 4 \fB\-q\fR, \fB\-\-quiet\fR Be quiet when installing a new compiler. .TP 4 \fB\-\-root\fR=\fIROOT\fR (absent=~/.opam) Use \fIROOT\fR as the current root path. This is equivalent to setting \fB$OPAMROOT\fR to \fIROOT\fR. .TP 4 \fB\-\-safe\fR Make sure nothing will be automatically updated or rewritten. Useful for calling from completion scripts, for example. Will fail whenever such an operation is needed ; also avoids waiting for locks, skips interactive questions and overrides the OPAMDEBUG variable. .TP 4 \fB\-\-solver\fR=\fICMD\fR Specify the name of the external dependency \fIsolver\fR. The default value is aspcud. Either 'aspcud', 'packup' or a custom command that may contain the variables %{input}%, %{output}% and %{criteria}% .TP 4 \fB\-\-strict\fR Fail whenever an error is found in a package definition or a configuration file. The default is to continue silently if possible. .TP 4 \fB\-\-switch\fR=\fISWITCH\fR Use \fISWITCH\fR as the current compiler switch. This is equivalent to setting \fB$OPAMSWITCH\fR to \fISWITCH\fR. .TP 4 \fB\-\-use\-internal\-solver\fR, \fB\-\-no\-aspcud\fR Force use of internal heuristics, even if an external solver is available. .TP 4 \fB\-v\fR, \fB\-\-verbose\fR Be more verbose, show package sub\-commands and their output. Repeat to see more. Repeating \fIn\fR times is equivalent to setting \fB$OPAMVERBOSE\fR to "\fIn\fR". .TP 4 \fB\-\-version\fR Show version information. .TP 4 \fB\-y\fR, \fB\-\-yes\fR Disable interactive mode and answer yes to all questions that would otherwise be asked to the user. This is equivalent to setting \fB$OPAMYES\fR to "true". .SH ENVIRONMENT VARIABLES .P OPAM makes use of the environment variables listed here. Boolean variables should be set to "0", "no" of "false" to disable, "1", "yes" or "true" to enable. .P \fIOPAMCOLOR\fR, when set to \fIalways\fR or \fInever\fR, sets a default value for the \-\-color option. .P \fIOPAMCRITERIA\fR specifies user \fIpreferences\fR for dependency solving.The default value is \-count(removed),\-notuptodate(request),\-sum(request,version\-lag),\-count(down),\-notuptodate(changed),\-count(changed),\-notuptodate(solution),\-sum(solution,version\-lag). See also option \-\-criteria .P \fIOPAMCURL\fR can be used to select a given 'curl' program. See \fIOPAMFETCH\fR for more options. .P \fIOPAMDEBUG\fR see options `\-\-debug' and `\-\-debug\-level'. .P \fIOPAMDOWNLOADJOBS\fR sets the maximum number of simultaneous downloads. .P \fIOPAMEXTERNALSOLVER\fR see option `\-\-solver'. .P \fIOPAMFETCH\fR specifies how to download files: either `wget', `curl' or a custom command where variables \fB%{url}%\fR, \fB%{out}%\fR, \fB%{retries}%\fR, \fB%{compress}%\fR and \fB%{checksum}%\fR will be replaced. Overrides the 'download\-command' value from the main config file. .P \fIOPAMJOBS\fR sets the maximum number of parallel workers to run. .P \fIOPAMLOCKRETRIES\fR sets the number of tries after which OPAM gives up acquiring its lock and fails. <= 0 means infinite wait. .P \fIOPAMNO\fR answer no to any question asked. .P \fIOPAMNOASPCUD\fR see option `\-\-no\-aspcud'. .P \fIOPAMNOSELFUPGRADE\fR see option `\-\-no\-self\-upgrade'. .P \fIOPAMPINKINDAUTO\fR if set, version control systems are detected when pinning to a local path. .P \fIOPAMREQUIRECHECKSUMS\fR see option `\-\-require\-checksums'. .P \fIOPAMRETRY\fR sets the number of tries before failing downloads. .P \fIOPAMROOT\fR see option `\-\-root'. This is automatically set by `opam config env \-\-root=DIR' when DIR is non\-default or OPAMROOT is already defined. .P \fIOPAMSAFE\fR see option `\-\-safe' .P \fIOPAMSKIPVERSIONCHECKS\fR bypasses some version checks. Unsafe, for compatibility testing only. .P \fIOPAMSOLVERTIMEOUT\fR change the time allowance of the internal solver. .P \fIOPAMSTATUSLINE\fR display a dynamic status line showing what's currently going on on the terminal. (one of one of `always', `never' or `auto') .P \fIOPAMSWITCH\fR see option `\-\-switch'. Automatically set by `opam config env \-\-switch=SWITCH'. .P \fIOPAMUPGRADECRITERIA\fR specifies user \fIpreferences\fR for dependency solving when performing an upgrade. Overrides \fIOPAMCRITERIA\fR in upgrades if both are set.The default value is \-count(down),\-count(removed),\-notuptodate(solution),\-sum(solution,version\-lag),\-count(new). See also option \-\-criteria .P \fIOPAMUSEINTERNALSOLVER\fR see option `\-\-use\-internal\-solver'. .P \fIOPAMUTF8\fR use UTF8 characters in output (one of one of `always', `never' or `auto'). By default `auto', which is determined from the locale). .P \fIOPAMUTF8MSGS\fR use extended UTF8 characters (camels) in OPAM messages. Implies \fIOPAMUTF8\fR. This is set by default on OSX only. .P \fIOPAMVAR_var\fR overrides the contents of the variable \fIvar\fR when substituting `%{var}%` strings in `opam` files. .P \fIOPAMVAR_package_var\fR overrides the contents of the variable \fIpackage:var\fR when substituting `%{package:var}%` strings in `opam` files. .P \fIOPAMVERBOSE\fR see option `\-\-verbose'. .P \fIOPAMYES\fR see option `\-\-yes'. .SH FURTHER DOCUMENTATION .P See https://opam.ocaml.org. .SH AUTHORS .P Thomas Gazagnaire .sp -1 .P Anil Madhavapeddy .sp -1 .P Fabrice Le Fessant .sp -1 .P Frederic Tuong .sp -1 .P Louis Gesbert .sp -1 .P Vincent Bernardoff .sp -1 .P Guillem Rieu .sp -1 .P Roberto Di Cosmo .SH BUGS .P Check bug reports at https://github.com/ocaml/opam/issues.