summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjperkin <jperkin>2014-09-02 14:31:27 +0000
committerjperkin <jperkin>2014-09-02 14:31:27 +0000
commitff316332e2478de7e36ab8c2b7b7a9159e104d65 (patch)
treec68dcad4d5483f574e991e6f6b0cf83b21faed6f /mk
parentd7371ef0e292e1e9e84b9028c8ec889577bf1265 (diff)
downloadpkgsrc-ff316332e2478de7e36ab8c2b7b7a9159e104d65.tar.gz
Check for the existence of a file before trying to remove it. It is highly
likely that the files in this code path do not exist, so this can save a significant number of exec's, especially for packages with a large number of dependencies, with a corresponding reduction in the run time for the 'wrapper' phase. In addition, remove a 'useless use of cat' instance to save more exec's.
Diffstat (limited to 'mk')
-rw-r--r--mk/buildlink3/bsd.buildlink3.mk13
1 files changed, 7 insertions, 6 deletions
diff --git a/mk/buildlink3/bsd.buildlink3.mk b/mk/buildlink3/bsd.buildlink3.mk
index 6ab3d0d1db8..f3df59f37d4 100644
--- a/mk/buildlink3/bsd.buildlink3.mk
+++ b/mk/buildlink3/bsd.buildlink3.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.buildlink3.mk,v 1.226 2014/05/18 11:23:26 obache Exp $
+# $NetBSD: bsd.buildlink3.mk,v 1.227 2014/09/02 14:31:27 jperkin Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -706,15 +706,16 @@ ${_BLNK_COOKIE.${_pkg_}}:
msg="$$src -> $$dest"; \
fi; \
dir=`${DIRNAME} "$$dest"`; \
- if [ ! -d "$$dir" ]; then \
- ${MKDIR} "$$dir"; \
+ if [ ! -d "$$dir" ]; then \
+ ${MKDIR} "$$dir"; \
+ fi; \
+ if [ -e "$$dest" ]; then \
+ ${RM} -f "$$dest"; \
fi; \
- ${RM} -f "$$dest"; \
case "$$src" in \
*.la) \
- ${CAT} "$$src" | \
${_BLNK_LT_ARCHIVE_FILTER.${_pkg_}} \
- > "$$dest"; \
+ "$$src" > "$$dest"; \
msg="$$msg (created)"; \
;; \
*) \