Skip to content

Commit ed8f0c8

Browse files
committed
[REF] cli: renamed openerp-server to odoo-bin
The use of an entry point was considered in order to provide an `odoo` command in the path for the packages users, but the generated entry point will first check that all the things in install_requires were provided in a not bright way: it'll check that it matches a distribution name. This does not work because python-chart does not have the distrubtion name "pychart" which is provided by the python-pychart package in debian jessie. Same for suds-jurko which is provided by python-suds in debian stretch but does not have the distribution name "suds". Also, adapted the packages tests to these cli changes.
1 parent 2d5fc15 commit ed8f0c8

File tree

11 files changed

+23
-18
lines changed

11 files changed

+23
-18
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ For Odoo employees
4242

4343
To add the odoo-dev remote use this command:
4444

45-
$ ./odoo.py setup_git_dev
45+
$ ./setup/setup_dev.py setup_git_dev
4646

4747
To fetch odoo merge pull requests refs use this command:
4848

49-
$ ./odoo.py setup_git_review
49+
$ ./setup/setup_dev.py setup_git_review
5050

debian/init

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
### BEGIN INIT INFO
3-
# Provides: odoo.py
3+
# Provides: odoo
44
# Required-Start: $remote_fs $syslog
55
# Required-Stop: $remote_fs $syslog
66
# Default-Start: 2 3 4 5
@@ -14,7 +14,7 @@
1414
. /lib/lsb/init-functions
1515

1616
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
17-
DAEMON=/usr/bin/odoo.py
17+
DAEMON=/usr/bin/odoo
1818
NAME=odoo
1919
DESC=odoo
2020
CONFIG=/etc/odoo/openerp-server.conf

doc/git.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Initializing a working copy
99

1010
Use the easy-setup shell script::
1111

12-
curl -O https://raw.githubusercontent.com/odoo/odoo/master/odoo.py | python2
12+
curl -O https://raw.githubusercontent.com/odoo/odoo/10.0/setup/setup_dev.py | python2
1313

1414
it will will ask a few questions and create a local copy.
1515

openerp-server odoo-bin

