Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kate <[email protected]>
  • Loading branch information
hannesm and kit-ty-kate committed Oct 21, 2024
1 parent b43c23e commit fc6454e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 5 additions & 4 deletions src/client/opamAdminCommand.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 4 additions & 5 deletions src/client/opamAdminRepoUpgrade.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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))
)
Expand Down

0 comments on commit fc6454e

Please sign in to comment.