From fc6454ecb07505028e4db7fcac50072a79901537 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Mon, 21 Oct 2024 15:14:16 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Kate --- src/client/opamAdminCommand.ml | 9 +++++---- src/client/opamAdminRepoUpgrade.ml | 9 ++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/client/opamAdminCommand.ml b/src/client/opamAdminCommand.ml index a43b91e29b3..7b3947d0ffb 100644 --- a/src/client/opamAdminCommand.ml +++ b/src/client/opamAdminCommand.ml @@ -335,15 +335,16 @@ let packages_with_prefixes repo_root packages = let check_opam_file_version_url has_error repo_root prefix nv opam = let min_opam_version = OpamVersion.of_string "2.0" in let url_file = - let ( // ) = OpamFilename.Op.( // ) in - OpamFile.(make - (OpamRepositoryPath.packages repo_root prefix nv // "url")) + let open OpamFilename.Op in + OpamFile.make + (OpamRepositoryPath.packages repo_root prefix nv // "url") in + let opam_version = opam.OpamFile.OPAM.opam_version in if OpamFile.exists url_file then (OpamConsole.warning "Not updating external URL file at %s" (OpamFile.to_string url_file); true) - else if OpamVersion.compare opam.OpamFile.OPAM.opam_version min_opam_version < 0 then + else if OpamVersion.compare opam_version min_opam_version < 0 then (OpamConsole.warning "OPAM version must be >= 2.0 at %s" (OpamFile.to_string (OpamRepositoryPath.opam repo_root prefix nv)); true) diff --git a/src/client/opamAdminRepoUpgrade.ml b/src/client/opamAdminRepoUpgrade.ml index 14c3ae43b2b..06eec4a4343 100644 --- a/src/client/opamAdminRepoUpgrade.ml +++ b/src/client/opamAdminRepoUpgrade.ml @@ -428,12 +428,11 @@ let do_upgrade repo_root = in if opam <> opam0 then (OpamFile.OPAM.write_with_preserved_format opam_file opam; - let ( // ) = OpamFilename.Op.( // ) in + let open OpamFilename.Op in + let path = OpamRepositoryPath.packages repo_root prefix package in List.iter OpamFilename.remove [ - OpamFile.(filename (make - (OpamRepositoryPath.packages repo_root prefix package // "descr"))); - OpamFile.(filename (make - (OpamRepositoryPath.packages repo_root prefix package // "url"))); + OpamFile.filename (OpamFile.make (path // "descr")); + OpamFile.filename (OpamFile.make (path // "url")); ]; OpamConsole.status_line "Updated %s" (OpamFile.to_string opam_file)) )