On 03/26 10:02, Stuart Henderson wrote:
> On 2013/03/26 13:48, Vadim Zhukov wrote:
> > 2013/3/26 Stuart Henderson <s...@spacehopper.org>:
> > > On 2013/03/26 13:35, Vadim Zhukov wrote:
> > >> This allows to fix more stuff, e.g.:
> > >>
> > >> #!/usr/bin/ruby => #!/usr/local/bin/ruby19
> > >>
> > >> Used to fix stuff in texlive_base.
> > >>
> > >> This needs to go through a full bulk build first. Landry? :)
> > >>
> > >>
> > >> Index: ruby.port.mk
> > >> ===================================================================
> > >> RCS file: /cvs/ports/lang/ruby/ruby.port.mk,v
> > >> retrieving revision 1.60
> > >> diff -u -p -r1.60 ruby.port.mk
> > >> --- ruby.port.mk      20 Mar 2013 19:13:50 -0000      1.60
> > >> +++ ruby.port.mk      26 Mar 2013 09:32:08 -0000
> > >> @@ -252,7 +252,8 @@ 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 's,/usr/bin/env ruby,${RUBY},;' \
> > >> +                              -e 's,/usr/bin/ruby([\s]+.*)?,${RUBY}\1,'
> > >>  MODRUBY_ADJ_FILES?=
> > >>  .if !empty(MODRUBY_ADJ_FILES)
> > >>  MODRUBY_ADJ_REPLACE= for pat in ${MODRUBY_ADJ_FILES:QL}; do \
> > >>
> > >
> > > Do we want to restrict this to the first lines in the file, like in 
> > > tcl.port.mk?
> > 
> > Well, MOD_ADJ_FILES is already different from other modules enough: it
> > accepts file name patterns searched through the whole WRKSRC instead
> > of just file names/patterns. But I don't want to fix that for now.
> > 
> > I'm doubt this will cost more speed: ruby files are usually small, and
> > I/O is slow itself. But I could not prove myself with numbers. Anyway,
> > this is how things are working now, so more changes should be done
> > separately...
> 
> 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). :)

I'm concerned about unexpected changes as well.  python.port.mk
restricts the change to the first line, and that is probably a wise
decision.  Maybe we should make ruby.port.mk more similar to
python.port.mk:

MODRUBY_RUBY_ADJ =        perl -pi \
                -e '$$. == 1 && s|^.*env ruby.*$$|\#!${RUBY}|;' \
                -e '$$. == 1 && s|^.*bin/ruby.*$$|\#!${RUBY}|;' \
                -e 'close ARGV if eof;'

I looked at tcl.port.mk, and they have something slightly more complex,
which does not change just the shebang lines, but also some exec calls
in the first 30 lines.  I don't think we want that for ruby.

> A bulk build won't detect whether this changes packages (and so requiring
> a REVISION bump).

Correct.  All ports that use MODRUBY_ADJ_FILES need to have their WRKSRC
scanned to see if this causes changes.  I can probably do that analysis
later today.

Thanks,
Jeremy

Reply via email to