diff --git a/CHANGES.md b/CHANGES.md index d82e1b93..4f204b94 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,9 @@ next - Add ``enabled_if`` field for aliases and tests. This field controls whether the test will be ran using a boolean expression language. (#819, @rgrinberg) +- Interpret `X` in `--libdir X` as relative to `PREFIX` when `X` is relative + (#1072, fix #1070, @diml) + 1.0.1 (19/07/2018) ------------------ diff --git a/bin/main.ml b/bin/main.ml index df1433f9..9f795080 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -1020,9 +1020,9 @@ let get_prefix context ~from_command_line = | Some p -> Fiber.return (Path.of_string p) | None -> Context.install_prefix context -let get_libdir context ~libdir_from_command_line = +let get_libdir context ~prefix ~libdir_from_command_line = match libdir_from_command_line with - | Some p -> Fiber.return (Some (Path.of_string p)) + | Some p -> Fiber.return (Some (Path.relative prefix p)) | None -> Context.install_ocaml_libdir context let print_unix_error f = @@ -1108,7 +1108,7 @@ let install_uninstall ~what = ~f:(fun (context, install_files) -> get_prefix context ~from_command_line:prefix_from_command_line >>= fun prefix -> - get_libdir context ~libdir_from_command_line + get_libdir context ~prefix ~libdir_from_command_line >>| fun libdir -> List.iter install_files ~f:(fun (package, path) -> let entries = Install.load_install_file path in