src/patch/ldtp/find-python-path.patch
author Rich Burridge <rich.burridge@sun.com>
Mon, 30 Nov 2009 13:01:40 -0800
changeset 1516 8c950a3b4171
parent 1391 1a9bd005489f
permissions -rw-r--r--
10485 move pkg(5) to Python 2.6 10482 upgrade to cherrypy 3.1.2 11836 shebang line for python modules should be python version-agnostic 11950 ldtp used by pkg build process not setup to easily use Python 2.6 11989 pkg python dependency analysis tests fail
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
     1
--- find-python-path.py.orig	2009-09-30 13:52:05.871915809 +0100
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
     2
+++ find-python-path.py	2009-09-30 13:52:18.469972626 +0100
1516
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1391
diff changeset
     3
@@ -1,4 +1,4 @@
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1391
diff changeset
     4
-#!/usr/bin/env python
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1391
diff changeset
     5
+#!/usr/bin/env python2.6
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1391
diff changeset
     6
 
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1391
diff changeset
     7
 import sys
8c950a3b4171 10485 move pkg(5) to Python 2.6
Rich Burridge <rich.burridge@sun.com>
parents: 1391
diff changeset
     8
 from os.path import split, basename
1391
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
     9
@@ -7,7 +7,7 @@
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
    10
     for path in sys.path:
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
    11
 	(head, tail) = split (path)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
    12
         # Forcing python path to be used as /usr/lib instead of /usr/local/lib
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
    13
-	if (tail == 'site-packages' or tail == 'dist-packages') and \
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
    14
+	if (tail == 'vendor-packages' or tail == 'dist-packages') and \
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
    15
                 path.find ('local') == -1:
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
    16
 	    base = basename (head)
1a9bd005489f 7987 LDTP package needs to be included in the gate
Michal Pryc <Michal.Pryc@Sun.Com>
parents:
diff changeset
    17
 	    print path