On Thu, May 21, 2009 at 4:53 PM, Gene Amtower <[email protected]> wrote:
>
> In a related issue, my local RedHat environment has a system dependency on
> an older Python version, and I've had to edit critical Qooxdoo files with a
> custom Python version each time I've downloaded it in order to use the newer
> Python I installed specifically for Qooxdoo. Is there a way for the Qooxdoo
> toolchain to provide for a custom parameter for these Python references that
> will make this editing after download unnecessary. Specifically, at the
> start of critical Python scripts, I edit the "bang" entry to point to the
> non-system Python (#!/usr/bin/env python => #!/usr/bin/env python2.4), and
> several other places I have to change the Python command to my newer python
> as well (CMD_PYTHON = 'python' => CMD_PYTHON = 'python2.4'.
>
Gene, try this. As root (so you have access to /usr/local) create a shell
script in /usr/local/bin:
# cat > /usr/local/bin/python <<'EOF'
#!/bin/bash
if [ ${QOOXDOO} ]; then
exec /usr/bin/python2.4 $*
else
exec /usr/bin/python $*
fi
EOF
Make it executable:
# chmod 755 /usr/local/bin/python
Now, back as your normal user (not root), ensure that
/usr/local/bin/preceeds /usr/bin in your PATH:
% echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
If /usr/local/bin/ does not preceed /usr/bin, add an entry to your shell
start-up file. For sh or bash you can do that in ~/.profile by adding a line
like this:
PATH=/usr/local/bin:$PATH
Now whenver the python command is requested, it'll find
/usr/local/bin/python which checks whether the QOOXDOO environment variable
is set. If so, it'll replace itself (exec) with python2.4, passing any
parameters that were passed to /usr/local/bin/python. If the QOOXDOO
environment variable is not set, then the the script will replace itself
with the distribution's python command.
You can now run a qooxdoo build like this:
% QOOXDOO=true generate.py build
or if you want this entire login session henceforth (until you say
otherwise) to be a qooxdoo session, you can instead do:
% export QOOXDOO=true
which will export that into your environment so that any time you do:
% generate.py build
the QOOXDOO variable will be found to exist.
At some later time, if you want to disable qooxdoo's use of python, you can
do:
% unset QOOXDOO
QED. It takes way longer to explain it than to actually do it. :-)
Derrell
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel