diff --git a/lib/analyse.ml b/lib/analyse.ml index 791fc1a3..e95221f5 100644 --- a/lib/analyse.ml +++ b/lib/analyse.ml @@ -244,10 +244,14 @@ module Analysis = struct let ( // ) = Fpath.( / ) in 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 -> + let add_package_data ~dir ~job (pkg, kind) packages = + match (packages, kind) with + | Error _ as err, _ -> + Lwt.return err + | Ok packages, Deleted -> + Current.Job.log job "Skipping deleted package: %s" (OpamPackage.to_string pkg); + Lwt.return_ok 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 @@ -266,7 +270,7 @@ module Analysis = struct let open Lwt_result.Syntax in let* changed_pkgs = find_changed_packages ~job ~master dir in let pkg_bindings = OpamPackage.Map.bindings changed_pkgs in - let+ packages = Lwt_list.fold_right_s (add_package_data ~dir) pkg_bindings (Ok []) in + let+ packages = Lwt_list.fold_right_s (add_package_data ~job ~dir) pkg_bindings (Ok []) in let r = { packages } in Current.Job.log job "@[Results:@,%a@]" Yojson.Safe.(pretty_print ~std:true) (to_yojson r); r