12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788(**************************************************************************)(* *)(* Copyright 2019 OCamlPro *)(* *)(* 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. *)(* *)(**************************************************************************)(* basic ops *)typet=stringletof_strings=sletto_strings=sletcompare=OpamStd.String.compare_caseletequalsr=comparesr=0letto_jsons=`O[("sys_package",`Strings)]letof_json=function|`Odict->(matchOpamStd.List.assocString.equal"sys_package"dictwith|`Strings->Some(of_strings)|_->None|exceptionNot_found->None)|_->NonemoduleO=structtypetmp=ttypet=tmpletcompare=compareletto_string=to_stringletto_json=to_jsonletof_json=of_jsonendmoduleSet=OpamStd.Set.Make(O)moduleMap=OpamStd.Map.Make(O)letraw_setset=OpamStd.String.Set.fold(funspkgset->Set.add(of_stringspkg)set)setSet.empty(** System package status *)typestatus={s_available:Set.t;(** Package available but not installed *)s_not_found:Set.t;(** Package unavailable on this system *)}letstatus_empty={s_available=Set.empty;s_not_found=Set.empty;}letstring_of_statussp=Printf.sprintf"available: %s; not_found: %s"(Set.to_stringsp.s_available)(Set.to_stringsp.s_not_found)(** System packages to install *)typeto_install={ti_new:Set.t;(** Package to install required by new opam packages *)ti_required:Set.t(** Package to install required by already install opam packages *)}letto_install_empty={ti_new=Set.empty;ti_required=Set.empty;}letstring_of_to_installti=Printf.sprintf"new: %s; required: %s"(Set.to_stringti.ti_new)(Set.to_stringti.ti_required)