Bug 277821 - Mk/bsd.ocaml.mk USE_OCAML_LDCONFIG generates duplicates
Summary: Mk/bsd.ocaml.mk USE_OCAML_LDCONFIG generates duplicates
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-19 21:53 UTC by Benjamin Jacobs
Modified: 2024-03-19 21:53 UTC (History)
0 users

See Also:


Attachments
patch (873 bytes, patch)
2024-03-19 21:53 UTC, Benjamin Jacobs
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Jacobs 2024-03-19 21:53:51 UTC
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?