Tue Dec 23 22:34:26 2008 UTC ()
Use a temporary variable to hold ${_dep_:C/\:.*$//} since it is used
as a modifier on another variable and would need to be escaped
as :M${_dep_\:C/\\\:.*$//} in order for the modifiers to be parsed correctly.
This all used to work because _dep_ is a .for loop control variable which
was substituted in an earlier pass through the line.
Recent changes leave .for loop control variables to be substituted during
normal expansion.
Adding the \ would leave the script non-working with theolder make.

OK'd by Beefy


(dsl)
diff -r1.216 -r1.217 pkgsrc/mk/tools/replace.mk

cvs diff -r1.216 -r1.217 pkgsrc/mk/tools/replace.mk (expand / switch to unified diff)

--- pkgsrc/mk/tools/replace.mk 2008/12/15 12:53:28 1.216
+++ pkgsrc/mk/tools/replace.mk 2008/12/23 22:34:26 1.217
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: replace.mk,v 1.216 2008/12/15 12:53:28 rillig Exp $ 1# $NetBSD: replace.mk,v 1.217 2008/12/23 22:34:26 dsl Exp $
2# 2#
3# Copyright (c) 2005 The NetBSD Foundation, Inc. 3# Copyright (c) 2005 The NetBSD Foundation, Inc.
4# All rights reserved. 4# All rights reserved.
5# 5#
6# This code is derived from software contributed to The NetBSD Foundation 6# This code is derived from software contributed to The NetBSD Foundation
7# by Johnny C. Lam. 7# by Johnny C. Lam.
8# 8#
9# Redistribution and use in source and binary forms, with or without 9# Redistribution and use in source and binary forms, with or without
10# modification, are permitted provided that the following conditions 10# modification, are permitted provided that the following conditions
11# are met: 11# are met:
12# 1. Redistributions of source code must retain the above copyright 12# 1. Redistributions of source code must retain the above copyright
13# notice, this list of conditions and the following disclaimer. 13# notice, this list of conditions and the following disclaimer.
14# 2. Redistributions in binary form must reproduce the above copyright 14# 2. Redistributions in binary form must reproduce the above copyright
@@ -1239,27 +1239,28 @@ TOOLS_PATH.xmkmf= ${TOOLS_PREFIX.xpkgwed @@ -1239,27 +1239,28 @@ TOOLS_PATH.xmkmf= ${TOOLS_PREFIX.xpkgwed
1239FIND_PREFIX:= ${TOOLS_FIND_PREFIX} 1239FIND_PREFIX:= ${TOOLS_FIND_PREFIX}
1240.include "../find-prefix.mk" 1240.include "../find-prefix.mk"
1241 1241
1242###################################################################### 1242######################################################################
1243 1243
1244.for _t_ in ${_USE_TOOLS} 1244.for _t_ in ${_USE_TOOLS}
1245. if !empty(_TOOLS_USE_PKGSRC.${_t_}:M[yY][eE][sS]) && \ 1245. if !empty(_TOOLS_USE_PKGSRC.${_t_}:M[yY][eE][sS]) && \
1246 !defined(TOOLS_IGNORE.${_t_}) 1246 !defined(TOOLS_IGNORE.${_t_})
1247##### 1247#####
1248##### Add the dependencies for each pkgsrc-supplied tool. 1248##### Add the dependencies for each pkgsrc-supplied tool.
1249##### 1249#####
1250. if defined(_TOOLS_DEPMETHOD.${_t_}) && defined(TOOLS_DEPENDS.${_t_}) 1250. if defined(_TOOLS_DEPMETHOD.${_t_}) && defined(TOOLS_DEPENDS.${_t_})
1251. for _dep_ in ${TOOLS_DEPENDS.${_t_}} 1251. for _dep_ in ${TOOLS_DEPENDS.${_t_}}
1252. if empty(${_TOOLS_DEPMETHOD.${_t_}}:C/\:.*$//:M${_dep_:C/\:.*$//}) 1252_dep_test := ${_dep_:C/\:.*$//}
 1253. if empty(${_TOOLS_DEPMETHOD.${_t_}}:C/\:.*$//:M${_dep_test})
1253${_TOOLS_DEPMETHOD.${_t_}}+= ${_dep_} 1254${_TOOLS_DEPMETHOD.${_t_}}+= ${_dep_}
1254. endif 1255. endif
1255. endfor 1256. endfor
1256. endif 1257. endif
1257. elif defined(TOOLS_PLATFORM.${_t_}) && !empty(TOOLS_PLATFORM.${_t_}) 1258. elif defined(TOOLS_PLATFORM.${_t_}) && !empty(TOOLS_PLATFORM.${_t_})
1258##### 1259#####
1259##### For each system-supplied tool, break the tool down into a path 1260##### For each system-supplied tool, break the tool down into a path
1260##### and arguments so that either a symlink or a wrapper will be 1261##### and arguments so that either a symlink or a wrapper will be
1261##### properly created. 1262##### properly created.
1262##### 1263#####
1263TOOLS_CREATE+= ${_t_} 1264TOOLS_CREATE+= ${_t_}
1264TOOLS_PATH.${_t_}?= \ 1265TOOLS_PATH.${_t_}?= \
1265 ${TOOLS_PLATFORM.${_t_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//} 1266 ${TOOLS_PLATFORM.${_t_}:C/^/_asdf_/1:M_asdf_*:S/^_asdf_//}