Skip to content

Commit ebb53a5

Browse files
authored
drops fileutils from the postinstall script (#1074)
* drops fileutils from the postinstall script After #1073 the installation from opam on a fresh switch is broken due to the dependency from fileutils in the postinstall script. This PR implements postinstall without it. * uses S instread of s
1 parent 7442e3f commit ebb53a5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

oasis/common

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,3 @@ Executable "postinstall"
3131
MainIs: postinstall.ml
3232
Install: false
3333
CompiledObject: best
34-
BuildDepends: fileutils

tools/postinstall.ml.ab

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,16 @@ let man_of_help prog =
2020
man
2121

2222
let bin_exists prog =
23-
try ignore (FileUtil.which prog); true with Not_found -> false
23+
Sys.command (sprintf "which %S" prog) = 0
2424

2525
let create_man prog =
2626
if bin_exists prog then [man_of_help prog] else []
2727

28+
let cp file = ignore @@ Sys.command (sprintf "cp %S %S" file mandir)
2829

2930
let main () =
3031
let helps = List.map create_man tools |> List.concat in
31-
FileUtil.mkdir ~parent:true mandir;
32-
FileUtil.cp (manpages @ helps) mandir
32+
if Sys.file_exists mandir && Sys.is_directory mandir then
33+
List.iter cp (manpages @ helps)
3334

3435
let () = main ()

0 commit comments

Comments
 (0)