diff --git a/lib/analyse.ml b/lib/analyse.ml index 791fc1a3..05fe650a 100644 --- a/lib/analyse.ml +++ b/lib/analyse.ml @@ -245,9 +245,12 @@ module Analysis = struct Fpath.v "packages" // name // (name^"."^version) // "opam" let add_package_data ~dir (pkg, kind) packages = - match packages with - | Error _ as err -> Lwt.return err - | Ok packages -> + match (packages, kind) with + | Error _ as err, _ -> + Lwt.return err + | Ok packages, Deleted -> + Lwt.return_ok ((pkg, {kind; has_tests = false}) :: packages) + | Ok packages, _ -> let open Lwt_result.Syntax in let path = Fpath.to_string (package_to_path pkg) in let* content = get_opam ~cwd:dir path |> Lwt_result.map_error (fun _ -> `Msg "impossible") in diff --git a/test/analyse.t b/test/analyse.t index 168a656f..773796f5 100644 --- a/test/analyse.t +++ b/test/analyse.t @@ -109,7 +109,11 @@ Test deleting existing packages works * a-1.0.0.1 removed (HEAD -> new-branch-2) * a-1 (tag: initial-state, new-branch-1, master) $ opam-repo-ci-local --repo="." --branch=new-branch-2 --analyse-only --no-web-server - Error "impossible" + { + "packages": [ + [ "a-1.0.0.1", { "kind": [ "Deleted" ], "has_tests": false } ] + ] + } Clean up the build cache