On 03/26 05:01, Stuart Henderson wrote:
> On 2013/03/26 09:21, Jeremy Evans wrote:
> > On 03/26 10:02, Stuart Henderson wrote:
> > > My thought is not so much about speed, it's about patching unexpected
> > > instances of the text. I do wonder why it isn't restricted to #! lines too
> > > actually.
> >
> > FWIW, sthen, you did OK it when it went in (ruby.port.mk r1.28). :)
>
> The difference is that r1.28 is when this was first added, so there
> are no surprises, if you pass a file through MODRUBY_RUBY_ADJ you know
> what you're getting and can test it during porting - whereas changing
> the behaviour of an existing fragment needs more attention ;)
My point was more related to your second sentence then your first. :)
In any case, here's a diff that makes ruby.port.mk similar to
python.port.mk. Only fallout is gonzui, and the only change there is
that whitespace is removed from the shebangs:
--- /usr/obj/ports/old/gonzui-1.2/gonzui-1.2/gonzui-import Tue Mar 26
09:51:22 2013
+++ /usr/obj/ports/new/gonzui-1.2/gonzui-1.2/gonzui-import Tue Mar 26
09:45:37 2013
@@ -1,4 +1,4 @@
-#! /usr/local/bin/ruby18
+#!/usr/local/bin/ruby18
#
# gonzui-import - a tool to import contents from a gonzui DB
#
So this diff also bumps the gonzui REVISION (will commit separately).
OKs?
Jeremy
Index: lang/ruby/ruby.port.mk
===================================================================
RCS file: /cvs/ports/lang/ruby/ruby.port.mk,v
retrieving revision 1.59
diff -u -p -r1.59 ruby.port.mk
--- lang/ruby/ruby.port.mk 19 Mar 2013 23:46:41 -0000 1.59
+++ lang/ruby/ruby.port.mk 26 Mar 2013 17:27:45 -0000
@@ -255,7 +255,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 \
Index: textproc/gonzui/Makefile
===================================================================
RCS file: /cvs/ports/textproc/gonzui/Makefile,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile
--- textproc/gonzui/Makefile 20 Mar 2013 19:13:50 -0000 1.31
+++ textproc/gonzui/Makefile 26 Mar 2013 17:27:45 -0000
@@ -7,7 +7,7 @@ NOT_FOR_ARCHS= mips64 mips64el
COMMENT= source code search engine
DISTNAME= gonzui-1.2
-REVISION= 22
+REVISION= 23
CATEGORIES= textproc www
HOMEPAGE= http://gonzui.sourceforge.net/