Monorepo management for opam overlays
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix missing repo synopsis using main package, not first alphabetically

When reporting missing repos, pick the synopsis from the opam file
whose name matches the repo name (e.g. scitt.opam for ocaml-scitt)
instead of whichever package was encountered first (atp-lexicon-scitt).

+12 -5
+12 -5
lib/push.ml
··· 415 415 mono 416 416 end 417 417 418 - let log_missing_repos missing = 418 + let log_missing_repos ~all_pkgs missing = 419 419 if missing <> [] then begin 420 420 Log.app (fun m -> 421 421 m "\n%d repo(s) could not be cloned (remote not found):" ··· 425 425 List.iter 426 426 (fun { pkg; url } -> 427 427 let name = Package.repo_name pkg in 428 + (* Find the package whose name matches the repo name for the best 429 + synopsis (e.g. "scitt" for ocaml-scitt, not "atp-lexicon-scitt") *) 430 + let best = 431 + match List.find_opt (fun p -> Package.name p = name) all_pkgs with 432 + | Some p -> p 433 + | None -> pkg 434 + in 428 435 let synopsis = 429 - Option.value ~default:"OCaml library" (Package.synopsis pkg) 436 + Option.value ~default:"OCaml library" (Package.synopsis best) 430 437 in 431 438 Log.app (fun m -> m " %s %s" url name); 432 439 Log.app (fun m -> m " %s" synopsis)) ··· 434 441 end 435 442 436 443 let export_and_push ~proc ~fs ~fs_t ~config ~sources ~upstream ~push_mono ~clean 437 - ~force repos = 444 + ~force ~all_pkgs repos = 438 445 let n_repos = List.length repos in 439 446 let total = if upstream then n_repos * 2 else n_repos in 440 447 let progress = Tty.Progress.v ~total "Push" in ··· 450 457 else List.map (fun p -> Ok (Package.repo_name p)) pushed_repos 451 458 in 452 459 Tty.Progress.clear progress; 453 - log_missing_repos missing; 460 + log_missing_repos ~all_pkgs missing; 454 461 match log_push_results push_results with 455 462 | Error e -> Error e 456 463 | Ok () -> ··· 525 532 end 526 533 else 527 534 export_and_push ~proc ~fs ~fs_t ~config ~sources ~upstream 528 - ~push_mono ~clean ~force to_push 535 + ~push_mono ~clean ~force ~all_pkgs:pkgs to_push 529 536 end 530 537 end