pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/51152 (pkg_alternatives via shebang won't continue and will use previous shell)
The following reply was made to PR pkg/51152; it has been noted by GNATS.
From: David Holland <dholland-pbugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: Julio Merino <jmmv%netbsd.org@localhost>
Subject: Re: pkg/51152 (pkg_alternatives via shebang won't continue and will
use previous shell)
Date: Tue, 5 Jul 2016 01:38:50 +0000
On Sun, Jul 03, 2016 at 02:41:13AM +0000, jmmv%NetBSD.org@localhost wrote:
> Yup... This was years ago, so if I had to guess as to why this problem
> exists, it's probably because I did not know that shell scripts could
> not act as full-blown interpreters back then.
>
> Rewritting the wrapper in C is a good answer and should be relatively
> straightforward; it's a pretty rudimentary program.
Unfortunately it looks like it needs to be recompiled on the fly
outside the pkgsrc compilation environment... that or the whole thing
needs to be restructured so there can be one binary wrapper compiled
in advance and a way to look up what's currently baked into the script
file at creation time.
That or do some kind of binary patching horror.
None of these are very appealing. :-/
(Or we could fix the kernel to allow nested interpreters, but that
doesn't help other pkgsrc platforms.)
any suggestions you might have would be welcome...
> The reason this is not simply a symlink is because the wrapper allows
> users (not just root) to customize their preferred alternatives via
> configuration files, and those are processed when the wrappers are
> invoked. (This is different to, say, Debian's alternatives system,
> which is only configurable by root system-wide and thus a symlink
> suffices. Now, whether what pkg_alternatives does is a good idea or
> not, I won't go into.)
Seems reasonable, actually.
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index