← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-server/6.0-bug-750267-xrg into lp:openobject-server/6.0

 

xrg has proposed merging lp:~openerp-dev/openobject-server/6.0-bug-750267-xrg into lp:openobject-server/6.0.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #750267 in OpenERP Server: "server-init: simplify syntax for RedHat"
  https://bugs.launchpad.net/openobject-server/+bug/750267

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-bug-750267-xrg/+merge/56160
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/6.0-bug-750267-xrg/+merge/56160
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-server/6.0-bug-750267-xrg.
=== modified file 'README'
--- README	2010-09-28 18:53:49 +0000
+++ README	2011-04-04 13:31:56 +0000
@@ -1,17 +1,17 @@
-About OpenERP
----------------
-
-OpenERP is a free Enterprise Resource Planning and Customer Relationship 
-Management software. It is mainly developed to meet changing needs.
-
-The main functional features are: CRM & SRM, analytic and financial accounting,
-double-entry stock management, sales and purchases management, tasks automation,
-help desk, marketing campaign, ... and vertical modules for very specific 
-businesses.
-
-Technical features include a distributed server, flexible workflows, an object 
-database, dynamic GUIs, customizable reports, NET-RPC and XML-RPC interfaces, ...
-
-For more information, please visit: 
-http://www.openerp.com
-
+About OpenERP
+---------------
+
+OpenERP is a free Enterprise Resource Planning and Customer Relationship 
+Management software. It is mainly developed to meet changing needs.
+
+The main functional features are: CRM & SRM, analytic and financial accounting,
+double-entry stock management, sales and purchases management, tasks automation,
+help desk, marketing campaign, ... and vertical modules for very specific 
+businesses.
+
+Technical features include a distributed server, flexible workflows, an object 
+database, dynamic GUIs, customizable reports, NET-RPC and XML-RPC interfaces, ...
+
+For more information, please visit: 
+http://www.openerp.com
+

=== modified file 'bin/release.py'
--- bin/release.py	2011-04-01 14:25:28 +0000
+++ bin/release.py	2011-04-04 13:31:56 +0000
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # -*- encoding: utf-8 -*-
 ##############################################################################
 #

=== modified file 'bin/tools/graph.py' (properties changed: -x to +x)
=== modified file 'bin/tools/which.py' (properties changed: -x to +x)
=== modified file 'doc/openerp-server.init'
--- doc/openerp-server.init	2009-10-23 22:29:25 +0000
+++ doc/openerp-server.init	2011-04-04 13:31:56 +0000
@@ -52,7 +52,7 @@
 start() {
     if [ -d /etc/openerp/start.d ] ; then
         echo -n $"Preparing $desc: "
-        run-parts --exit-on-error /etc/openerp/start.d
+        run-parts /etc/openerp/start.d
         RETVAL=$?
         echo
         [ $RETVAL -ne 0 ] && return $RETVAL

=== added file 'tools/server-check.sh'
--- tools/server-check.sh	1970-01-01 00:00:00 +0000
+++ tools/server-check.sh	2011-04-04 13:31:56 +0000
@@ -0,0 +1,117 @@
+#!/bin/bash
+
+# This script should be autonomous, not require any external
+# conf files. However, it will try to read the server's conf
+
+get_ini ()
+{
+    eval $( cat "$1" | grep  "^db_\(user\|password\|name\|host\|port\) *=" | \
+	sed 's/False//;s/\([^ ]*\) *= *\(.*\)$/\U\1\E=\2/' )
+}
+
+DEVEL_MODE=
+SUCMD=
+DB_HOST=
+DB_PORT=
+DB_USER=openerp
+DB_PASSWORD=
+IN_SU=
+
+PG_ROOT=postgres
+
+while [ -n "$1" ] ; do
+    case "$1" in
+    -d)
+	DEVEL_MODE=y
+	echo "Devel mode!"
+	;;
+    -s)
+	SUCMD="su $PG_ROOT - "
+	;;
+    -h)
+	DB_HOST=$2
+	shift 1
+	;;
+    -p)
+	DB_PORT=$2
+	shift 1
+	;;
+    -U)
+	DB_USER=$2
+	shift 1
+	;;
+    -W)
+	DB_PASSWORD=$2
+	shift 1
+	;;
+    --in-su)
+	IN_SU=y
+	;;
+    esac
+    shift 1
+done
+
+if [ ! -f "/var/run/openerp-server-check" ] && [ -z "$DEVEL_MODE" ] ; then
+    # only run this if the magic file is there
+    exit 0
+fi
+
+if [ -n "$DEVEL_MODE" ] && [ -r ~/openerp-server.conf ] ; then
+    echo "Parsing" ~/openerp-server.conf
+    get_ini ~/openerp-server.conf
+elif [ -f "/etc/openerp-server.conf" ] ; then
+    get_ini "/etc/openerp-server.conf"
+else
+    echo "No config file, using defaults"
+fi
+
+if [ -n "$DEVEL_MODE" ] ; then
+    echo "Using:"
+    echo "DB_HOST=" $DB_HOST
+    echo "DB_PORT=" $DB_PORT
+    echo "DB_USER=" $DB_USER
+fi
+
+DB_CONNS= 
+if [ -n "$DB_HOST" ] ; then
+    DB_CONNS+=" --host $DB_HOST"
+fi
+if [ -n "$DB_PORT" ] ; then
+    DB_CONNS+=" --port $DB_PORT"
+fi
+
+if [ -n "$SUCMD"  ] ; then
+    CMD="$0 --in-su"
+    if [ -n "$DB_HOST" ] ; then 
+	CMD="$CMD -h $DB_HOST"
+    fi
+    if [ -n "$DB_PORT" ] ; then
+	CMD="$CMD -p $DB_PORT"
+    fi
+    if [ -n "$DB_PASSWORD" ] ; then
+	CMD="$CMD -W $DB_PASSWORD"
+    fi
+    su $PG_ROOT -c "$CMD" || "$?"
+    
+    if [ -z "$DEVEL_MODE" ] ; then
+	rm -f "/var/run/openerp-server-check"
+    fi
+    exit 0
+fi
+
+if ! (psql -qt -U $PG_ROOT $DB_CONNS -c "SELECT usename FROM pg_user WHERE usename = '$DB_USER';" | \
+	grep $DB_USER > /dev/null) ; then
+	if ! $SUCMD createuser -U $PG_ROOT $DB_CONNS -S -d -R -l $DB_USER < /dev/null ; then
+		echo "Failed to create user $DB_USER"
+		exit 1
+	fi
+else
+	echo "User $DB_USER already exists."
+fi
+
+echo "OK"
+if [ -z "$DEVEL_MODE" ] && [ -z "$IN_SU" ] ; then
+    rm -f "/var/run/openerp-server-check"
+fi
+
+#eof


Follow ups