aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2018-02-21 06:45:24 +0800
committerbdrewery <bdrewery@FreeBSD.org>2018-02-21 06:45:24 +0800
commit6d7e931ff77174b70ef2717d2d2acc1ec41aaeb7 (patch)
treedce52373fec340e5a8d4815865e22640ffbe5985 /Mk
parentefbdede7056fcf3833380b9c361d694575a5da2c (diff)
downloadfreebsd-ports-gnome-6d7e931ff77174b70ef2717d2d2acc1ec41aaeb7.tar.gz
freebsd-ports-gnome-6d7e931ff77174b70ef2717d2d2acc1ec41aaeb7.tar.zst
freebsd-ports-gnome-6d7e931ff77174b70ef2717d2d2acc1ec41aaeb7.zip
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)
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk4
1 files changed, 3 insertions, 1 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 68e32103478b..de02b50fc18a 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -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: