Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Jan 2024 02:24:27 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 3d939d967ad4 - main - build: Use ls -i | cut rather than stat -f %i to extract inode
Message-ID:  <202401150224.40F2OR6f093484@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=3d939d967ad49f747b8b9db4fdec8086a7067582

commit 3d939d967ad49f747b8b9db4fdec8086a7067582
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2023-05-02 20:51:09 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2024-01-15 02:23:45 +0000

    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
---
 Makefile.inc1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 34b49ee319ec..8a0073547ed0 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202401150224.40F2OR6f093484>