git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Correct references to /usr/bin/python which may not exist on certain systems

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 21, 2010, 01:37 UTC
Message-ID
<7vaau278vf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100320235105.GA30457@kiwi.sharlinx.com>
"R. Tyler Ballance" <tyler@monkeypox.org> writes:
Show 14 quoted lines
> FreeBSD for example does not ship with a /usr/bin/python such that Python
> installed from ports will be located by default in /usr/local/bin
> ---
> diff --git a/Makefile b/Makefile
> index 3a6c6ea..2b248b4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -444,7 +444,7 @@ ifndef PERL_PATH
>  	PERL_PATH = /usr/bin/perl
>  endif
>  ifndef PYTHON_PATH
> -	PYTHON_PATH = /usr/bin/python
> +	PYTHON_PATH = /usr/bin/env python
>  endif

This wouldn't work very well, as XYZ_PATH is expected to point at full path to the executable. You should be able to say:

	test -f '$(XYZ_PATH_SQ)'

Yes, TCL_PATH and TCLTK_PATH may already be broken the same way, but I don't think we want to make things worse.

I think setting PYTHON_PATH to /usr/local/bin/python inside
	ifeq ($(uname_S),FreeBSD)
        ...
        endif
block would be more in-line with the current design of the Makefile.
Show 7 quoted lines
> diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py
> index 7051a83..82f5ed3 100755
> --- a/contrib/fast-import/import-zips.py
> +++ b/contrib/fast-import/import-zips.py
> @@ -1,4 +1,4 @@
> -#!/usr/bin/python
> +#!/usr/bin/env python

These changes to contrib/ are correct and necessary, as we don't replace them with Makefile targets like we do for the scripted Porcelains, if people want to run them directly (or copy them out literally) out of contrib/ area. .

Previous: R. Tyler Ballance
Message 2 of 2 in “Correct references to /usr/bin/python which may not exist on certain systems”
  1. Correct references to /usr/bin/python which may not exist on certain systemsR. Tyler Ballance, Mar 20, 2010
  2. Junio C HamanoMar 21, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.