package opam-core
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=c74015d93dffc824bc339dabed86027b
sha512=122dd2624106cd7bdb4d835d08aabeb3feee18a42b537e0e5c0da1e56cb4e908705e77e8720aa652a2e0b588aa9ba1cd53bb3e952f3243d9025cae7c753b0576
doc/opam-core/OpamStd/Env/index.html
Module OpamStd.Env
Source
Generic functions
Remove from a c-separated list of string the ones with the given prefix
split a c-separated list of string in two according to the first occurrences of the string with the given prefix
. The list of elements occurring before is returned in reverse order. If there are other elements with the same prefix
they are kept in the second list.
Utility function for shell single-quoted strings. In most shells, backslash escapes are not allowed and a single quote needs to be replaced by quote double-quote quote double-quote quote
(close the single-quoted literal, put the single quote in a double-quoted literal, and reopen a single-quoted literal). fish is the exception and should set using_backslashes
to escape both quotes and backslashes using backslashes
Utility function for PowerShell strings.
Environment variable handling
Environment variable names. Windows has complicated semantics for environment variables. The retrieval functions are case insensitive, but it's "legal" for the environment block to contain entries which differ only by case. If environment variables are set entirely using CRT or Win32 API functions, then there isn't usually a problem, the issue arises when creating a program where the environment block is instead passed. In this model, it's very easy to end up with two bindings in the same block. When dealing with Windows programs, this will mostly be transparent, but it's a problem with Cygwin which actively allows "duplicate" entries which differ by case only and implements Posix semantics on top of this. The problem is constantly with us thanks to the use of PATH on Unix, and Path on Windows! opam tries to ensure that environment variables are looked up according to the OS semantics (so case insensitively on Windows) and OpamEnv goes to some trouble to ensure that updates to environment variables are case preserving (i.e. PATH+=foo gets transformed to Path+=foo if Path exists in the environment block).
cyg_env ~env ~cygbin ~git_location
returns env
environment with its PATH variable updated with git_location
and cygbin
at the beginning, ie PATH=<git_location>:<cygbin>:$PATH. Usual `env` argument is `OpamStd.Env.raw_env`.