share/mk: Don't install only differing in case files on case insensitive fs

MacOS has case insensitive filesystems by default. So trying to link
between foo.X and FOO.X causes an error of some sort since we unlink the
old foo file destroying the newly installed foo due to the insensitive
nature of the FS. Assume that this is true on darwin/macos, though it is
only try by default there.

Perhaps install should grow smarts to know when this is the case, though
that looked much trickier. There didn't seem to be a flag to check. This
would be better, imho, since we could still write the METALOG data
correctly (images created from these metalogs are imperfect due to this
relatively issue...).

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D44347
This commit is contained in:
Warner Losh 2024-03-14 22:33:33 -06:00
parent a00f9e4e81
commit d2a824c29d
2 changed files with 9 additions and 0 deletions

View File

@ -14,16 +14,22 @@ afterinstall: _installlinks
.ORDER: realinstall _installlinks
_installlinks:
.for s t in ${LINKS}
# On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x.
.if ${.MAKE.OS} != "Darwin" || ${s:tu} != ${t:tu}
.if defined(LINKTAGS)
${INSTALL_LINK} ${TAG_ARGS:D${TAG_ARGS},${LINKTAGS}} ${DESTDIR}${s} ${DESTDIR}${t}
.else
${INSTALL_LINK} ${TAG_ARGS} ${DESTDIR}${s} ${DESTDIR}${t}
.endif
.endif
.endfor
.for s t in ${SYMLINKS}
# On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x.
.if ${.MAKE.OS} != "Darwin" || ${s:tu} != ${t:tu}
.if defined(LINKTAGS)
${INSTALL_SYMLINK} ${TAG_ARGS:D${TAG_ARGS},${LINKTAGS}} ${s} ${DESTDIR}${t}
.else
${INSTALL_SYMLINK} ${TAG_ARGS} ${s} ${DESTDIR}${t}
.endif
.endif
.endfor

View File

@ -234,6 +234,8 @@ maninstall: ${MAN}
.endif # ${MK_MANCOMPRESS} == "no"
.endif
.for l t in ${_MANLINKS}
# On MacOS, assume case folding FS, and don't install links from foo.x to FOO.x.
.if ${.MAKE.OS} != "Darwin" || ${l:tu} != ${t:tu}
.if ${MK_MANSPLITPKG} == "no"
rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \
${INSTALL_MANLINK} ${TAG_ARGS} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
@ -241,6 +243,7 @@ maninstall: ${MAN}
rm -f ${DESTDIR}${t} ${DESTDIR}${t}${MCOMPRESS_EXT}; \
${INSTALL_MANLINK} ${TAG_ARGS:D${TAG_ARGS},man} ${DESTDIR}${l}${ZEXT} ${DESTDIR}${t}${ZEXT}
.endif
.endif
.endfor
manlint: