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-changelog

[Xen-changelog] [xen-unstable] tools: Adjust tools' path calculation.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools: Adjust tools' path calculation.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 21 Jun 2007 05:01:38 -0700
Delivery-date: Thu, 21 Jun 2007 05:00:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1182355635 -3600
# Node ID 7825043607bc453dc4657f3bf8b53baeb425dc44
# Parent  f50f0ec7dd2c4cdc6313c357a6fd74eeea60b2a2
tools: Adjust tools' path calculation.

I'm suggesting this change to make another tiny step towards the
ability to run the tools e.g. out of the build tree (so that multiple
different Xen versions can co-exist without the requirement to
re-install the respective version with each boot).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
---
 tools/misc/xen-python-path      |    9 +++++++--
 tools/python/xen/util/auxbin.py |    9 +++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff -r f50f0ec7dd2c -r 7825043607bc tools/misc/xen-python-path
--- a/tools/misc/xen-python-path        Wed Jun 20 17:05:48 2007 +0100
+++ b/tools/misc/xen-python-path        Wed Jun 20 17:07:15 2007 +0100
@@ -28,8 +28,13 @@ import os.path
 import os.path
 import sys
 
-for p in ['python%s' % sys.version[:3], 'python']:
-    for l in ['/usr/lib64', '/usr/lib']:
+usr   = os.path.dirname(os.path.dirname(sys.argv[0]))
+list  = [ os.path.join(usr,'lib64') ]
+list += [ os.path.join(usr,'lib') ]
+list += ['/usr/lib64', '/usr/lib']
+
+for l in list:
+    for p in ['python%s' % sys.version[:3], 'python']:
         for k in ['', 'site-packages/']:
             d = os.path.join(l, p, k)
             if os.path.exists(os.path.join(d, AUXBIN)):
diff -r f50f0ec7dd2c -r 7825043607bc tools/python/xen/util/auxbin.py
--- a/tools/python/xen/util/auxbin.py   Wed Jun 20 17:05:48 2007 +0100
+++ b/tools/python/xen/util/auxbin.py   Wed Jun 20 17:07:15 2007 +0100
@@ -27,6 +27,7 @@ LIB_64_ARCHS = [ 'x86_64', 's390x', 'spa
 
 import os
 import os.path
+import sys
 
 
 def execute(exe, args = None):
@@ -47,6 +48,14 @@ def path():
 
 def libpath():
     machine = os.uname()[4]
+    if sys.argv[0] != '-c':
+        prefix = os.path.dirname(os.path.dirname(sys.argv[0]))
+        path = os.path.join(prefix, os.path.basename(LIB_64))
+        if machine in LIB_64_ARCHS and os.path.exists(path):
+            return path
+        path = os.path.join(prefix, os.path.basename(LIB_32))
+        if os.path.exists(path):
+            return path
     if machine in LIB_64_ARCHS and os.path.exists(LIB_64):
         return LIB_64
     else:

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools: Adjust tools' path calculation., Xen patchbot-unstable <=