diff options
author | jperkin <jperkin@pkgsrc.org> | 2014-09-02 14:31:27 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2014-09-02 14:31:27 +0000 |
commit | 4b78e6a3b19b8a34f1aee389a51d7f053752d6a6 (patch) | |
tree | c68dcad4d5483f574e991e6f6b0cf83b21faed6f /mk | |
parent | e89ba6e6a5ca6bd597e10bc1d309ca163ce85434 (diff) | |
download | pkgsrc-4b78e6a3b19b8a34f1aee389a51d7f053752d6a6.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.mk | 13 |
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)"; \ ;; \ *) \ |