Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 May 2013 17:04:48 -0400
From:      Garance A Drosehn <gad@FreeBSD.org>
To:        Baptiste Daroussin <bapt@FreeBSD.org>
Cc:        ports@FreeBSD.org
Subject:   Re: [BRAINSTORM] shebang fixing framework
Message-ID:  <5182D4F0.9080508@FreeBSD.org>
In-Reply-To: <20130430103821.GJ3577@ithaqua.etoilebsd.net>
References:  <20130430103821.GJ3577@ithaqua.etoilebsd.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/30/13 6:38 AM, Baptiste Daroussin wrote:
> Hi all,
>
> For a while now: http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/51152 we are
> looking for a framework/helpers to help patching scripts shebang so that they
> fit where the interpreters is on FreeBSD.
>
> We also want to get rid of /usr/bin/perl
> http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/170219 and such helpers would
> help

Many years ago we (at RPI) went with a different tactic for this.
We wrote intercept programs which we installed for interpreter
files such as /usr/bin/perl.  The program was a short C program
which knew how to search for the real interpreter, and would
exec that interpreter once it was found.  These intercept routines
included support for multiple versions of a given interpreter,
such that users could select which version of (say) perl that
they wanted to use.

The exact code that we used for this would need to be rewritten
for general freebsd use, because it depended on a lot of other
special "session/setup" code that we also implemented.  But I
think FreeBSD could do something along the same lines, and then
you wouldn't have to fix any references to /usr/bin/perl.

I suspect I have written some rough ideas of this on some FreeBSD
mailing list in the past, but offhand I don't remember where or
when.  It could have been a long time ago, because we've been
using this tactic on our solaris/aix/irix machines at RPI for at
least 15 years now.  (however our systems-programmer group has
been cut back so much that we haven't done any new work on it for
at least eight years)

-- 
Garance Alistair Drosehn            =   gad@gilead.netel.rpi.edu
Senior Systems Programmer           or  gad@freebsd.org
Rensselaer Polytechnic Institute    or  drosih@rpi.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5182D4F0.9080508>