Skip to content

Commit

Permalink
Replace Dir_helpers with OpamFilename helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
punchagan committed Dec 19, 2024
1 parent d19e2c7 commit f4bfcdb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 50 deletions.
9 changes: 5 additions & 4 deletions opam-ci-check/bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,16 @@ let lint package_specs local_repo_dir =
| Some opam_repo_dir -> (
print_endline
@@ Printf.sprintf "Linting opam-repository at %s ..." opam_repo_dir;
Dir_helpers.with_temp_dir "opam-ci-check-lint-" @@ fun dir ->
OpamFilename.with_tmp_dir @@ fun dir ->
let process_package { pkg; src; newly_published } =
let opam = read_package_opam ~opam_repo_dir pkg in
let pkg_src_dir =
if Option.is_none src then
let dir = dir // OpamPackage.to_string pkg in
let dir =
OpamFilename.Dir.to_string dir // OpamPackage.to_string pkg
in
fetch_package_src ~dir ~pkg opam
else
src
else src
in
Lint.v ~pkg ~newly_published ~pkg_src_dir opam
in
Expand Down
42 changes: 0 additions & 42 deletions opam-ci-check/lib/dir_helpers.ml

This file was deleted.

1 change: 0 additions & 1 deletion opam-ci-check/lib/lint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* Copyright (c) 2024 Puneeth Chaganti <[email protected]>, Shon Feder <[email protected]>, Tarides <[email protected]>
*)

module D = Dir_helpers
module O = Opam_helpers

let ( // ) = Filename.concat
Expand Down
1 change: 0 additions & 1 deletion opam-ci-check/lib/opam_ci_check.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ module Variant = Variant
module Opam_version = Opam_version
module Compiler_version = Compiler_version
module Spec = Spec
module Dir_helpers = Dir_helpers
module Opam_helpers = Opam_helpers
3 changes: 1 addition & 2 deletions opam-ci-check/lib/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*)

module H = Dune_helpers
module D = Dir_helpers

type error = OpamPackage.t * exn

Expand Down Expand Up @@ -59,7 +58,7 @@ let test_packages_with_dune opam_repository target_pkg packages =
OpamConsole.msg
"Installing latest version of reverse dependencies with pinned %s\n"
(OpamPackage.to_string target);
let parent = D.create_temp_dir "revdeps_" in
let parent = OpamFilename.mk_tmp_dir () |> OpamFilename.Dir.to_string in
(* FIXME: there can be 1000s of revdeps?! *)
let selected_packages = H.take 3 packages in
(* Prompt before creating the projects *)
Expand Down

0 comments on commit f4bfcdb

Please sign in to comment.