File renamed without changes.

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def py2exe_options():
5757
import py2exe
5858
return {
5959
'console': [
60-
{'script': 'openerp-server', 'icon_resources': [
60+
{'script': 'odoo-bin', 'icon_resources': [
6161
(1, join('setup', 'win32', 'static', 'pixmaps', 'openerp-icon.ico'))
6262
]},
6363
],
@@ -128,7 +128,7 @@ def py2exe_options():
128128
author_email=author_email,
129129
classifiers=filter(None, classifiers.split('\n')),
130130
license=license,
131-
scripts=['openerp-server'],
131+
scripts=['setup/odoo'],
132132
packages=find_packages(),
133133
package_dir={'%s' % lib_name: 'odoo'},
134134
include_package_data=True,

setup/odoo

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env python
2+
import odoo
3+
4+
if __name__ == "__main__":
5+
odoo.cli.main()

setup/package.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def run(self):
217217
self.rsync('"%s" %[email protected]:' % (setuppath, self.login))
218218
self.ssh("TEMP=/tmp ./%s /S" % setupfile)
219219
self.ssh('PGPASSWORD=openpgpwd /cygdrive/c/"Program Files"/"Odoo %s"/PostgreSQL/bin/createdb.exe -e -U openpg mycompany' % setupversion)
220-
self.ssh('/cygdrive/c/"Program Files"/"Odoo %s"/server/openerp-server.exe -d mycompany -i base --stop-after-init' % setupversion)
220+
self.ssh('/cygdrive/c/"Program Files"/"Odoo %s"/server/odoo-bin.exe -d mycompany -i base --stop-after-init' % setupversion)
221221
self.ssh('net start %s' % nt_service_name)
222222
_rpc_count_modules(port=18069)
223223

@@ -307,8 +307,8 @@ def test_tgz(o):
307307
wheezy.system('su postgres -s /bin/bash -c "createdb mycompany"')
308308
wheezy.system('mkdir /var/lib/odoo')
309309
wheezy.system('chown odoo:odoo /var/lib/odoo')
310-
wheezy.system('su odoo -s /bin/bash -c "odoo.py --addons-path=/usr/local/lib/python2.7/dist-packages/odoo/addons -d mycompany -i base --stop-after-init"')
311-
wheezy.system('su odoo -s /bin/bash -c "odoo.py --addons-path=/usr/local/lib/python2.7/dist-packages/odoo/addons -d mycompany &"')
310+
wheezy.system('su odoo -s /bin/bash -c "odoo --addons-path=/usr/local/lib/python2.7/dist-packages/odoo/addons -d mycompany -i base --stop-after-init"')
311+
wheezy.system('su odoo -s /bin/bash -c "odoo --addons-path=/usr/local/lib/python2.7/dist-packages/odoo/addons -d mycompany &"')
312312

313313
def test_deb(o):
314314
with docker('odoo-%s-debian-nightly-tests' % version, o.build_dir, o.pub) as wheezy:
@@ -317,8 +317,8 @@ def test_deb(o):
317317
wheezy.system('su postgres -s /bin/bash -c "createdb mycompany"')
318318
wheezy.system('/usr/bin/dpkg -i /opt/release/%s' % wheezy.release)
319319
wheezy.system('/usr/bin/apt-get install -f -y')
320-
wheezy.system('su odoo -s /bin/bash -c "odoo.py -c /etc/odoo/openerp-server.conf -d mycompany -i base --stop-after-init"')
321-
wheezy.system('su odoo -s /bin/bash -c "odoo.py -c /etc/odoo/openerp-server.conf -d mycompany &"')
320+
wheezy.system('su odoo -s /bin/bash -c "odoo -c /etc/odoo/openerp-server.conf -d mycompany -i base --stop-after-init"')
321+
wheezy.system('su odoo -s /bin/bash -c "odoo -c /etc/odoo/openerp-server.conf -d mycompany &"')
322322

323323
def test_rpm(o):
324324
with docker('odoo-%s-centos-nightly-tests' % version, o.build_dir, o.pub) as centos7:
@@ -329,8 +329,8 @@ def test_rpm(o):
329329
centos7.system('su postgres -c "createdb mycompany"')
330330
# Odoo install
331331
centos7.system('yum install -d 0 -e 0 /opt/release/%s -y' % centos7.release)
332-
centos7.system('su odoo -s /bin/bash -c "openerp-server -c /etc/odoo/openerp-server.conf -d mycompany -i base --stop-after-init"')
333-
centos7.system('su odoo -s /bin/bash -c "openerp-server -c /etc/odoo/openerp-server.conf -d mycompany &"')
332+
centos7.system('su odoo -s /bin/bash -c "odoo -c /etc/odoo/openerp-server.conf -d mycompany -i base --stop-after-init"')
333+
centos7.system('su odoo -s /bin/bash -c "odoo -c /etc/odoo/openerp-server.conf -d mycompany &"')
334334

335335
def test_exe(o):
336336
KVMWinTestExe(o, o.vm_winxp_image, o.vm_winxp_ssh_key, o.vm_winxp_login).start()

setup/redhat/postinstall.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ After=network.target
5252
Type=simple
5353
User=odoo
5454
Group=odoo
55-
ExecStart=/usr/bin/odoo.py --config=/etc/odoo/openerp-server.conf
55+
ExecStart=/usr/bin/odoo --config=/etc/odoo/odoo.conf
5656
5757
[Install]
5858
WantedBy=multi-user.target

setup/setup_dev.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# To install your odoo development environement type:
66
#
7-
# wget -O- https://raw.githubusercontent.com/odoo/odoo/9.0/odoo.py | python
7+
# wget -O- https://raw.githubusercontent.com/odoo/odoo/10.0/setup/setup_dev.py | python
88
#
99
# The setup_* subcommands used to boostrap odoo are defined here inline and may
1010
# only depends on the python 2.7 stdlib

setup/win32/setup.nsi

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ Section $(TITLE_OpenERP_Server) SectionOpenERP_Server
233233
WriteIniStr "$INSTDIR\server\openerp-server.conf" "options" "pg_path" "$INSTDIR\PostgreSQL\bin"
234234
${EndIf}
235235

236-
nsExec::Exec '"$INSTDIR\server\openerp-server.exe" --stop-after-init --logfile "$INSTDIR\server\openerp-server.log" -s'
236+
nsExec::Exec '"$INSTDIR\server\odoo-bin.exe" --stop-after-init --logfile "$INSTDIR\server\odoo.log" -s'
237237
nsExec::Exec '"$INSTDIR\service\win32_service.exe" -auto -install'
238238

239239
nsExec::Exec "net stop ${SERVICENAME}"

setup/win32/win32_service.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def SvcDoRun(self):
3333
# We start Odoo as an independent process, but we keep its handle
3434
service_dir = dirname(sys.argv[0])
3535
server_dir = split(service_dir)[0]
36-
server_path = join(server_dir, 'server', 'openerp-server.exe')
36+
server_path = join(server_dir, 'server', 'odoo-bin.exe')
3737
self.odooprocess = subprocess.Popen(
3838
[server_path], cwd=server_dir, creationflags=win32process.CREATE_NO_WINDOW
3939
)

0 commit comments

Comments
 (0)