On 16 April 2015 at 20:58, Vincent Legoll <[email protected]> wrote: > On Thu, Apr 16, 2015 at 10:25 AM, Peter Maydell <[email protected]> > wrote: >> >> There's no guarantee that python 2 is an executable named >> "python". Commit e22723c8ee1 means the makefile always >> runs this file via "$(PYTHON) test.py", so do we need the >> #! line at all here? > > > I personally don't set PYTHON, so as-is I cannot use the makefile...
You don't need to, because the makefile sets PYTHON. (It's possible Makefile guesses wrongly; you could argue for making it make a more sophisticated guess, like "python2 unless there's no such executable in which case try plain python".) > I debated with myself adding: > > PYTHON ?= python2 > > to the makefile. That line is already in Makefile (and since commit e22723c we correctly pass it down and honour it in all the sub-makefiles). > But I did it the other way, which albeit not perfect, is an accepted > idiom, that is used in the top level stg script itself. > > Or maybe I misunderstood your comment, and you just prefer being > more specific, and would rather choose : > > #! /usr/bin/env python2 > > instead ? > > Please explain what is the problem with adding the shebang. You can't have a #! line which works both on: (a) systems where python 2 is "python2" (b) systems where python 2 is "python" So you have to let the makefile invoke python via $(PYTHON) (which it guesses at a setting for), so that the user can override it if necessary. And given that the makefile has to do this, there's no point in also having the #! line (especially one which picks a different default executable to the one Makefile does). -- PMM _______________________________________________ stgit-users mailing list [email protected] https://mail.gna.org/listinfo/stgit-users
