Change MODRUBY_RUBY_ADJ to just replace a shebang in the first line

of the files, instead of all lines.  Additionally, loosen the regexp
slightly so that it handles more cases automatically.  This makes
ruby.port.mk's behavior similar to python.port.mk.

OK sthen@
This commit is contained in:
jeremy 2013-03-26 18:51:44 +00:00
parent a6cd68b35e
commit 43a6ba7492

View File

@ -1,4 +1,4 @@
# $OpenBSD: ruby.port.mk,v 1.60 2013/03/20 19:13:50 jeremy Exp $
# $OpenBSD: ruby.port.mk,v 1.61 2013/03/26 18:51:44 jeremy Exp $
# ruby module
@ -252,7 +252,10 @@ TEST_DEPENDS+= ${MODRUBY_RSPEC_DEPENDS}
TEST_DEPENDS+= ${MODRUBY_RSPEC2_DEPENDS}
.endif
MODRUBY_RUBY_ADJ= perl -pi -e 's,/usr/bin/env ruby,${RUBY},'
MODRUBY_RUBY_ADJ = perl -pi \
-e '$$. == 1 && s|^.*env ruby.*$$|\#!${RUBY}|;' \
-e '$$. == 1 && s|^.*bin/ruby.*$$|\#!${RUBY}|;' \
-e 'close ARGV if eof;'
MODRUBY_ADJ_FILES?=
.if !empty(MODRUBY_ADJ_FILES)
MODRUBY_ADJ_REPLACE= for pat in ${MODRUBY_ADJ_FILES:QL}; do \