----- Original Message -----
> > [...]
> > Perhaps we could generalise it into a pcp-env(1), which could expand the
> > $PCP_PYTHON_PROG from pcp.conf, for use in shebang lines like:
> > #!/usr/bin/pcp env $PCP_PYTHON_PROG
>
> Note that UNIX shebang lines only permit a single argument ("env"),
> so you'd need a combined front-end like /usr/bin/pcp-env or something.
Yep...
$ cat /usr/libexec/pcp/bin/pcp-python
#! /bin/sh
. $PCP_DIR/etc/pcp.env
exec $PCP_PYTHON_PROG $@
Works beautifully...
$ PCP_PYTHON_PROG=python2 /usr/bin/pcp python --version
Python 2.7.5
$ PCP_PYTHON_PROG=python3 /usr/bin/pcp python --version
Python 3.3.2
Simple verification on pcp-free(1) and friends suggests all is well
there; I'll do some automated QA and a man page shortly. And remove
those sed/find hacks over in fedora.spec.
A really neat and simple solution, Mark - good one, thanks!
> But thinking of it as a user option (something changeable within
> /etc/pcp.conf) is odd:
Not really, and pcp.conf is only one avenue of modifying it - its just
like using /usr/bin/env to allow environment-driven alternatives. And
its very handy - I wish I'd thought of this when porting everything to
python3, would've made life alot easier.
cheers.
--
Nathan
|