diff options
author | joerg <joerg@pkgsrc.org> | 2009-05-30 19:18:01 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-05-30 19:18:01 +0000 |
commit | d3fb77c68c373739d962e40eacf66dea1616d044 (patch) | |
tree | af73705d681f82b3bd0fe48070bdd8ab3a1c07e6 /mk/wrapper | |
parent | 0418d3ee9c67fcf3d81a11d28719d72ccd7162c9 (diff) | |
download | pkgsrc-d3fb77c68c373739d962e40eacf66dea1616d044.tar.gz |
Avoid one fork per wrapper call if no cleanup is necessary and debugging
is disabled. In that case, the post processing is doing nothing anyway.
Diffstat (limited to 'mk/wrapper')
-rw-r--r-- | mk/wrapper/bsd.wrapper.mk | 3 | ||||
-rw-r--r-- | mk/wrapper/wrapper.sh | 13 |
2 files changed, 12 insertions, 4 deletions
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk index a73ab0a4a8a..185cdb8edd3 100644 --- a/mk/wrapper/bsd.wrapper.mk +++ b/mk/wrapper/bsd.wrapper.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.wrapper.mk,v 1.82 2008/12/29 20:47:17 joerg Exp $ +# $NetBSD: bsd.wrapper.mk,v 1.83 2009/05/30 19:18:01 joerg Exp $ # # Copyright (c) 2005 The NetBSD Foundation, Inc. # All rights reserved. @@ -400,6 +400,7 @@ _WRAP_SUBST_SED= \ .for _wrappee_ in ${_WRAPPEES} _WRAP_SUBST_SED.${_wrappee_}= \ + -e "s|@_WRAP_EMPTY_FILE@|${_WRAP_EMPTY_FILEQ}|g" \ -e "s|@_WRAP_ENV@|${_WRAP_ENV.${_wrappee_}:Q}|g" \ -e "s|@_WRAP_EXTRA_ARGS@|${_WRAP_EXTRA_ARGS.${_wrappee_}:Q}|g" \ -e "s|@_WRAP_ARG_PP@|${_WRAP_ARG_PP.${_wrappee_}:Q}|g" \ diff --git a/mk/wrapper/wrapper.sh b/mk/wrapper/wrapper.sh index b9c77d07f7d..36ecd14c6a7 100644 --- a/mk/wrapper/wrapper.sh +++ b/mk/wrapper/wrapper.sh @@ -1,6 +1,6 @@ #! @WRAPPER_SHELL@ # -# $NetBSD: wrapper.sh,v 1.20 2009/05/30 17:48:20 joerg Exp $ +# $NetBSD: wrapper.sh,v 1.21 2009/05/30 19:18:01 joerg Exp $ # # Copyright (c) 2004 The NetBSD Foundation, Inc. # All rights reserved. @@ -39,6 +39,7 @@ #set -eu # The list of include files for the wrapper. +empty_file="@_WRAP_EMPTY_FILE@" arg_pp="@_WRAP_ARG_PP@" arg_pp_main="@_WRAP_ARG_PP_MAIN@" arg_source="@_WRAP_ARG_SOURCE@" @@ -129,8 +130,14 @@ cmd="$cmd $libs" @_WRAP_ENV@ msg_log $wrapperlog "<.>" "$cmd" -wrapper_result=0 -eval "$cmd" || wrapper_result="$?" + +if [ "${empty_file}" = "${cleanup}" ] && [ "$debug" != "yes" ]; then + eval "exec $cmd" + wrapper_results=$? +else + wrapper_result=0 + eval "$cmd" || wrapper_result="$?" +fi . $cleanup |