summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-11-26 14:42:17 +0000
committerrillig <rillig@pkgsrc.org>2006-11-26 14:42:17 +0000
commit3e272019b6dba46b296d6cda65aa592add3e3832 (patch)
treef4cf5312d9e6833d8124ff02a5e81c70746821f7
parent8bdb855ab42abdfc99cf14767bc26b451b27c2f5 (diff)
downloadpkgsrc-3e272019b6dba46b296d6cda65aa592add3e3832.tar.gz
Removed the separate files for the cache header and footer. This makes
the code a lot more readable.
-rw-r--r--mk/wrapper/bsd.wrapper.mk32
-rw-r--r--mk/wrapper/cache-footer38
-rw-r--r--mk/wrapper/cache-header37
-rw-r--r--mk/wrapper/logic10
-rw-r--r--mk/wrapper/wrapper.sh4
5 files changed, 11 insertions, 110 deletions
diff --git a/mk/wrapper/bsd.wrapper.mk b/mk/wrapper/bsd.wrapper.mk
index 2bd028f115d..6956597ed73 100644
--- a/mk/wrapper/bsd.wrapper.mk
+++ b/mk/wrapper/bsd.wrapper.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.wrapper.mk,v 1.59 2006/11/26 13:02:53 rillig Exp $
+# $NetBSD: bsd.wrapper.mk,v 1.60 2006/11/26 14:42:17 rillig Exp $
#
# Copyright (c) 2005 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -172,9 +172,7 @@ _WRAP_ARG_PP_MAIN?= ${WRAPPER_TMPDIR}/arg-pp-main
_WRAP_ARG_SOURCE?= ${WRAPPER_TMPDIR}/arg-source
_WRAP_BUILDCMD?= ${WRAPPER_TMPDIR}/buildcmd
_WRAP_CACHE?= ${WRAPPER_TMPDIR}/cache
-_WRAP_CACHE_HEADER?= ${WRAPPER_TMPDIR}/cache-header
_WRAP_CACHE_BODY?= ${WRAPPER_TMPDIR}/cache-body
-_WRAP_CACHE_FOOTER?= ${WRAPPER_TMPDIR}/cache-footer
_WRAP_CLEANUP?= ${_WRAP_EMPTY_FILE}
_WRAP_CMD_SINK?= ${WRAPPER_TMPDIR}/cmd-sink
_WRAP_GEN_REORDER?= ${WRAPPER_TMPDIR}/gen-reorder
@@ -207,9 +205,7 @@ _WRAP_ARG_PP_MAIN.${_wrappee_}?= ${_WRAP_ARG_PP_MAIN}
_WRAP_ARG_SOURCE.${_wrappee_}?= ${_WRAP_ARG_SOURCE}
_WRAP_BUILDCMD.${_wrappee_}?= ${_WRAP_BUILDCMD}
_WRAP_CACHE.${_wrappee_}?= ${_WRAP_CACHE}
-_WRAP_CACHE_HEADER.${_wrappee_}?= ${_WRAP_CACHE_HEADER}
_WRAP_CACHE_BODY.${_wrappee_}?= ${_WRAP_CACHE_BODY}
-_WRAP_CACHE_FOOTER.${_wrappee_}?= ${_WRAP_CACHE_FOOTER}
_WRAP_CLEANUP.${_wrappee_}?= ${_WRAP_CLEANUP}
_WRAP_CMD_SINK.${_wrappee_}?= ${_WRAP_CMD_SINK}
_WRAP_LOG.${_wrappee_}?= ${_WRAP_LOG}
@@ -363,9 +359,7 @@ _WRAP_SUBST_SED.${_wrappee_}= \
-e "s|@_WRAP_ARG_SOURCE@|${_WRAP_ARG_SOURCE.${_wrappee_}:Q}|g" \
-e "s|@_WRAP_BUILDCMD@|${_WRAP_BUILDCMD.${_wrappee_}:Q}|g" \
-e "s|@_WRAP_CACHE@|${_WRAP_CACHE.${_wrappee_}:Q}|g" \
- -e "s|@_WRAP_CACHE_HEADER@|${_WRAP_CACHE_HEADER.${_wrappee_}:Q}|g" \
-e "s|@_WRAP_CACHE_BODY@|${_WRAP_CACHE_BODY.${_wrappee_}:Q}|g" \
- -e "s|@_WRAP_CACHE_FOOTER@|${_WRAP_CACHE_FOOTER.${_wrappee_}:Q}|g" \
-e "s|@_WRAP_CLEANUP@|${_WRAP_CLEANUP.${_wrappee_}:Q}|g" \
-e "s|@_WRAP_CMD_SINK@|${_WRAP_CMD_SINK.${_wrappee_}:Q}|g" \
-e "s|@_WRAP_LOG@|${_WRAP_LOG.${_wrappee_}:Q}|g" \
@@ -576,20 +570,9 @@ ${_WRAP_BUILDCMD.${_wrappee_}}: ${WRAPPER_SRCDIR}/buildcmd
. endif
. if !target(${_WRAP_CACHE.${_wrappee_}})
-${_WRAP_CACHE.${_wrappee_}}: \
- ${_WRAP_CACHE_HEADER.${_wrappee_}} \
- ${_WRAP_CACHE_BODY.${_wrappee_}} \
- ${_WRAP_CACHE_FOOTER.${_wrappee_}}
- ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
- ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
- | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
-. endif
-
-. if !target(${_WRAP_CACHE_HEADER.${_wrappee_}})
-${_WRAP_CACHE_HEADER.${_wrappee_}}: ${WRAPPER_SRCDIR}/cache-header
- ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
- ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
- | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
+${_WRAP_CACHE.${_wrappee_}}:
+ ${RUN} mkdir ${.TARGET:H}
+ ${RUN} echo "cachehit=no" > ${.TARGET}
. endif
. if !target(${_WRAP_CACHE_BODY.${_wrappee_}})
@@ -598,13 +581,6 @@ ${_WRAP_CACHE_BODY.${_wrappee_}}:
${_PKG_SILENT}${_PKG_DEBUG}${TOUCH} ${TOUCH_ARGS} ${.TARGET}
. endif
-. if !target(${_WRAP_CACHE_FOOTER.${_wrappee_}})
-${_WRAP_CACHE_FOOTER.${_wrappee_}}: ${WRAPPER_SRCDIR}/cache-footer
- ${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
- ${_PKG_SILENT}${_PKG_DEBUG}${CAT} ${.ALLSRC} \
- | ${_WRAP_SH_CRUNCH_FILTER} > ${.TARGET}
-. endif
-
. if !target(${_WRAP_CMD_SINK.${_wrappee_}})
${_WRAP_CMD_SINK.${_wrappee_}}: ${WRAPPER_SRCDIR}/cmd-sink
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
diff --git a/mk/wrapper/cache-footer b/mk/wrapper/cache-footer
deleted file mode 100644
index 4af7e981975..00000000000
--- a/mk/wrapper/cache-footer
+++ /dev/null
@@ -1,38 +0,0 @@
-# $NetBSD: cache-footer,v 1.1 2004/09/21 15:01:41 jlam Exp $
-#
-# Copyright (c) 2004 The NetBSD Foundation, Inc.
-# All rights reserved.
-#
-# This code is derived from software contributed to The NetBSD Foundation
-# by Johnny C. Lam.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the NetBSD
-# Foundation, Inc. and its contributors.
-# 4. Neither the name of The NetBSD Foundation nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-*) cachehit=no ;;
-esac
diff --git a/mk/wrapper/cache-header b/mk/wrapper/cache-header
deleted file mode 100644
index fa4200e56b0..00000000000
--- a/mk/wrapper/cache-header
+++ /dev/null
@@ -1,37 +0,0 @@
-# $NetBSD: cache-header,v 1.1 2004/09/21 15:01:41 jlam Exp $
-#
-# Copyright (c) 2004 The NetBSD Foundation, Inc.
-# All rights reserved.
-#
-# This code is derived from software contributed to The NetBSD Foundation
-# by Johnny C. Lam.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the NetBSD
-# Foundation, Inc. and its contributors.
-# 4. Neither the name of The NetBSD Foundation nor the names of its
-# contributors may be used to endorse or promote products derived
-# from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
-# ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
-# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-case $arg in
diff --git a/mk/wrapper/logic b/mk/wrapper/logic
index c70f5f4c5c0..c7783de0a4d 100644
--- a/mk/wrapper/logic
+++ b/mk/wrapper/logic
@@ -1,4 +1,4 @@
-# $NetBSD: logic,v 1.12 2006/10/21 11:42:25 rillig Exp $
+# $NetBSD: logic,v 1.13 2006/11/26 14:42:17 rillig Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -135,9 +135,11 @@ while ! queue_is_empty argbuf; do
$cat >> $cache_body << EOF
$cachearg) arg=$cachedarg; split_arg=$split_arg; cachehit=yes ;;
EOF
- $cat $cache_header \
- $cache_body \
- $cache_footer > $cache-$$.tmp
+ { echo "case \$arg in"
+ $cat $cache_body
+ echo "*) cachehit=no ;;"
+ echo "esac"
+ } > $cache-$$.tmp
$mv -f $cache-$$.tmp $cache
;;
esac
diff --git a/mk/wrapper/wrapper.sh b/mk/wrapper/wrapper.sh
index 7fc80804b73..86f475a7fcb 100644
--- a/mk/wrapper/wrapper.sh
+++ b/mk/wrapper/wrapper.sh
@@ -1,6 +1,6 @@
#! @WRAPPER_SHELL@
#
-# $NetBSD: wrapper.sh,v 1.8 2006/11/26 08:42:42 rillig Exp $
+# $NetBSD: wrapper.sh,v 1.9 2006/11/26 14:42:17 rillig Exp $
#
# Copyright (c) 2004 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -43,9 +43,7 @@ arg_pp_main="@_WRAP_ARG_PP_MAIN@"
arg_source="@_WRAP_ARG_SOURCE@"
buildcmd="@_WRAP_BUILDCMD@"
cache="@_WRAP_CACHE@"
-cache_header="@_WRAP_CACHE_HEADER@"
cache_body="@_WRAP_CACHE_BODY@"
-cache_footer="@_WRAP_CACHE_FOOTER@"
cleanup="@_WRAP_CLEANUP@"
cmd_sink="@_WRAP_CMD_SINK@"
logic="@_WRAP_LOGIC@"