direct-io.hg

changeset 4539:3b1865796b88

bitkeeper revision 1.1159.258.97 (42603992S3sF-t0yBth7NEBevozVOg)

[PATCH] Make non-native python path handling a
> > Although I don't really agree with the installing of the
> > python bits to the non-native paths, I can see where it's
> > useful as long as the module ABI doesn't change if you're
> > trying to distribute binary tarballs. But with the current
> > handling it adds module lookup costs for the native path case
> > (which would be the norm) as well as prevents using
> > PYTHONPATH to look to a different location for the modules.
> >
> > The attached patch changes things so that at first, the xen
> > module is attempted to be imported from the stock paths. If
> > we get an ImportError exception, then it adds /usr/lib/python
> > to the end of the python path and imports again.
>
> Do you prefer this to just unconditionally addding /usr/lib/python to
> the end of the path rather than the front?

Slightly, but just because having /usr/lib/python in my sys.path is
ugly :-) I can look over it, though... patch doing that attached

Signed-off-by: Jeremy Katz <katzj@redhat.com>

===== tools/misc/netfix 1.13 vs edited =====
author katzj@redhat.com[iap10]
date Fri Apr 15 22:00:50 2005 +0000 (2005-04-15)
parents 183c37ca35e8
children 4099062dbee6
files tools/misc/netfix tools/misc/xend tools/misc/xensv tools/misc/xm
line diff
     1.1 --- a/tools/misc/netfix	Fri Apr 15 20:15:57 2005 +0000
     1.2 +++ b/tools/misc/netfix	Fri Apr 15 22:00:50 2005 +0000
     1.3 @@ -9,8 +9,8 @@
     1.4  
     1.5  from getopt import getopt
     1.6  
     1.7 -# Default install path for Xen binary packages.
     1.8 -sys.path = [ '/usr/lib/python' ] + sys.path
     1.9 +# add fallback path for non-native python path installs if needed
    1.10 +sys.path.append('/usr/lib/python')
    1.11  from xen.util.Brctl import *
    1.12  
    1.13  short_options = 'hvqni:b:c'
     2.1 --- a/tools/misc/xend	Fri Apr 15 20:15:57 2005 +0000
     2.2 +++ b/tools/misc/xend	Fri Apr 15 22:00:50 2005 +0000
     2.3 @@ -22,8 +22,8 @@
     2.4  import os
     2.5  import sys
     2.6  
     2.7 -# Default install path for Xen binary packages.
     2.8 -sys.path = [ '/usr/lib/python' ] + sys.path
     2.9 +# add fallback path for non-native python path installs if needed
    2.10 +sys.path.append('/usr/lib/python')
    2.11  from xen.xend.server import SrvDaemon
    2.12  
    2.13  class CheckError(ValueError):
     3.1 --- a/tools/misc/xensv	Fri Apr 15 20:15:57 2005 +0000
     3.2 +++ b/tools/misc/xensv	Fri Apr 15 22:00:50 2005 +0000
     3.3 @@ -22,8 +22,8 @@ import os
     3.4  import sys
     3.5  import re
     3.6  
     3.7 -# Default install path for Xen binary packages.
     3.8 -sys.path = [ '/usr/lib/python' ] + sys.path
     3.9 +# add fallback path for non-native python path installs if needed
    3.10 +sys.path.append('/usr/lib/python')
    3.11  from xen.xend.server.params import XEND_PID_FILE
    3.12  
    3.13  class CheckError(ValueError):
     4.1 --- a/tools/misc/xm	Fri Apr 15 20:15:57 2005 +0000
     4.2 +++ b/tools/misc/xm	Fri Apr 15 22:00:50 2005 +0000
     4.3 @@ -2,8 +2,8 @@
     4.4  #  -*- mode: python; -*-
     4.5  import sys
     4.6  
     4.7 -# Default install path for Xen binary packages.
     4.8 -sys.path = [ '/usr/lib/python' ] + sys.path
     4.9 +# add fallback path for non-native python path installs if needed
    4.10 +sys.path.append('/usr/lib/python')
    4.11  from xen.xm import main
    4.12  
    4.13  main.main(sys.argv)