1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495(**************************************************************************)(* *)(* Copyright 2012-2015 OCamlPro *)(* Copyright 2012 INRIA *)(* *)(* All rights reserved. This file is distributed under the terms of the *)(* GNU Lesser General Public License version 2.1, with the special *)(* exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)typet=stringletto_stringx=xletof_stringx=xletto_jsonx=`Stringxletof_json=function|`Stringx->Some x|_->Noneletcomparevw=OpamVersionCompare.comparevwmoduleO=structtypet=stringletto_string=to_stringletto_json=to_jsonletof_json=of_jsonletcompare=compareendmoduleSet=OpamStd.Set.Make(O)moduleMap=OpamStd.Map.Make(O)letcurrent_raw=STRINGIFY(VERSION)letcurrent=of_stringcurrent_rawletmajorv=tryleti=String.indexv'.'inof_string(String.subv0i)withNot_found->vletnopatchv=tryleti=String.indexv'.'inleti=String.index_fromv(i+1)'.'in(String.subv0i)withNot_found->letrecfi=ifi>=String.lengthvthenvelsematchString.getviwith|'0'..'9'|'.'->f(i+1)|_->String.subv0iinf0letcurrent_nopatch =nopatchcurrent_rawletmessage()=OpamConsole.msg"\n\ %s version %s\n\
\n\
Copyright (C) 2012 OCamlPro - INRIA, 2013-2015 OCamlPro\n\
\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"Sys.executable_namecurrent_raw;exit0letgitversion=refNoneletset_gits=gitversion:=Somesletgit()=match!gitversionwith|None->None|Somev->Some(of_stringv)letis_dev_version()=(!gitversion<>None)letfull()=letgit_version=matchgit()with|None->""|Somev->Printf.sprintf" (%s)"(to_stringv)inPrintf.sprintf"%s%s"(to_stringcurrent)git_versionletmagic()=lethash=Hashtbl.hash(full())inString.sub(Printf.sprintf"%08X"hash)08