From 6660f1d7c121dd4c3c5cf648d6660fc29a6450bd Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 3 Nov 2005 08:56:39 +0000 Subject: [PATCH] Serialize access to the info/dir file; needed for parallel installs. Reported by: scottl I'm not very fond of using the non-standard lockf(1) here, but I have no better idea at the moment. NetBSD uses ln(1) to create a lock file, but this approach can result in a deadlock if make is interrupted, leaving an orphaned lock file. --- Makefile.inc1 | 2 +- share/mk/bsd.info.mk | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 0c270e9639e2..f9980634115b 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -522,7 +522,7 @@ distributeworld installworld: installcheck mkdir -p ${INSTALLTMP} for prog in [ awk cap_mkdb cat chflags chmod chown \ date echo egrep find grep install-info \ - ln make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ + ln lockf make mkdir mtree mv pwd_mkdb rm sed sh sysctl \ test true uname wc zic; do \ cp `which $$prog` ${INSTALLTMP}; \ done diff --git a/share/mk/bsd.info.mk b/share/mk/bsd.info.mk index 717007d9c8f8..1de6cf7a1dd3 100644 --- a/share/mk/bsd.info.mk +++ b/share/mk/bsd.info.mk @@ -145,6 +145,7 @@ ${x:S/$/${ICOMPRESS_EXT}/}: ${x} .for x in ${INFO} INSTALLINFODIRS+= ${x:S/$/-install/} ${x:S/$/-install/}: + lockf -k ${DESTDIR}${INFODIR}/${INFODIRFILE} \ ${INSTALLINFO} ${INSTALLINFOFLAGS} \ --defsection=${INFOSECTION} \ --defentry=${INFOENTRY_${x}} \