[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] add shebang line to build/run_tests.py

From: Max Bowsher <maxb1_at_ukf.net>
Date: 2006-05-30 17:14:19 CEST

Madan U Sreenivasan wrote:
> On Tue, 30 May 2006 19:20:48 +0530, Malcolm Rowe
> <malcolm-svn-dev@farside.org.uk> wrote:
>> 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.
> I understand and agree. Thanks for the suggestion. :)
> [snip]
>>> 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.
> BINGO! you are correct. I stand corrected....
> Makefile's $(PYTHON) variable holds the path of a python (>2.0)
> interpreter like you said.
> In addition, even run_tests.py internally invokes the individual python
> tests using the path to the above python interpreter.

Despite the point of concern listed above, I've made run_tests.py
executable - since the individual test scripts themselves are
executable, we aren't consistently leaving the tests
not-directly-executable, so I didn't think we should in this isolated case.


Received on Tue May 30 17:15:15 2006

This is an archived mail posted to the Subversion Dev mailing list.