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] Added auxbin module, for handling auxillary binaries.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Added auxbin module, for handling auxillary binaries.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 11 Oct 2005 14:32:11 +0000
Delivery-date: Tue, 11 Oct 2005 14:29:49 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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 emellor@ewan
# Node ID c5553e06a8bc1b9cffbbcae080cd90d0d6b8334c
# Parent  293f4417c089a0c1552db71a34e5354b8f0e23cd
Added auxbin module, for handling auxillary binaries.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 293f4417c089 -r c5553e06a8bc tools/python/xen/util/auxbin.py
--- /dev/null   Tue Oct 11 13:57:28 2005
+++ b/tools/python/xen/util/auxbin.py   Tue Oct 11 13:59:52 2005
@@ -0,0 +1,44 @@
+#============================================================================
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of version 2.1 of the GNU Lesser General Public
+# License as published by the Free Software Foundation.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#============================================================================
+# Copyright (C) 2005 XenSource Ltd
+#============================================================================
+
+
+LIB_BIN_32 = "/usr/lib/xen/bin"
+LIB_BIN_64 = "/usr/lib64/xen/bin"
+
+
+import os
+import os.path
+
+
+def execute(exe, args = None):
+    exepath = pathTo(exe)
+    a = [ exepath ]
+    if args:
+        a.extend(args)
+    os.execv(exepath, a)
+
+
+def pathTo(exe):
+    return os.path.join(path(), exe)
+
+
+def path():
+    machine = os.uname()[4]
+    if machine.find('64') != -1 and os.path.exists(LIB_BIN_64):
+        return LIB_BIN_64
+    else:
+        return LIB_BIN_32

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Added auxbin module, for handling auxillary binaries., Xen patchbot -unstable <=