Merge lp:~xavinsky/openobject-client/trunk-bug-872925-xavinsky into lp:openobject-client

Proposed by xavinsky
Status: Work in progress
Proposed branch: lp:~xavinsky/openobject-client/trunk-bug-872925-xavinsky
Merge into: lp:openobject-client
Diff against target: 64 lines (+33/-3)
1 file modified
mydistutils.py (+33/-3)
To merge this branch: bzr merge lp:~xavinsky/openobject-client/trunk-bug-872925-xavinsky
Reviewer Review Type Date Requested Status
OpenERP sa GTK client R&D Pending
Review via email: mp+79146@code.launchpad.net

Description of the change

fix the bug #872925

Install on linux (debian with ou wothout virtualenv)
after the
python setup.py install
when I use openerp-client command :
<pathbin>/bin/openerp-client: 2: cd: can't cd to <pathlib>/lib/python2.7/site-packages/openerp-client

because the path miss the egg folder :
<pathlib>/lib/python2.7/site-packages/openerp_client-6.1dev-py2.7.egg/openerp-client

Solution : calculate the egg path and add it.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

marking as work in progress as it needs a bit more test for more info visit lp:872925

Unmerged revisions

1977. By xavinsky

Test path lib with and without eggname.

1976. By xavinsky

In instaler, change the lib path.
add egg path
fix bug : 872925

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'mydistutils.py'
2--- mydistutils.py 2011-05-06 15:22:17 +0000
3+++ mydistutils.py 2011-11-15 14:40:29 +0000
4@@ -58,6 +58,7 @@
5 from setuptools.command.install import install
6 from distutils.command.install_data import install_data
7 from distutils.dep_util import newer
8+from distutils.sysconfig import get_python_version
9 import distutils.core
10
11 from distutils.errors import DistutilsSetupError
12@@ -90,11 +91,19 @@
13 opj = os.path.join
14 # Peek into "install" command to find out where it is going to install to
15 inst_cmd = self.get_finalized_command('install')
16+ egg_name = "%s-%s-py%s.egg" % (inst_cmd.distribution.get_name().replace('-','_'),
17+ inst_cmd.distribution.get_version(),
18+ get_python_version())
19 if inst_cmd:
20 # Note: we user the "purelib" because we don't ship binary
21 # executables. If we ever compile things into execs, we shall
22 # use "platlib"
23- openerp_site_packages = opj(inst_cmd.install_purelib,'openerp-client')
24+ openerp_site_packages_1 = opj(inst_cmd.install_purelib,
25+ 'openerp-client')
26+
27+ openerp_site_packages_2 = opj(inst_cmd.install_purelib,
28+ egg_name,
29+ 'openerp-client')
30 if inst_cmd.root and openerp_site_packages.startswith(inst_cmd.root):
31 # trick: when we install relative to root, we mostly mean to
32 # temporary put the files there, and then move back to the
33@@ -107,8 +116,29 @@
34
35 else:
36 # Hard-code the Linux /usr/lib/pythonX.Y/... path
37- openerp_site_packages = opj('/usr', 'lib', 'python%s' % py_short_version, 'site-packages', 'openerp-client')
38- start_script = "#!/bin/sh\ncd %s\nexec %s ./openerp-client.py $@\n" % (openerp_site_packages, sys.executable)
39+ openerp_site_packages_1 = opj('/usr', 'lib',
40+ 'python%s' % py_short_version,
41+ 'site-packages',
42+ 'openerp-client')
43+ openerp_site_packages_2 = opj('/usr',
44+ 'lib',
45+ 'python%s' % py_short_version,
46+ 'site-packages',
47+ egg_name,
48+ 'openerp-client')
49+
50+
51+ start_script = """#!/bin/sh
52+if [ -d "%s" ]; then
53+ cd %s
54+fi
55+if [ -d "%s" ]; then
56+ cd %s
57+fi
58+exec %s ./openerp-client.py $@
59+""" % (openerp_site_packages_1, openerp_site_packages_1,
60+ openerp_site_packages_2, openerp_site_packages_2,
61+ sys.executable)
62 # write script
63 f = open('openerp-client', 'w')
64 f.write(start_script)