How extended keg linking works in nanobrew
mainNanobrew uses a linking process to make package contents accessible within the global prefix. Previously, only bin/ and sbin/ were symlinked. The extended linking design ensures that libraries, headers, and shared data are also available by mirroring specific keg subdirectories into the prefix.
Linked Directories:
bin/andsbin/$\rightarrow$prefix/bin/(Executables)lib/$\rightarrow$prefix/lib/(Shared libraries,.aarchives, pkgconfig)include/$\rightarrow$prefix/include/(C/C++ headers)share/$\rightarrow$prefix/share/(Man pages, completions, locale data)
Conflict Handling Logic: When a symlink target already exists:
- If the existing symlink points to the same keg (e.g., during a reinstall or upgrade), the existing link is overwritten.
- If the existing symlink points to a different keg, nanobrew will skip the link and print a warning:
nb: warning: <path> already linked by <other_package>, skipping.