WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Set path in #! line of pygrub, too

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Set path in #! line of pygrub, too
From: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Date: Mon, 24 Aug 2009 16:50:45 +0100
Delivery-date: Mon, 24 Aug 2009 08:51:08 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
pygrub currently has a hardcoded path of /usr/bin/python which is not
correct if the version of python at install time is not the same as
that at build time.  This patch uses the existing install-wrap and
python/get-path machinery.

(It does not address the currently-existing bug that the get-path
machinery works by assuming that `python' is a symlink, rather than
querying the python interpreter for its version.)

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>

diff -r 8b0f1f37e145 tools/Rules.mk
--- a/tools/Rules.mk    Sun Aug 16 08:46:08 2009 +0100
+++ b/tools/Rules.mk    Tue Aug 18 17:54:45 2009 +0100
@@ -49,6 +49,11 @@
                         "Xen requires at least gcc-3.4")
 $(eval $(check-y))
 
+DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path)
+PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH)
+INSTALL_PYTHON_PROG = \
+       $(XEN_ROOT)/tools/python/install-wrap "$(PYTHON_PATH)" $(INSTALL_PROG)
+
 %.opic: %.c
        $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
 
diff -r 8b0f1f37e145 tools/misc/Makefile
--- a/tools/misc/Makefile       Sun Aug 16 08:46:08 2009 +0100
+++ b/tools/misc/Makefile       Tue Aug 18 17:54:45 2009 +0100
@@ -24,11 +24,6 @@
 
 INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm 
xen-tmem-list-parse gtraceview gtracestat xen-hvmctx
 INSTALL_SBIN := $(INSTALL_SBIN-y)
-
-DEFAULT_PYTHON_PATH := $(shell $(XEN_ROOT)/tools/python/get-path)
-PYTHON_PATH ?= $(DEFAULT_PYTHON_PATH)
-INSTALL_PYTHON_PROG = $(XEN_ROOT)/tools/python/install-wrap \
-"$(PYTHON_PATH)" $(INSTALL_PROG)
 
 .PHONY: all
 all: build
diff -r 8b0f1f37e145 tools/pygrub/Makefile
--- a/tools/pygrub/Makefile     Sun Aug 16 08:46:08 2009 +0100
+++ b/tools/pygrub/Makefile     Tue Aug 18 17:54:45 2009 +0100
@@ -12,6 +12,7 @@
 install: all
        CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
                $(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" --force
+       $(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(BINDIR)/pygrub
        $(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
 
 .PHONY: clean
diff -r 8b0f1f37e145 tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub   Sun Aug 16 08:46:08 2009 +0100
+++ b/tools/pygrub/src/pygrub   Tue Aug 18 17:54:45 2009 +0100
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#! /usr/bin/env python
 #
 # pygrub - simple python-based bootloader for Xen
 #

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Set path in #! line of pygrub, too, Ian Jackson <=