tools: simplify install of python "binaries"
PATCH 1/1 tools: simplify install of python "binaries"
Hi!
Attached patch simplifies install of python "binaries". Get rid of get-path.
Signature · 6 lines
---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
tools/misc/Makefile +1 -2
@@ -25,8 +25,7 @@ INSTALL_BIN := $(INSTALL_BIN-y) INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat INSTALL_SBIN := $(INSTALL_SBIN-y) -DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path) -PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH) +PYTHON_PATH ?= $(PYTHON) INSTALL_PYTHON_PROG = $(XEN_ROOT)/tools/python/install-wrap \ "$(PYTHON_PATH)" $(INSTALL_PROG)
tools/python/get-path deleted +0 -22
@@ -1,22 +0,0 @@ -#! /usr/bin/env bash -set -e - -check () { - set +e - p=`type -p python$v` - r=$? - set -e - if [ $r = 0 ]; then - echo >&2 "${0##*/}: will use #!$p for python programs" - printf "%s\n" "$p" - exit 0 - fi -} - -v="$(python -V 2>&1)" -v="${v#* }" -check -v="${v%.*}" -check -echo >&2 'python version not determined, will use env to find python at runtime' -printf "/usr/bin/env python\n"
tools/python/install-wrap +1 -2
@@ -4,8 +4,7 @@ # where # PYTHON_PATH is what to put after #! and may be `/usr/bin/env python' # -# Used via $(INSTALL_PYTHON_PROG) in Rules.mk; PYTHON_PATH comes from -# .../get-path alongside this script +# Used via $(INSTALL_PYTHON_PROG) in Rules.mk; PYTHON_PATH comes from $(PYTHON) set -e if [ $# -lt 2 ]; then echo >&2 "${0##*/}: too few arguments"; exit 1; fi
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Christoph Egger writes ("[Xen-devel] [PATCH] tools: simplify install of python "binaries""):
Quoted 2 lines
Attached patch simplifies install of python "binaries". Get rid of get-path.
I don't think this is correct.
The purpose of the code you are removing here is to find out what the compile-time python version is, and then hardcode that into the #! line of the installed python scripts.
So if you compile with PYTHON=python2.4 or with PYTHON unset on a system where `python' from the path is 2.4, you generate in dist/install/ (a) python modules in .../site-packages/python2.4 and
(b) scripts starting #!/usr/bin/python2.4
If you don't do this then the script starts #!/usr/bin/python and if by then python 2.5 is installed, it won't find the modules.
Ian.
Quoted 6 lines · On Wednesday 15 July 2009 17:09:58 Christoph Egger wrote:
Hi!
Attached patch simplifies install of python "binaries". Get rid of get-path.
Signed-off-by Christoph Egger <[email protected]>
Previous version doesn't work due to missing part. Attached patch is the complete one.
Signature · 6 lines
---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
Config.mk +1 -1
@@ -35,7 +35,7 @@ EXTRA_INCLUDES += $(EXTRA_PREFIX)/includ EXTRA_LIB += $(EXTRA_PREFIX)/$(LIBLEAFDIR) endif -PYTHON ?= python +PYTHON ?= $(shell which python) PYTHON_PREFIX_ARG ?= --prefix="$(PREFIX)" # The above requires that PREFIX contains *no spaces*. This variable is here # to permit the user to set PYTHON_PREFIX_ARG to '' to workaround this bug:
tools/misc/Makefile +1 -2
@@ -25,8 +25,7 @@ INSTALL_BIN := $(INSTALL_BIN-y) INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat INSTALL_SBIN := $(INSTALL_SBIN-y) -DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path) -PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH) +PYTHON_PATH ?= $(PYTHON) INSTALL_PYTHON_PROG = $(XEN_ROOT)/tools/python/install-wrap \ "$(PYTHON_PATH)" $(INSTALL_PROG)
tools/python/get-path deleted +0 -22
@@ -1,22 +0,0 @@ -#! /usr/bin/env bash -set -e - -check () { - set +e - p=`type -p python$v` - r=$? - set -e - if [ $r = 0 ]; then - echo >&2 "${0##*/}: will use #!$p for python programs" - printf "%s\n" "$p" - exit 0 - fi -} - -v="$(python -V 2>&1)" -v="${v#* }" -check -v="${v%.*}" -check -echo >&2 'python version not determined, will use env to find python at runtime' -printf "/usr/bin/env python\n"
tools/python/install-wrap +1 -2
@@ -4,8 +4,7 @@ # where # PYTHON_PATH is what to put after #! and may be `/usr/bin/env python' # -# Used via $(INSTALL_PYTHON_PROG) in Rules.mk; PYTHON_PATH comes from -# .../get-path alongside this script +# Used via $(INSTALL_PYTHON_PROG) in Rules.mk; PYTHON_PATH comes from $(PYTHON) set -e if [ $# -lt 2 ]; then echo >&2 "${0##*/}: too few arguments"; exit 1; fi
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Christoph Egger writes ("Re: [Xen-devel] [PATCH] tools: simplify install of python "binaries""):
Quoted 2 lines
Previous version doesn't work due to missing part. Attached patch is the complete one.
I still disagree with the this change, as explained.
Quoted 1 line
Signed-off-by Christoph Egger <[email protected]>
Ian.