{"thread":{"id":"23115","subject":"[PATCH] Correct references to /usr/bin/python which may not exist on certain systems","startedAt":"2010-03-20T23:51:11Z","lastAt":"2010-03-21T01:37:24Z","messageCount":2,"participants":["R. Tyler Ballance","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"137386","messageId":"20100320235105.GA30457@kiwi.sharlinx.com","threadId":"23115","inReplyTo":null,"subject":"[PATCH] Correct references to /usr/bin/python which may not exist on certain systems","fromName":"R. Tyler Ballance","fromEmail":"tyler@monkeypox.org","sentAt":"2010-03-20T23:51:11Z","receivedAt":"2010-03-20T23:51:11Z","isPatch":true,"sender":{"key":"tyler@monkeypox.org","avatar":"https://gravatar.com/avatar/f523ae06c1aa78f1b4c13bd5dd6fe4c716ec72c0857fcb187f1c7f0e2d2b0ba1?d=mp&s=160"},"body":"FreeBSD for example does not ship with a /usr/bin/python such that Python\ninstalled from ports will be located by default in /usr/local/bin\n---\n Makefile                           |    2 +-\n contrib/fast-import/import-zips.py |    2 +-\n contrib/hg-to-git/hg-to-git.py     |    2 +-\n contrib/p4import/git-p4import.py   |    2 +-\n git_remote_helpers/Makefile        |    2 +-\n 5 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3a6c6ea..2b248b4 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -444,7 +444,7 @@ ifndef PERL_PATH\n \tPERL_PATH = /usr/bin/perl\n endif\n ifndef PYTHON_PATH\n-\tPYTHON_PATH = /usr/bin/python\n+\tPYTHON_PATH = /usr/bin/env python\n endif\n \n export PERL_PATH\ndiff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py\nindex 7051a83..82f5ed3 100755\n--- a/contrib/fast-import/import-zips.py\n+++ b/contrib/fast-import/import-zips.py\n@@ -1,4 +1,4 @@\n-#!/usr/bin/python\n+#!/usr/bin/env python\n \n ## zip archive frontend for git-fast-import\n ##\ndiff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py\nindex 854cd94..046cb2b 100755\n--- a/contrib/hg-to-git/hg-to-git.py\n+++ b/contrib/hg-to-git/hg-to-git.py\n@@ -1,4 +1,4 @@\n-#! /usr/bin/python\n+#!/usr/bin/env python\n \n \"\"\" hg-to-git.py - A Mercurial to GIT converter\n \ndiff --git a/contrib/p4import/git-p4import.py b/contrib/p4import/git-p4import.py\nindex 0f3d97b..b6e534b 100644\n--- a/contrib/p4import/git-p4import.py\n+++ b/contrib/p4import/git-p4import.py\n@@ -1,4 +1,4 @@\n-#!/usr/bin/python\n+#!/usr/bin/env python\n #\n # This tool is copyright (c) 2006, Sean Estabrooks.\n # It is released under the Gnu Public License, version 2.\ndiff --git a/git_remote_helpers/Makefile b/git_remote_helpers/Makefile\nindex c62dfd0..af3cc28 100644\n--- a/git_remote_helpers/Makefile\n+++ b/git_remote_helpers/Makefile\n@@ -7,7 +7,7 @@ pysetupfile:=setup.py\n DESTDIR_SQ = $(subst ','\\'',$(DESTDIR))\n \n ifndef PYTHON_PATH\n-\tPYTHON_PATH = /usr/bin/python\n+\tPYTHON_PATH = /usr/bin/env python\n endif\n ifndef prefix\n \tprefix = $(HOME)\n-- \n1.6.4.3\n"},{"id":"137403","messageId":"7vaau278vf.fsf@alter.siamese.dyndns.org","threadId":"23115","inReplyTo":"20100320235105.GA30457@kiwi.sharlinx.com","subject":"Re: [PATCH] Correct references to /usr/bin/python which may not exist on certain systems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-21T01:37:24Z","receivedAt":"2010-03-21T01:37:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"R. Tyler Ballance\" <tyler@monkeypox.org> writes:\n\n> FreeBSD for example does not ship with a /usr/bin/python such that Python\n> installed from ports will be located by default in /usr/local/bin\n> ---\n> diff --git a/Makefile b/Makefile\n> index 3a6c6ea..2b248b4 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -444,7 +444,7 @@ ifndef PERL_PATH\n>  \tPERL_PATH = /usr/bin/perl\n>  endif\n>  ifndef PYTHON_PATH\n> -\tPYTHON_PATH = /usr/bin/python\n> +\tPYTHON_PATH = /usr/bin/env python\n>  endif\n\nThis wouldn't work very well, as XYZ_PATH is expected to point at full\npath to the executable.  You should be able to say:\n\n\ttest -f '$(XYZ_PATH_SQ)'\n\nYes, TCL_PATH and TCLTK_PATH may already be broken the same way, but I\ndon't think we want to make things worse.\n\nI think setting PYTHON_PATH to /usr/local/bin/python inside\n\n\tifeq ($(uname_S),FreeBSD)\n        ...\n        endif\n\nblock would be more in-line with the current design of the Makefile.\n\n> diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py\n> index 7051a83..82f5ed3 100755\n> --- a/contrib/fast-import/import-zips.py\n> +++ b/contrib/fast-import/import-zips.py\n> @@ -1,4 +1,4 @@\n> -#!/usr/bin/python\n> +#!/usr/bin/env python\n\nThese changes to contrib/ are correct and necessary, as we don't replace\nthem with Makefile targets like we do for the scripted Porcelains, if\npeople want to run them directly (or copy them out literally) out of\ncontrib/ area.  .\n"}]}