From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH] tools: python portability fixes Date: Tue, 28 Jul 2009 09:34:42 +0200 Message-ID: <200907280934.42860.Christoph.Egger@amd.com> References: <200907231558.12957.Christoph.Egger@amd.com> <19053.63640.992395.149945@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <19053.63640.992395.149945@mariner.uk.xensource.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson Cc: "xen-devel@lists.xensource.com" , Keir Fraser List-Id: xen-devel@lists.xenproject.org On Monday 27 July 2009 20:57:28 Ian Jackson wrote: > Christoph Egger writes ("[PATCH] tools: python portability fixes"): > > Attached patch applies portability fixes for NetBSD: > > Hi. As Keir says, I'm away, but: > > - remove useless get-path. It is a bash specific script which tries to > > gain information the build system already has. > > - make install-wrap work with bourne shell on NetBSD > > - pass `which $(PYTHON)` to install-wrap. It is safe to assume > > this always works because in case it doesn't the build system > > errors out very early in tools/check/check_python > > Isn't the effect of this to stop substituting #!/usr/bin/python2.5 (or > whatever) for #!/usr/bin/python ? In which case it's wrong as I've > already explained. No, the effect is this: When $(PYTHON) is python you get #!/usr/bin/python, when $(PYTHON) is python2.5 you get #!/usr/bin/python2.5, when $(PYTHON) is python2.6 you get #!/usr/bin/python2.6, when $(PYTHON) is /usr/bin/python2.4 you get #!/usr/bin/python2.4, etc. When you install python on NetBSD, you don't have a "python" binary. You always have pythonN.M where N.M is the version number so you can have multiple python versions installed. On NetBSD, you actually get #!/usr/pkg/bin/python2.5. The get-path is a bash specific script which tries to get the information `which $(PYTHON)` already provides but doesn't work for the case where "python" doesn't exist. The current approach is doomed to always fail on NetBSD. On Linux you have a python symlink to pythonN.M. Remove the symlink manually, build and install xen with gmake PYTHON=pythonN.M and you can reproduce the issue on Linux. The patch fixes it. Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Karl-Hammerschmidt-Str. 34, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Thomas M. McCoy, Giuliano Meroni Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632