[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha3-1686-g30f8d58

Jelmer Vernooij jelmer at samba.org
Wed May 21 23:49:39 GMT 2008


The branch, v4-0-test has been updated
       via  30f8d581aa339b37b27011e65355937590df10b9 (commit)
       via  453206665677821b254c18cc67192e007b892f04 (commit)
       via  cd8c8226784c96d7f1dbae006a4853eb50c7b2e2 (commit)
       via  0fae6f11081cff7846319175cfec95fa3911571c (commit)
       via  37ef86f8de9039b8226b190254d842e92b5faad7 (commit)
       via  9b39e99f48266a54ed0b8890c2efde218b4b118a (commit)
       via  ed38c668cdbe10966e46bad97301122eea8001d0 (commit)
       via  58665a8a8e4b10435aebbf2c95b6a8e50db232d6 (commit)
       via  b865249efaa58d0fc87fa25491fda3b970af81c3 (commit)
      from  76be51d3a08e2239a137b8abe3f2df722f69ddb2 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 30f8d581aa339b37b27011e65355937590df10b9
Merge: 453206665677821b254c18cc67192e007b892f04 76be51d3a08e2239a137b8abe3f2df722f69ddb2
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu May 22 01:48:20 2008 +0200

    Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test

commit 453206665677821b254c18cc67192e007b892f04
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu May 22 01:47:36 2008 +0200

    Fix python imports.

commit cd8c8226784c96d7f1dbae006a4853eb50c7b2e2
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu May 22 01:47:22 2008 +0200

    use one blackbox script per executable.

commit 0fae6f11081cff7846319175cfec95fa3911571c
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu May 22 01:17:30 2008 +0200

    Fix events test.

commit 37ef86f8de9039b8226b190254d842e92b5faad7
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu May 22 00:56:36 2008 +0200

    Fix dependencies and imports.

commit 9b39e99f48266a54ed0b8890c2efde218b4b118a
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed May 21 23:59:34 2008 +0200

    Move more modules inside of the samba package.

commit ed38c668cdbe10966e46bad97301122eea8001d0
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed May 21 21:50:56 2008 +0200

    Move some python files into the samba package.

commit 58665a8a8e4b10435aebbf2c95b6a8e50db232d6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed May 21 21:32:53 2008 +0200

    Move CFLAGS overrides for SWIG modules to Makefile.

commit b865249efaa58d0fc87fa25491fda3b970af81c3
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Wed May 21 21:24:48 2008 +0200

    Remove support for .py files from smb_build - deal with it only in the makefiles.

-----------------------------------------------------------------------

Summary of changes:
 source/auth/config.mk                              |    6 ++-
 source/auth/credentials/config.mk                  |    6 ++-
 source/auth/credentials/credentials.py             |    2 +-
 source/auth/credentials/credentials_wrap.c         |   65 ++++++++++++++------
 source/auth/credentials/tests/bindings.py          |    2 +-
 source/auth/tests/bindings.py                      |    2 +-
 source/build/smb_build/config_mk.pm                |    2 +-
 source/build/smb_build/input.pm                    |   20 +-----
 source/build/smb_build/main.pl                     |    1 -
 source/build/smb_build/makefile.pm                 |    9 ---
 source/lib/events/config.mk                        |    6 ++-
 source/lib/events/tests.py                         |    2 +-
 source/lib/ldb/python.mk                           |    6 ++-
 source/lib/ldb/tests/python/ldap.py                |    4 +-
 source/lib/registry/config.mk                      |    6 ++-
 source/lib/registry/tests/bindings.py              |    2 +-
 source/lib/tdb/python.mk                           |    7 ++-
 source/libcli/config.mk                            |   13 +++-
 source/libcli/security/config.mk                   |    6 ++-
 source/libcli/security/tests/bindings.py           |    2 +-
 source/libnet/config.mk                            |    1 +
 source/librpc/config.mk                            |   41 +++++++++---
 source/librpc/rpc/dcerpc.py                        |    4 +-
 source/librpc/rpc/dcerpc_wrap.c                    |   65 ++++++++++++++------
 source/param/config.mk                             |    6 ++-
 source/param/tests/bindings.py                     |    2 +-
 source/scripting/bin/subunitrun                    |    2 +-
 source/scripting/python/config.mk                  |   13 +++-
 .../python/samba/tests/dcerpc/registry.py          |    2 +-
 .../scripting/python/samba/tests/dcerpc/rpcecho.py |    2 +-
 source/scripting/python/samba/tests/dcerpc/sam.py  |    2 +-
 source/scripting/python/samba/tests/dcerpc/unix.py |    2 +-
 source/selftest/samba4_tests.sh                    |    2 +
 source/setup/enableaccount                         |    2 +-
 source/setup/newuser                               |    2 +-
 source/setup/provision                             |    4 +-
 source/setup/setpassword                           |    7 ++-
 source/setup/tests/blackbox_newuser.sh             |   21 ++++++
 source/setup/tests/blackbox_provision.sh           |   19 +------
 source/setup/tests/blackbox_setpassword.sh         |   22 +++++++
 source/setup/upgrade                               |    4 +-
 41 files changed, 263 insertions(+), 131 deletions(-)
 create mode 100755 source/setup/tests/blackbox_newuser.sh
 create mode 100755 source/setup/tests/blackbox_setpassword.sh


Changeset truncated at 500 lines:

diff --git a/source/auth/config.mk b/source/auth/config.mk
index 7d31a6a..0f8b23e 100644
--- a/source/auth/config.mk
+++ b/source/auth/config.mk
@@ -37,8 +37,12 @@ auth_sam_reply_OBJ_FILES = $(addprefix $(authsrcdir)/, auth_sam_reply.o)
 $(eval $(call proto_header_template,$(authsrcdir)/auth_sam_reply.h,$(auth_sam_reply_OBJ_FILES:.o=.c)))
 
 [PYTHON::swig_auth]
+LIBRARY_REALNAME = samba/_auth.$(SHLIBEXT)
 PUBLIC_DEPENDENCIES = auth_system_session
 PRIVATE_DEPENDENCIES = SAMDB 
-SWIG_FILE = auth.i
+
+$(eval $(call python_py_module_template,samba/auth.py,$(authsrcdir)/auth.py))
 
 swig_auth_OBJ_FILES = $(authsrcdir)/auth_wrap.o
+
+$(swig_auth_OBJ_FILES): CFLAGS+="$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)"
diff --git a/source/auth/credentials/config.mk b/source/auth/credentials/config.mk
index d71a823..2eeeec2 100644
--- a/source/auth/credentials/config.mk
+++ b/source/auth/credentials/config.mk
@@ -14,7 +14,11 @@ $(eval $(call proto_header_template,$(authsrcdir)/credentials/credentials_proto.
 PUBLIC_HEADERS += $(authsrcdir)/credentials/credentials.h
 
 [PYTHON::swig_credentials]
+LIBRARY_REALNAME = samba/_credentials.$(SHLIBEXT)
 PUBLIC_DEPENDENCIES = CREDENTIALS LIBCMDLINE_CREDENTIALS
-SWIG_FILE = credentials.i
+
+$(eval $(call python_py_module_template,samba/credentials.py,$(authsrcdir)/credentials/credentials.py))
 
 swig_credentials_OBJ_FILES = $(authsrcdir)/credentials/credentials_wrap.o
+
+$(swig_credentials_OBJ_FILES): CFLAGS+=$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)
diff --git a/source/auth/credentials/credentials.py b/source/auth/credentials/credentials.py
index ba0000d..b2f2c4e 100644
--- a/source/auth/credentials/credentials.py
+++ b/source/auth/credentials/credentials.py
@@ -1,5 +1,5 @@
 # This file was automatically generated by SWIG (http://www.swig.org).
-# Version 1.3.33
+# Version 1.3.35
 #
 # Don't modify this file, modify the SWIG interface instead.
 
diff --git a/source/auth/credentials/credentials_wrap.c b/source/auth/credentials/credentials_wrap.c
index 6c99802..d460f31 100644
--- a/source/auth/credentials/credentials_wrap.c
+++ b/source/auth/credentials/credentials_wrap.c
@@ -1,6 +1,6 @@
 /* ----------------------------------------------------------------------------
  * This file was automatically generated by SWIG (http://www.swig.org).
- * Version 1.3.33
+ * Version 1.3.35
  * 
  * This file is not intended to be easily readable and contains a number of 
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -126,7 +126,7 @@
 
 /* This should only be incremented when either the layout of swig_type_info changes,
    or for whatever reason, the runtime changes incompatibly */
-#define SWIG_RUNTIME_VERSION "3"
+#define SWIG_RUNTIME_VERSION "4"
 
 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
 #ifdef SWIG_TYPE_TABLE
@@ -161,6 +161,7 @@
 
 /* Flags for pointer conversions */
 #define SWIG_POINTER_DISOWN        0x1
+#define SWIG_CAST_NEW_MEMORY       0x2
 
 /* Flags for new pointer objects */
 #define SWIG_POINTER_OWN           0x1
@@ -301,10 +302,10 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
 extern "C" {
 #endif
 
-typedef void *(*swig_converter_func)(void *);
+typedef void *(*swig_converter_func)(void *, int *);
 typedef struct swig_type_info *(*swig_dycast_func)(void **);
 
-/* Structure to store inforomation on one type */
+/* Structure to store information on one type */
 typedef struct swig_type_info {
   const char             *name;			/* mangled name of this type */
   const char             *str;			/* human readable name of this type */
@@ -431,8 +432,8 @@ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
   Cast a pointer up an inheritance hierarchy
 */
 SWIGRUNTIMEINLINE void *
-SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
-  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 }
 
 /* 
@@ -856,7 +857,7 @@ SWIG_Python_AddErrorMsg(const char* mesg)
     Py_DECREF(old_str);
     Py_DECREF(value);
   } else {
-    PyErr_Format(PyExc_RuntimeError, mesg);
+    PyErr_SetString(PyExc_RuntimeError, mesg);
   }
 }
 
@@ -1416,7 +1417,7 @@ PySwigObject_dealloc(PyObject *v)
 {
   PySwigObject *sobj = (PySwigObject *) v;
   PyObject *next = sobj->next;
-  if (sobj->own) {
+  if (sobj->own == SWIG_POINTER_OWN) {
     swig_type_info *ty = sobj->ty;
     PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
     PyObject *destroy = data ? data->destroy : 0;
@@ -1434,12 +1435,13 @@ PySwigObject_dealloc(PyObject *v)
 	res = ((*meth)(mself, v));
       }
       Py_XDECREF(res);
-    } else {
-      const char *name = SWIG_TypePrettyName(ty);
+    } 
 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
-      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
-#endif
+    else {
+      const char *name = SWIG_TypePrettyName(ty);
+      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
     }
+#endif
   } 
   Py_XDECREF(next);
   PyObject_DEL(v);
@@ -1944,7 +1946,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj)
 
 SWIGRUNTIME int
 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
-  if (own) {
+  if (own == SWIG_POINTER_OWN) {
     PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
     if (sobj) {
       int oldown = sobj->own;
@@ -1965,6 +1967,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
     return SWIG_OK;
   } else {
     PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    if (own)
+      *own = 0;
     while (sobj) {
       void *vptr = sobj->ptr;
       if (ty) {
@@ -1978,7 +1982,15 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
 	  if (!tc) {
 	    sobj = (PySwigObject *)sobj->next;
 	  } else {
-	    if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
+	    if (ptr) {
+              int newmemory = 0;
+              *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+              if (newmemory == SWIG_CAST_NEW_MEMORY) {
+                assert(own);
+                if (own)
+                  *own = *own | SWIG_CAST_NEW_MEMORY;
+              }
+            }
 	    break;
 	  }
 	}
@@ -1988,7 +2000,8 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int
       }
     }
     if (sobj) {
-      if (own) *own = sobj->own;
+      if (own)
+        *own = *own | sobj->own;
       if (flags & SWIG_POINTER_DISOWN) {
 	sobj->own = 0;
       }
@@ -2053,8 +2066,13 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
     }
     if (ty) {
       swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
-      if (!tc) return SWIG_ERROR;
-      *ptr = SWIG_TypeCast(tc,vptr);
+      if (tc) {
+        int newmemory = 0;
+        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+        assert(!newmemory); /* newmemory handling not yet implemented */
+      } else {
+        return SWIG_ERROR;
+      }
     } else {
       *ptr = vptr;
     }
@@ -2506,7 +2524,7 @@ static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
 
 #define SWIG_name    "_credentials"
 
-#define SWIGVERSION 0x010333 
+#define SWIGVERSION 0x010335 
 #define SWIG_VERSION SWIGVERSION
 
 
@@ -3845,7 +3863,7 @@ SWIGRUNTIME void
 SWIG_InitializeModule(void *clientdata) {
   size_t i;
   swig_module_info *module_head, *iter;
-  int found;
+  int found, init;
   
   clientdata = clientdata;
   
@@ -3855,6 +3873,9 @@ SWIG_InitializeModule(void *clientdata) {
     swig_module.type_initial = swig_type_initial;
     swig_module.cast_initial = swig_cast_initial;
     swig_module.next = &swig_module;
+    init = 1;
+  } else {
+    init = 0;
   }
   
   /* Try and load any already created modules */
@@ -3883,6 +3904,12 @@ SWIG_InitializeModule(void *clientdata) {
     module_head->next = &swig_module;
   }
   
+  /* When multiple interpeters are used, a module could have already been initialized in
+       a different interpreter, but not yet have a pointer in this interpreter.
+       In this case, we do not want to continue adding types... everything should be
+       set up already */
+  if (init == 0) return;
+  
   /* Now work on filling in swig_module.types */
 #ifdef SWIGRUNTIME_DEBUG
   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
diff --git a/source/auth/credentials/tests/bindings.py b/source/auth/credentials/tests/bindings.py
index d0a9950..30120b3 100644
--- a/source/auth/credentials/tests/bindings.py
+++ b/source/auth/credentials/tests/bindings.py
@@ -24,7 +24,7 @@ the functionality, that's already done in other tests.
 """
 
 import unittest
-import credentials
+from samba import credentials
 
 class CredentialsTests(unittest.TestCase):
     def setUp(self):
diff --git a/source/auth/tests/bindings.py b/source/auth/tests/bindings.py
index 4a4b12b..b7a5994 100644
--- a/source/auth/tests/bindings.py
+++ b/source/auth/tests/bindings.py
@@ -24,7 +24,7 @@ the functionality, that's already done in other tests.
 """
 
 import unittest
-import auth
+from samba import auth
 
 class AuthTests(unittest.TestCase):
     def test_system_session(self):
diff --git a/source/build/smb_build/config_mk.pm b/source/build/smb_build/config_mk.pm
index d28adb2..652a52f 100644
--- a/source/build/smb_build/config_mk.pm
+++ b/source/build/smb_build/config_mk.pm
@@ -20,7 +20,7 @@ my $section_types = {
 		"LDFLAGS"		=> "list",
 		},
 	"PYTHON" => {
-		SWIG_FILE => "string",
+		"LIBRARY_REALNAME" => "string",
 		"PRIVATE_DEPENDENCIES"	=> "list",
 		"PUBLIC_DEPENDENCIES"	=> "list",
 		"ENABLE"		=> "bool",
diff --git a/source/build/smb_build/input.pm b/source/build/smb_build/input.pm
index 7028d2a..a76da49 100644
--- a/source/build/smb_build/input.pm
+++ b/source/build/smb_build/input.pm
@@ -138,24 +138,12 @@ sub check_python($$$)
 
 	$python->{INSTALLDIR} = "PYTHONDIR";
 	unless (defined($python->{CFLAGS})) { $python->{CFLAGS} = []; }
-	if (defined($python->{SWIG_FILE})) {
-		my $dirname = dirname($python->{SWIG_FILE});
-		my $basename = basename($python->{SWIG_FILE}, ".i");
-
-		$dirname .= "/" unless $dirname =~ /\/$/;
-		$dirname = "" if $dirname eq "./";
-
-		$python->{LIBRARY_REALNAME} = "_$basename.\$(SHLIBEXT)";
-		$python->{PYTHON_FILES} = ["$dirname$basename.py"];
-		push (@{$python->{CFLAGS}}, "\$(CFLAG_NO_UNUSED_MACROS)");
-		push (@{$python->{CFLAGS}}, "\$(CFLAG_NO_CAST_QUAL)");
-		$python->{INIT_FUNCTION} = "{ (char *)\"_$basename\", init_$basename }";
-	} else {
-		my $basename = $python->{NAME};
-		$basename =~ s/^python_//g;
+	my $basename = $python->{NAME};
+	$basename =~ s/^python_//g;
+	unless (defined($python->{LIBRARY_REALNAME})) {
 		$python->{LIBRARY_REALNAME} = "$basename.\$(SHLIBEXT)";
-		$python->{INIT_FUNCTION} = "{ (char *)\"$basename\", init$basename }";
 	}
+	$python->{INIT_FUNCTION} = "{ (char *)\"$basename\", init$basename }";
 	push (@{$python->{CFLAGS}}, "\$(EXT_LIB_PYTHON_CFLAGS)");
 
 	$python->{SUBSYSTEM} = "LIBPYTHON";
diff --git a/source/build/smb_build/main.pl b/source/build/smb_build/main.pl
index b31bfaa..88289af 100644
--- a/source/build/smb_build/main.pl
+++ b/source/build/smb_build/main.pl
@@ -70,7 +70,6 @@ foreach my $key (values %$OUTPUT) {
 	    ${$key->{OUTPUT_TYPE}}[0] eq "SHARED_LIBRARY") {
 		$shared_libs_used = 1;
 	}
-	$mkenv->PythonFiles($key) if defined($key->{PYTHON_FILES});
 	if ($key->{TYPE} eq "MODULE" and @{$key->{OUTPUT_TYPE}}[0] eq "MERGED_OBJ" and defined($key->{INIT_FUNCTION})) {
 		$mkenv->output("$key->{SUBSYSTEM}_INIT_FUNCTIONS += $key->{INIT_FUNCTION},\n");
 	}
diff --git a/source/build/smb_build/makefile.pm b/source/build/smb_build/makefile.pm
index a0fee27..0269cfe 100644
--- a/source/build/smb_build/makefile.pm
+++ b/source/build/smb_build/makefile.pm
@@ -214,15 +214,6 @@ $self->output("\$(call binary_link_template, $ctx->{RESULT_BINARY}, \$($ctx->{NA
 	}
 }
 
-sub PythonFiles($$)
-{
-	my ($self,$ctx) = @_;
-
-	foreach (@{$ctx->{PYTHON_FILES}}) {
-		$self->output("\$(eval \$(call python_py_module_template," . basename($_) . ",\$(addprefix $ctx->{BASEDIR}/, $_)))\n");
-	}
-}
-
 sub write($$)
 {
 	my ($self, $file) = @_;
diff --git a/source/lib/events/config.mk b/source/lib/events/config.mk
index 3a20770..ca47f0d 100644
--- a/source/lib/events/config.mk
+++ b/source/lib/events/config.mk
@@ -52,7 +52,11 @@ LIBEVENTS_OBJ_FILES = $(addprefix $(libeventssrcdir)/, events.o events_timed.o e
 PUBLIC_HEADERS += $(addprefix $(libeventssrcdir)/, events.h events_internal.h)
 
 [PYTHON::swig_events]
-SWIG_FILE = events.i
+LIBRARY_REALNAME = samba/_events.$(SHLIBEXT)
 PRIVATE_DEPENDENCIES = LIBEVENTS LIBSAMBA-HOSTCONFIG
 
 swig_events_OBJ_FILES = $(libeventssrcdir)/events_wrap.o
+
+$(eval $(call python_py_module_template,samba/events.py,$(libeventssrcdir)/events.py))
+
+$(swig_events_OBJ_FILES): CFLAGS+="$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)"
diff --git a/source/lib/events/tests.py b/source/lib/events/tests.py
index b14f7e6..0064262 100644
--- a/source/lib/events/tests.py
+++ b/source/lib/events/tests.py
@@ -17,7 +17,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import events
+from samba import events
 import unittest
 
 # Just test the bindings are there and that calling them doesn't crash
diff --git a/source/lib/ldb/python.mk b/source/lib/ldb/python.mk
index 448cc3e..7b430f4 100644
--- a/source/lib/ldb/python.mk
+++ b/source/lib/ldb/python.mk
@@ -1,6 +1,10 @@
 [PYTHON::swig_ldb]
+LIBRARY_REALNAME = _ldb.$(SHLIBEXT)
 PUBLIC_DEPENDENCIES = LIBLDB
 CFLAGS = -Ilib/ldb/include
-SWIG_FILE = ldb.i
 
 swig_ldb_OBJ_FILES = lib/ldb/ldb_wrap.o
+
+$(eval $(call python_py_module_template,ldb.py,lib/ldb/ldb.py))
+
+$(swig_ldb_OBJ_FILES): CFLAGS+="$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)"
diff --git a/source/lib/ldb/tests/python/ldap.py b/source/lib/ldb/tests/python/ldap.py
index 7cbe6e5..c76222c 100755
--- a/source/lib/ldb/tests/python/ldap.py
+++ b/source/lib/ldb/tests/python/ldap.py
@@ -10,14 +10,14 @@ sys.path.append("bin/python")
 
 import samba.getopt as options
 
-from auth import system_session
+from samba.auth import system_session
 from ldb import (SCOPE_SUBTREE, SCOPE_ONELEVEL, SCOPE_BASE, LdbError,
                  LDB_ERR_NO_SUCH_OBJECT, LDB_ERR_ATTRIBUTE_OR_VALUE_EXISTS,
                  LDB_ERR_ENTRY_ALREADY_EXISTS, LDB_ERR_UNWILLING_TO_PERFORM,
                  LDB_ERR_NOT_ALLOWED_ON_NON_LEAF, LDB_ERR_OTHER)
 from samba import Ldb
 from subunit import SubunitTestRunner
-import param
+from samba import param
 import unittest
 
 parser = optparse.OptionParser("ldap [options] <host>")
diff --git a/source/lib/registry/config.mk b/source/lib/registry/config.mk
index c0ad613..90618ff 100644
--- a/source/lib/registry/config.mk
+++ b/source/lib/registry/config.mk
@@ -105,7 +105,11 @@ torture_registry_OBJ_FILES = $(addprefix $(libregistrysrcdir)/tests/, generic.o
 $(eval $(call proto_header_template,$(libregistrysrcdir)/tests/proto.h,$(torture_registry_OBJ_FILES:.o=.c)))
 
 [PYTHON::swig_registry]
+LIBRARY_REALNAME = samba/_registry.$(SHLIBEXT)
 PUBLIC_DEPENDENCIES = registry
-SWIG_FILE = registry.i
 
 swig_registry_OBJ_FILES = $(libregistrysrcdir)/registry_wrap.o
+
+$(eval $(call python_py_module_template,samba/registry.py,lib/registry/registry.py))
+
+$(swig_registry_OBJ_FILES): CFLAGS+="$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)"
diff --git a/source/lib/registry/tests/bindings.py b/source/lib/registry/tests/bindings.py
index 314cf77..1fb5c70 100644
--- a/source/lib/registry/tests/bindings.py
+++ b/source/lib/registry/tests/bindings.py
@@ -19,7 +19,7 @@
 
 import os
 import unittest
-import registry
+from samba import registry
 import samba.tests
 
 class HelperTests(unittest.TestCase):
diff --git a/source/lib/tdb/python.mk b/source/lib/tdb/python.mk
index 2d61545..e71a60f 100644
--- a/source/lib/tdb/python.mk
+++ b/source/lib/tdb/python.mk
@@ -1,5 +1,10 @@
 [PYTHON::swig_tdb]
-SWIG_FILE = tdb.i
+LIBRARY_REALNAME = _tdb.$(SHLIBEXT)
 PUBLIC_DEPENDENCIES = LIBTDB DYNCONFIG
 
 swig_tdb_OBJ_FILES = lib/tdb/tdb_wrap.o
+
+$(eval $(call python_py_module_template,tdb.py,lib/tdb/tdb.py))
+
+$(swig_tdb_OBJ_FILES): CFLAGS+="$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)"
+
diff --git a/source/libcli/config.mk b/source/libcli/config.mk
index 16e2343..ee8d6b2 100644
--- a/source/libcli/config.mk
+++ b/source/libcli/config.mk
@@ -75,17 +75,26 @@ LIBCLI_NETLOGON_OBJ_FILES = $(addprefix libcli/, \
 $(eval $(call proto_header_template,$(libclisrcdir)/netlogon_proto.h,$(LIBCLI_NETLOGON_OBJ_FILES:.o=.c)))
 
 [PYTHON::python_libcli_nbt]
-SWIG_FILE = swig/libcli_nbt.i
+LIBRARY_REALNAME = samba/_libcli_nbt.$(SHLIBEXT)
 PUBLIC_DEPENDENCIES = LIBCLI_NBT DYNCONFIG LIBSAMBA-HOSTCONFIG
 
 python_libcli_nbt_OBJ_FILES = $(libclisrcdir)/swig/libcli_nbt_wrap.o
 
+$(eval $(call python_py_module_template,samba/nbt.py,$(libclisrcdir)/swig/libcli_nbt.py))
+
+$(python_libcli_nbt_OBJ_FILES): CFLAGS+="$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)"
+
 [PYTHON::python_libcli_smb]
-SWIG_FILE = swig/libcli_smb.i
+LIBRARY_REALNAME = samba/_libcli_smb.$(SHLIBEXT)
 PUBLIC_DEPENDENCIES = LIBCLI_SMB DYNCONFIG LIBSAMBA-HOSTCONFIG
 
 python_libcli_smb_OBJ_FILES = $(libclisrcdir)/swig/libcli_smb_wrap.o
 
+$(eval $(call python_py_module_template,samba/smb.py,$(libclisrcdir)/swig/libcli_smb.py))
+
+$(python_libcli_smb_OBJ_FILES): CFLAGS+="$(CFLAG_NO_UNUSED_MACROS) $(CFLAG_NO_CAST_QUAL)"
+
+
 [SUBSYSTEM::LIBCLI_DGRAM]
 PUBLIC_DEPENDENCIES = LIBCLI_NBT LIBNDR LIBCLI_RESOLVE LIBCLI_NETLOGON
 
diff --git a/source/libcli/security/config.mk b/source/libcli/security/config.mk
index 63e54fa..82fe8f1 100644
--- a/source/libcli/security/config.mk
+++ b/source/libcli/security/config.mk
@@ -8,7 +8,11 @@ LIBSECURITY_OBJ_FILES = $(addprefix $(libclisrcdir)/security/, \
 $(eval $(call proto_header_template,$(libclisrcdir)/security/proto.h,$(LIBSECURITY_OBJ_FILES:.o=.c)))
 
 [PYTHON::swig_security]
-SWIG_FILE = security.i
+LIBRARY_REALNAME = samba/_security.$(SHLIBEXT)
 PRIVATE_DEPENDENCIES = LIBSECURITY
 
 swig_security_OBJ_FILES = $(libclisrcdir)/security/security_wrap.o


-- 
Samba Shared Repository


More information about the samba-cvs mailing list