Repository navigation
Commit 2bff501
committed
fix(freebsd): treat ${LOCALBASE}/bin as pkg-managed; resolve self via sysctl
Two FreeBSD gaps remain after the runtime rework of install/update
(DeusData#1566) and the KERN_PROC_PATHNAME self-path fix landed on main.
1. cli_external_manager_name() matches only positive evidence (mise,
Homebrew, nix, asdf, cargo). ${LOCALBASE}/bin was not among them, so a
ports/pkg install of cbm was still copied into ~/.local/bin and a
shell rc was edited -- exactly what externally-managed detection is
meant to prevent. Recognise ${LOCALBASE}/bin and /sbin on FreeBSD so
install skips the copy and update defers to `pkg upgrade`.
LOCALBASE is configurable, so the FreeBSD port passes its real PREFIX
via -DCBM_PKG_PREFIX and we honour it, falling back to the documented
/usr/local default for a plain upstream build. --force-binary remains
the escape hatch for anyone self-managing that prefix.
2. resolve_self_executable() in the HTTP server still read
/proc/self/exe, which FreeBSD does not mount by default. Add a
KERN_PROC_PATHNAME sysctl branch, mirroring cbm_detect_self_path().
Test updated: on FreeBSD ${LOCALBASE}/bin/cbm is now externally managed;
a non-LOCALBASE prefix (/opt/local) is not.
Signed-off-by: Olivier Cochard-Labbé <olivier@cochard.me>1 parent 31819c9 commit 2bff501
3 files changed
Lines changed: 45 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9699 | 9699 | | |
9700 | 9700 | | |
9701 | 9701 | | |
| 9702 | + | |
| 9703 | + | |
| 9704 | + | |
| 9705 | + | |
| 9706 | + | |
| 9707 | + | |
| 9708 | + | |
| 9709 | + | |
| 9710 | + | |
| 9711 | + | |
| 9712 | + | |
| 9713 | + | |
| 9714 | + | |
| 9715 | + | |
| 9716 | + | |
| 9717 | + | |
| 9718 | + | |
| 9719 | + | |
| 9720 | + | |
| 9721 | + | |
| 9722 | + | |
9702 | 9723 | | |
9703 | 9724 | | |
9704 | 9725 | | |
| |||
12227 | 12248 | | |
12228 | 12249 | | |
12229 | 12250 | | |
| 12251 | + | |
| 12252 | + | |
12230 | 12253 | | |
12231 | 12254 | | |
12232 | 12255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
| |||
1003 | 1007 | | |
1004 | 1008 | | |
1005 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1006 | 1019 | | |
1007 | 1020 | | |
1008 | 1021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12752 | 12752 | | |
12753 | 12753 | | |
12754 | 12754 | | |
12755 | | - | |
12756 | 12755 | | |
| 12756 | + | |
| 12757 | + | |
| 12758 | + | |
| 12759 | + | |
| 12760 | + | |
| 12761 | + | |
| 12762 | + | |
| 12763 | + | |
| 12764 | + | |
12757 | 12765 | | |
12758 | 12766 | | |
12759 | 12767 | | |
| |||
0 commit comments