Module Name:    src
Committed By:   hgutch
Date:           Sun Jun 16 00:03:53 UTC 2024

Modified Files:
        src/share/mk: bsd.info.mk

Log Message:
Unbreak generation of share/info/dir

install-info refuses to operate on 0 byte files.  When __infoinstall
is run the first time in a build, an empty ${INFODIRFILE} is created
via touch.  As install-info leaves this file untouched, we are left
with a 0 byte file at the end.  For subsequent __infostall runs the
only difference is that ${INFODIRFILE} already exists as a 0 byte
file, so no new one is created.

Fix by deleting ${INFODIRFILE} in the loop (with the lock held) if it
is a 0 byte file.  In this case also don't bother with calling
install-info -r.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/share/mk/bsd.info.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/mk/bsd.info.mk
diff -u src/share/mk/bsd.info.mk:1.43 src/share/mk/bsd.info.mk:1.44
--- src/share/mk/bsd.info.mk:1.43	Mon May  1 20:22:18 2023
+++ src/share/mk/bsd.info.mk	Sun Jun 16 00:03:52 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.info.mk,v 1.43 2023/05/01 20:22:18 christos Exp $
+#	$NetBSD: bsd.info.mk,v 1.44 2024/06/16 00:03:52 hgutch Exp $
 
 .include <bsd.init.mk>
 
@@ -45,6 +45,8 @@ __infoinstall: .USE
 	@[ -f ${INFODIRFILE} ] || touch ${INFODIRFILE}; 		\
 	while ! ln ${INFODIRFILE} ${INFODIRFILE}.lock 2> /dev/null;	\
 		do sleep 1; done;					\
+	[ $$(${TOOL_STAT} -qf '%z' ${INFODIRFILE}) -eq 0 ] && 		\
+	rm -f ${INFODIRFILE} || 					\
 	${TOOL_INSTALL_INFO} -d ${INFODIRFILE} -r ${.TARGET} 2> /dev/null; \
 	${TOOL_INSTALL_INFO} -d ${INFODIRFILE} ${.TARGET};		\
 	${TOOL_SORTINFO} < ${INFODIRFILE} > ${INFODIRFILE}.tmp;		\

Reply via email to