Author: jelmer
Date: 2007-12-23 22:06:29 +0000 (Sun, 23 Dec 2007)
New Revision: 26575

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26575

Log:
Build a private copy of the Python executable for Samba 4, so we know we're 
always using the same library we build the modules for.
Added:
   branches/SAMBA_4_0/source/scripting/python/smbpython.c
Modified:
   branches/SAMBA_4_0/
   branches/SAMBA_4_0/source/scripting/python/config.m4
   branches/SAMBA_4_0/source/scripting/python/config.mk
   branches/SAMBA_4_0/source/selftest/samba4_tests.sh


Changeset:

Property changes on: branches/SAMBA_4_0
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:file-ids
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/SAMBA_4_0/source/scripting/python/config.m4
===================================================================
--- branches/SAMBA_4_0/source/scripting/python/config.m4        2007-12-23 
22:03:31 UTC (rev 26574)
+++ branches/SAMBA_4_0/source/scripting/python/config.m4        2007-12-23 
22:06:29 UTC (rev 26575)
@@ -41,9 +41,11 @@
                        Py_InitModule(NULL, NULL);
                ],[
                        SMB_ENABLE(LIBPYTHON,YES)
+                       SMB_ENABLE(smbpython,YES)
                        AC_MSG_RESULT([yes])
                ],[
                        SMB_ENABLE(LIBPYTHON,NO)
+                       SMB_ENABLE(smbpython,NO)
                        AC_MSG_RESULT([no])
                ])
 
@@ -51,5 +53,6 @@
        CFLAGS="$ac_save_CFLAGS"
 else
        SMB_ENABLE(LIBPYTHON,NO)
+       SMB_ENABLE(smbpython,NO)
        AC_MSG_RESULT([no])
 fi

Modified: branches/SAMBA_4_0/source/scripting/python/config.mk
===================================================================
--- branches/SAMBA_4_0/source/scripting/python/config.mk        2007-12-23 
22:03:31 UTC (rev 26574)
+++ branches/SAMBA_4_0/source/scripting/python/config.mk        2007-12-23 
22:06:29 UTC (rev 26575)
@@ -1,3 +1,8 @@
+[BINARY::smbpython]
+PRIVATE_DEPENDENCIES = LIBPYTHON
+OBJ_FILES = \
+                       smbpython.o
+
 [PYTHON::python_uuid]
 PRIVATE_DEPENDENCIES = LIBNDR 
 OBJ_FILES = uuidmodule.o

Added: branches/SAMBA_4_0/source/scripting/python/smbpython.c
===================================================================
--- branches/SAMBA_4_0/source/scripting/python/smbpython.c      2007-12-23 
22:03:31 UTC (rev 26574)
+++ branches/SAMBA_4_0/source/scripting/python/smbpython.c      2007-12-23 
22:06:29 UTC (rev 26575)
@@ -0,0 +1,25 @@
+/* 
+   Unix SMB/CIFS implementation.
+   Samba utility functions
+   Copyright (C) Jelmer Vernooij <[EMAIL PROTECTED]> 2007
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include <Python.h>
+
+int main(int argc, char **argv) {
+       return Py_Main(argc,argv);
+}

Modified: branches/SAMBA_4_0/source/selftest/samba4_tests.sh
===================================================================
--- branches/SAMBA_4_0/source/selftest/samba4_tests.sh  2007-12-23 22:03:31 UTC 
(rev 26574)
+++ branches/SAMBA_4_0/source/selftest/samba4_tests.sh  2007-12-23 22:06:29 UTC 
(rev 26575)
@@ -285,20 +285,20 @@
 fi
 
 # if python is available, run the python tests:
-if which python 2>/dev/null >/dev/null
+if test -f $samba4bindir/smbpython
 then
-       PYTHON=python
-       plantest "ldb.python" none 
PYTHONPATH=bin/python:scripting/python:lib/ldb/tests/python/ 
scripting/bin/subunitrun api
-       plantest "credentials.python" none 
PYTHONPATH=bin/python:scripting/python:auth/credentials/tests 
scripting/bin/subunitrun bindings
-       plantest "registry.python" none 
PYTHONPATH=bin/python:scripting/python:lib/registry/tests/ 
scripting/bin/subunitrun bindings
-       plantest "tdb.python" none 
PYTHONPATH=bin/python:scripting/python:lib/tdb/python/tests 
scripting/bin/subunitrun simple
-       plantest "auth.python" none 
PYTHONPATH=bin/python:scripting/python:auth/tests/ scripting/bin/subunitrun 
bindings
-       plantest "security.python" none 
PYTHONPATH=bin/python:scripting/python:libcli/security/tests/ 
scripting/bin/subunitrun bindings
-       plantest "param.python" none 
PYTHONPATH=bin/python:scripting/python:param/tests scripting/bin/subunitrun 
bindings
-       plantest "upgrade.python" none PYTHONPATH=bin/python:scripting/python 
scripting/bin/subunitrun samba.tests.upgrade
-       plantest "samba.python" none PYTHONPATH=bin/python:scripting/python 
scripting/bin/subunitrun samba.tests
-       plantest "provision.python" none PYTHONPATH=bin/python:scripting/python 
scripting/bin/subunitrun samba.tests.provision
-       plantest "samba3.python" none PYTHONPATH=bin/python:scripting/python 
scripting/bin/subunitrun samba.tests.samba3
+       PYTHON=bin/smbpython
+       plantest "ldb.python" none 
PYTHONPATH=bin/python:scripting/python:lib/ldb/tests/python/ $PYTHON 
scripting/bin/subunitrun api
+       plantest "credentials.python" none 
PYTHONPATH=bin/python:scripting/python:auth/credentials/tests $PYTHON 
scripting/bin/subunitrun bindings
+       plantest "registry.python" none 
PYTHONPATH=bin/python:scripting/python:lib/registry/tests/ $PYTHON 
scripting/bin/subunitrun bindings
+       plantest "tdb.python" none 
PYTHONPATH=bin/python:scripting/python:lib/tdb/python/tests $PYTHON 
scripting/bin/subunitrun simple
+       plantest "auth.python" none 
PYTHONPATH=bin/python:scripting/python:auth/tests/ $PYTHON 
scripting/bin/subunitrun bindings
+       plantest "security.python" none 
PYTHONPATH=bin/python:scripting/python:libcli/security/tests/ $PYTHON 
scripting/bin/subunitrun bindings
+       plantest "param.python" none 
PYTHONPATH=bin/python:scripting/python:param/tests $PYTHON 
scripting/bin/subunitrun bindings
+       plantest "upgrade.python" none PYTHONPATH=bin/python:scripting/python 
$PYTHON scripting/bin/subunitrun samba.tests.upgrade
+       plantest "samba.python" none PYTHONPATH=bin/python:scripting/python 
$PYTHON scripting/bin/subunitrun samba.tests
+       plantest "provision.python" none PYTHONPATH=bin/python:scripting/python 
$PYTHON scripting/bin/subunitrun samba.tests.provision
+       plantest "samba3.python" none PYTHONPATH=bin/python:scripting/python 
$PYTHON scripting/bin/subunitrun samba.tests.samba3
        plantest "samba3sam.python" none PYTHONPATH=bin/python:scripting/python 
$PYTHON dsdb/samdb/ldb_modules/tests/samba3sam.py `pwd` $DATADIR/samba3/
        plantest "ldap.python" dc $PYTHON 
$samba4srcdir/lib/ldb/tests/python/ldap.py \$SERVER -U\$USERNAME%\$PASSWORD
 fi

Reply via email to