package opam-client
Install
Dune Dependency
Authors
-
David Allsopp
-
VVincent Bernardoff <vb@luminar.eu.org>
-
RRaja Boujbel <raja.boujbel@ocamlpro.com>
-
KKate Deplaix <kit-ty-kate@outlook.com>
-
RRoberto Di Cosmo <roberto@dicosmo.org>
-
TThomas Gazagnaire <thomas@gazagnaire.org>
-
LLouis Gesbert <louis.gesbert@ocamlpro.com>
-
FFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>
-
AAnil Madhavapeddy <anil@recoil.org>
-
GGuillem Rieu <guillem.rieu@ocamlpro.com>
-
RRalf Treinen <ralf.treinen@pps.jussieu.fr>
-
FFrederic Tuong <tuong@users.gforge.inria.fr>
Maintainers
Sources
md5=0fb8e9f62683772592b1bc2d80a763b8
sha512=1c617b1c1656817a47ef65d02fc990357476f6c1b406c02717e5ff702a2c42e9f3818c2ddd54470926b2c5344c1c285216471a684d261be7a3ec84b05a32e726
doc/opam-client/OpamAuxCommands/index.html
Module OpamAuxCommands
Source
Some command helpers, and auxiliary opam management functions used by the CLI
val copy_files_to_destdir :
'a OpamStateTypes.switch_state ->
OpamTypes.dirname ->
OpamTypes.package_set ->
unit
Gets the file changes done in the installation of the given packages in the given switch, and copies the corresponding files to the same relative paths below the given prefix ; files that are not current according to the recorded package changes print warnings and aren't copied.
val remove_files_from_destdir :
'a OpamStateTypes.switch_state ->
OpamTypes.dirname ->
OpamTypes.package_set ->
unit
Removes all files that may have been installed by copy_files_to_destdir
; it's more aggressive than OpamDirTrack.revert
and doesn't check if the files are current.
If the URL points to a local, version-controlled directory, qualify it by suffixing `#current-branch` if no branch/tag/hash was specified.
val name_and_dir_of_opam_file :
?locked:string ->
OpamTypes.filename ->
OpamTypes.name option * OpamTypes.dirname
From an in-source opam file, return the corresponding package name if it can be found, and the corresponding source directory
val opams_of_dir :
?locked:string ->
?recurse:bool ->
?subpath:OpamTypes.subpath ->
OpamFilename.Dir.t ->
OpamStateTypes.name_and_file list
From a directory, retrieve its opam files and returns packages name, opam file and subpath option
val opams_of_dir_w_target :
?locked:string ->
?recurse:bool ->
?subpath:OpamTypes.subpath ->
?same_kind:(OpamUrl.t -> bool) ->
OpamUrl.t ->
OpamFilename.Dir.t ->
OpamStateTypes.name_and_file_w_url list
Like opams_of_dir
, but changes the pinning_url if needed. If given url
is local dir with vcs backend, and opam files not versioned, its pinning url is changed to rsync path-pin. If ame_kind the_new_url
returns true, package information (name, opam file, new_url, subpath) are added to the returned list, otherwise it is discarded.
val resolve_locals :
?quiet:bool ->
?locked:string ->
?recurse:bool ->
?subpath:OpamTypes.subpath ->
[ `Atom of OpamTypes.atom
| `Filename of OpamTypes.filename
| `Dirname of OpamTypes.dirname ]
list ->
OpamStateTypes.name_and_file_w_url list * OpamTypes.atom list
Resolves the opam files and directories in the list to package name and location, and returns the corresponding pinnings and atoms. May fail and exit if package names for provided `Filename
could not be inferred, or if the same package name appears multiple times.
val resolve_locals_pinned :
'a OpamStateTypes.switch_state ->
?recurse:bool ->
?subpath:OpamTypes.subpath ->
[ `Atom of OpamTypes.atom | `Dirname of OpamTypes.dirname ] list ->
OpamTypes.atom list
Resolves the opam files and directories in the list to package name and location, according to what is currently pinned, and returns the corresponding list of atoms. Prints warnings for directories where nothing is pinned, or opam files corresponding to no pinned package.
val autopin :
OpamStateTypes.rw OpamStateTypes.switch_state ->
?simulate:bool ->
?quiet:bool ->
?locked:string ->
?recurse:bool ->
?subpath:OpamTypes.subpath ->
[ `Atom of OpamTypes.atom
| `Filename of OpamTypes.filename
| `Dirname of OpamTypes.dirname ]
list ->
OpamStateTypes.rw OpamStateTypes.switch_state * OpamTypes.atom list
Resolves the opam files in the list to package name and location, pins the corresponding packages accordingly if necessary, otherwise updates them, and returns the resolved atom list. With simulate
, don't do the pinnings but return the switch state with the package definitions that would have been obtained if pinning. Also synchronises the specified directories, that is, unpins any package pinned there but not current (no more corresponding opam file).
This also handles pin-depends:
of the local packages. That part is done even if simulate
is true
.
val simulate_autopin :
'a OpamStateTypes.switch_state ->
?quiet:bool ->
?for_view:bool ->
?locked:string ->
?recurse:bool ->
?subpath:OpamTypes.subpath ->
[ `Atom of OpamTypes.atom
| `Filename of OpamTypes.filename
| `Dirname of OpamTypes.dirname ]
list ->
'a OpamStateTypes.switch_state * OpamTypes.atom list
The read-only version of autopin ~simulate:true
: this doesn't require a write-locked switch, and doesn't update the local packages. for_view
will result in the switch state containing more accurate information to be displayed to the user, but should never be flushed to disk because ; without that option, the state can safely be worked with and will just contain the proper package definitions