build: Use ls -i | cut rather than stat -f %i to extract inode

ls -i dates back to 5th edition Unix and is more portable than the stat
command, though %% is a newer shellism, it works on any shell that
FreeBSD builds with.

Sponsored by:		Netflix
This commit is contained in:
Warner Losh 2023-05-02 14:51:09 -06:00
parent 53df7e58cc
commit 3d939d967a

View file

@ -1059,8 +1059,8 @@ _cleanworldtmp: .PHONY
.if ${USING_SYSTEM_COMPILER} == "yes"
.for cc in cc c++
if [ -x ${WORLDTMP}/usr/bin/${cc} ]; then \
inum=$$(stat -f %i ${WORLDTMP}/usr/bin/${cc}); \
find ${WORLDTMP}/usr/bin -inum $${inum} -delete; \
inum=$$(ls -i ${WORLDTMP}/usr/bin/${cc}); \
find ${WORLDTMP}/usr/bin -inum $${inum%% *} -delete; \
fi
.endfor
.endif # ${USING_SYSTEM_COMPILER} == "yes"