Module OpamUrl
URL parsing and printing, with support for our different backends
type version_control=[|`git|`darcs|`hg]type backend=[|`http|`rsync|version_control]
val string_of_backend : backend -> stringval backend_of_string : string -> [> backend ]Tolerates lots of backward compatibility names;
- raises Failure
on unknown protocol
type t={transport : string;the part just before '://'
path : string;the part after '://'
hash : string option;the optional branch/ref specification, at the end after a '#'
backend : backend;the backend that opam should use to handle this url
}
val parse : ?backend:backend -> ?handle_suffix:bool -> string -> tSame as
of_string, but allows enforcing the expected backend, and may otherwise guess version control from the suffix by default (for e.g. https://foo/bar.git). (this should be disabled when parsing from files). Note thathandle_suffixalso handles user-name in ssh addresses (e.g. "ssh://git@github.com/...")
include OpamStd.ABSTRACT with type t := t
val of_string : string -> tval to_string : t -> stringval to_json : t -> OpamJson.t
module Set : OpamStd.SET with type elt = tmodule Map : OpamStd.MAP with type key = tval empty : tDummy filler url
val base_url : t -> stringReturns the url string without the VC part (i.e. "git+foo://bar" returns "foo://bar")
val basename : t -> stringThe last part of the url path, e.g.
"http://foo/bar/this"or"http://that.here/"
val root : t -> tReturns the url with all path components but the first one (the hostname) dropped, e.g.
"http://some.host/some/path"becomes"http://some.host"
val has_trailing_slash : t -> boolval local_dir : t -> OpamFilename.Dir.t optionCheck if the URL matches an existing local directory, and return it
val local_file : t -> OpamFilename.t optionCheck if the URL matches an existing local file, and return it
val guess_version_control : string -> [> version_control ] optionIf the given url-string has no 'transport://' specification and corresponds to an existing local path, check for version-control clues at that path
module Op : sig ... end