diff options
Diffstat (limited to 'lang/ruby/replace.mk')
-rw-r--r-- | lang/ruby/replace.mk | 13 |
1 files changed, 10 insertions, 3 deletions
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; \ |