Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Feb 2018 22:45:24 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r462462 - head/Mk
Message-ID:  <201802202245.w1KMjOLE024575@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:



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