svn commit: r462462 - head/Mk

Bryan Drewery bdrewery at FreeBSD.org
Tue Feb 20 22:45:25 UTC 2018


Author: bdrewery
Date: Tue Feb 20 22:45:24 2018
New Revision: 462462
URL: https://svnweb.freebsd.org/changeset/ports/462462

Log:
  Reduce fstat(2) calls for SCRIPTDIR/* scripts.
  
  There's only about 10 ports that actually use this, so rather than
  spamming a dozen fstat(2) calls for every port during INDEX reduce
  it to 1 for now.
  
  Also avoid the fstat(2) if the target already exists.
  
  Approved by:	portmgr (implicit)

Modified:
  head/Mk/bsd.port.mk

Modified: head/Mk/bsd.port.mk
==============================================================================
--- head/Mk/bsd.port.mk	Tue Feb 20 22:43:53 2018	(r462461)
+++ head/Mk/bsd.port.mk	Tue Feb 20 22:45:24 2018	(r462462)
@@ -3642,11 +3642,12 @@ package-message:
 
 # Empty pre-* and post-* targets
 
+.if exists(${SCRIPTDIR})
 .for stage in pre post
 .for name in pkg check-sanity fetch extract patch configure build stage install package
 
-.if exists(${SCRIPTDIR}/${stage}-${name})
 .if !target(${stage}-${name}-script)
+.if exists(${SCRIPTDIR}/${stage}-${name})
 ${stage}-${name}-script:
 	@ cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} \
 			${SCRIPTDIR}/${.TARGET:S/-script$//}
@@ -3655,6 +3656,7 @@ ${stage}-${name}-script:
 
 .endfor
 .endfor
+.endif
 
 .if !target(pretty-print-www-site)
 pretty-print-www-site:


More information about the svn-ports-head mailing list