From: Stephane Glondu Date: Sun, 16 Jun 2024 11:44:35 +0200 Subject: Use Stdlib instead of Pervasives This fixes build with OCaml 5.x. --- bootstrapCommon.ml | 12 ++++++------ buildGraph.ml | 8 ++++---- clean-repository.ml | 2 +- graphUtils.ml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bootstrapCommon.ml b/bootstrapCommon.ml index a48132d..6111752 100644 --- a/bootstrapCommon.ml +++ b/bootstrapCommon.ml @@ -23,7 +23,7 @@ include Util.Logging(struct let label = label end) ;; module CudfSet = CudfAdd.Cudf_set -module Int = struct type t = int let compare = Pervasives.compare end +module Int = struct type t = int let compare = Stdlib.compare end module IntSet = Set.Make(Int) module StringSet = Set.Make(String) @@ -200,26 +200,26 @@ let debcudf_compare a b = | `SrcPkg, `BinPkg -> -1 | `BinPkg, `SrcPkg -> 1 | `SrcPkg, `SrcPkg -> begin - let name_cmp = Pervasives.compare name_a name_b in + let name_cmp = Stdlib.compare name_a name_b in if name_cmp <> 0 then name_cmp else - let ver_cmp = Pervasives.compare cudfver_a cudfver_b in + let ver_cmp = Stdlib.compare cudfver_a cudfver_b in if ver_cmp = 0 then fatal "duplicate source package"; ver_cmp end | `BinPkg, `BinPkg -> begin - let name_cmp = Pervasives.compare name_a name_b in + let name_cmp = Stdlib.compare name_a name_b in if name_cmp <> 0 then name_cmp else begin - let ver_cmp = Pervasives.compare cudfver_a cudfver_b in + let ver_cmp = Stdlib.compare cudfver_a cudfver_b in if ver_cmp <> 0 then ver_cmp else begin let arch_a = debarchitecture_of_cudfpkg a in let arch_b = debarchitecture_of_cudfpkg b in - let arch_cmp = Pervasives.compare arch_a arch_b in + let arch_cmp = Stdlib.compare arch_a arch_b in if arch_cmp = 0 then fatal "duplicate binary package"; arch_cmp end diff --git a/buildGraph.ml b/buildGraph.ml index b6eced7..222245f 100644 --- a/buildGraph.ml +++ b/buildGraph.ml @@ -35,9 +35,9 @@ module Unique = Unique.Make(struct type t = vertex let compare v1 v2 = match v1,v2 with - |SrcPkg p1, SrcPkg p2 -> Pervasives.compare p1 p2 + |SrcPkg p1, SrcPkg p2 -> Stdlib.compare p1 p2 |InstSet (p1,s1), InstSet (p2,s2) -> begin - match Pervasives.compare p1 p2 with + match Stdlib.compare p1 p2 with | 0 -> IntSet.compare s1 s2 | i -> i end @@ -71,7 +71,7 @@ let compare_edge e1 e2 = module PkgV = struct type t = Unique.t - let compare v1 v2 = Pervasives.compare (Unique.uid v1) (Unique.uid v2) + let compare v1 v2 = Stdlib.compare (Unique.uid v1) (Unique.uid v2) let hash = Unique.uid let equal v1 v2 = (Unique.uid v1) = (Unique.uid v2) end @@ -444,7 +444,7 @@ let from_ic universe native_arch ic = let sort l1 l2 = let id1 = List.assoc "id" l1 in let id2 = List.assoc "id" l2 in - Pervasives.compare id1 id2 + Stdlib.compare id1 id2 in GR.parse ~nodesort:(Some sort) ~edgesort:(Some sort) ic ;; diff --git a/clean-repository.ml b/clean-repository.ml index 07ad34f..fcf5f95 100644 --- a/clean-repository.ml +++ b/clean-repository.ml @@ -60,7 +60,7 @@ module PackageGraphCondensed = struct | Pkg of int | SCC of IntSet.t let compare x y = match (x,y) with - | Pkg p1, Pkg p2 -> Pervasives.compare p1 p2 + | Pkg p1, Pkg p2 -> Stdlib.compare p1 p2 | SCC s1, SCC s2 -> IntSet.compare s1 s2 | Pkg _, SCC _ -> -1 | SCC _, Pkg _ -> 1 diff --git a/graphUtils.ml b/graphUtils.ml index 26e1d7f..25c39fb 100644 --- a/graphUtils.ml +++ b/graphUtils.ml @@ -299,7 +299,7 @@ module FAS (G : Graph.Sig.I) = struct module FindCyclesG = FindCycles(G) module Dfs = Graph.Traverse.Dfs(G) module GraphUtilsG = GraphUtils(G) - module Int = struct type t = int let compare = Pervasives.compare end + module Int = struct type t = int let compare = Stdlib.compare end module IntSet = Set.Make(Int) module T = Graph.Topological.Make(G)