From 47492304246804cfa05c4d3f13d4de4c5126fd43 Mon Sep 17 00:00:00 2001 From: taca Date: Mon, 15 Sep 2008 08:40:55 +0000 Subject: Accept none existing directory in REPLACE_RUBY_DIRS. --- lang/ruby/replace.mk | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lang') diff --git a/lang/ruby/replace.mk b/lang/ruby/replace.mk index 2211fece1d6..94889c40bbe 100644 --- a/lang/ruby/replace.mk +++ b/lang/ruby/replace.mk @@ -1,4 +1,4 @@ -# $NetBSD: replace.mk,v 1.9 2008/03/17 20:57:04 jlam Exp $ +# $NetBSD: replace.mk,v 1.10 2008/09/15 08:40:55 taca Exp $ # .if !defined(_RUBY_REPLACE_MK) @@ -36,8 +36,15 @@ _REPLACE_RUBY_PAT+= -o -name "${f}" _REPLACE_RUBY_FIND_ARGS=\( ${_REPLACE_RUBY_PAT:S/-o//1} \) replace-ruby-dirs: - ${RUN} cd ${WRKSRC} && ${FIND} ${REPLACE_RUBY_DIRS} \ - -type f ${_REPLACE_RUBY_FIND_ARGS} -print | \ + ${RUN} cd ${WRKSRC} && \ + for d in ${REPLACE_RUBY_DIRS}; do \ + test -d $$d && dirs="$$dirs $$d"; \ + done; \ + if [ -z "$$dirs" ]; then \ + exit 0; \ + fi; \ + ${FIND} $$dirs \ + -type f ${_REPLACE_RUBY_FIND_ARGS} -print | \ while read f; do \ ${SED} -e '1s| *[a-z0-9_/\.-][a-z0-9_/\.-]*/env *||g' \ -e '1s| *[a-z0-9_/\.-]*ruby|${RUBY}|' $$f > $$f.tmp; \ -- cgit v1.2.3