Created attachment 249312 [details] patch The postexec pkg script created by bsd.ocaml.mk with USE_OCAML_LDCONFIG=yes should check the existence of a line before adding it to PREFIX/lib/ocaml/ld.conf. As far as I can tell, this bug has a no adverse consequences, beside bloating said file with duplicates during package upgrade or re-installation. The attached patch fixes the issue and, while at it, makes the un-installation precisely match the directory by anchoring the regex (that could become an issue if some ocaml library shares the prefix of another). The escaping is a bit gross though... Ideally, a keyword similar to @shell may be created, couldn't it?