On Tue, May 30, 2006 at 07:15:36PM +0530, Madan U Sreenivasan wrote:
> On Tue, 30 May 2006 16:34:05 +0530, Malcolm Rowe
> <malcolm-svn-dev@farside.org.uk> wrote:
>
> >On Tue, May 30, 2006 at 04:12:32PM +0530, Madan U Sreenivasan wrote:
> >> Pl. find a patch that adds the shebang line (#!/usr/bin/env python)
> >>to
> >>build/run_tests.py. As a consequence, the svn:executable property had to
> >>be added to build/run_tests.py and the Makefile.in modified to run
> >>run_tests.py directly (instead of 'python run_tests.py').
> >>
> >
> >Why is this a good idea?
By that way, that was an honest question - I'd no idea why we'd want to
make this change. In general, it's almost always a good idea to include
a sentence that explains the problem you're trying to fix, possibly just
by referencing a previous post or an issue.
> Because it is easier to invoke run_tests.py.
Is there any reason to invoke run_tests.py manually in normal use?
It's almost always invoked via 'make check', isn't it? (Also, see below:
I suspect there's a reason that we do this).
> Also the test scripts in
> subversion/tests/cmdline use the shebang line. This change would make
> runnable python scripts more uniform.
>
(In contrast, there _is_ a reason to run the individual tests directly,
because it's a lot easier when testing a fix to just run the test that's
failing and see the results on stdout.)
> OTOH, I was wondering if there is any specific reason we have a python
> script without the shebang line.
>
I suspect the reason is that we don't want to have to hardcode a path to
the python executable, or even assume that 'python' gives us a suitable
interpreter. If you look at build/find_python.sh, you'll see that it
searches available versions of python to find a suitable one.
Another reason would be speed (running via a shebang line is slightly
slower, since bash needs to read it in order to find the interpreter).
That's not the case here, since the script is only run very occasionally.
Regards,
Malcolm
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 30 15:51:48 2006