s4-python: Install external included packages only if they're not present on the...
authorJelmer Vernooij <jelmer@samba.org>
Wed, 31 Mar 2010 01:56:24 +0000 (03:56 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 31 Mar 2010 01:56:24 +0000 (03:56 +0200)
source4/lib/ldb/tests/python/deletetest.py
source4/lib/ldb/tests/python/urgent_replication.py
source4/script/installmisc.sh
source4/scripting/python/config.mk
source4/scripting/python/samba_external/missing.py
source4/selftest/tests.sh

index 13bec7efae56569453e9bd3d925261b271855ab1..eff92c5f339e5c762881d512baa135e7fc2d2b37 100755 (executable)
@@ -8,6 +8,7 @@ import os
 
 sys.path.append("bin/python")
 sys.path.append("../lib/subunit/python")
+sys.path.append("../lib/testtools")
 
 import samba.getopt as options
 
index b8df072bf3f596263cb0c7e0793668dff4413460..28b3a5fa781a6c9ee69a146b527d2d98918f42b4 100755 (executable)
@@ -2,16 +2,13 @@
 # -*- coding: utf-8 -*-
 # This is a port of the original in testprogs/ejs/ldap.js
 
-import getopt
 import optparse
 import sys
-import time
-import random
-import base64
 import os
 
 sys.path.append("bin/python")
 sys.path.append("../lib/subunit/python")
+sys.path.append("../lib/testtools")
 
 import samba.getopt as options
 
@@ -26,9 +23,6 @@ from samba import glue
 from subunit.run import SubunitTestRunner
 import unittest
 
-from samba.ndr import ndr_pack, ndr_unpack
-from samba.dcerpc import security
-
 parser = optparse.OptionParser("urgent_replication [options] <host>")
 sambaopts = options.SambaOptions(parser)
 parser.add_option_group(sambaopts)
index ddc25d3edca42d089575bf7419161be18d1dcf51..6a53b988f5ce3593b941cb1c495bb15d3c41f49e 100755 (executable)
@@ -82,12 +82,13 @@ cp setup/provision.smb.conf.member $SETUPDIR || exit 1
 cp setup/provision.smb.conf.standalone $SETUPDIR || exit 1
 
 echo "Installing external python libraries"
-mkdir -p $DESTDIR$PYTHONDIR/samba_external || exit 1
+mkdir -p $DESTDIR$PYTHONDIR || exit 1
 for p in $($PYTHON scripting/python/samba_external/missing.py);
 do
-  echo "Installing missing python library $p"
-  mkdir -p $DESTDIR$PYTHONDIR/samba_external/$p
-  cp -r ../lib/$p/* $DESTDIR$PYTHONDIR/samba_external/$p/ || exit 1
+  package=`basename $p`
+  echo "Installing missing python package $package"
+  mkdir -p $DESTDIR$PYTHONDIR/$package
+  cp -r ../lib/$p/* $DESTDIR$PYTHONDIR/$package/ || exit 1
 done
 
 echo "Installing stuff in $PRIVATEDIR"
index d36e136346045500d047d7928ed4be93640fd536..db35669e1ab22293ff68d05183497f1a1aa687d4 100644 (file)
@@ -23,9 +23,9 @@ python_glue_OBJ_FILES = $(pyscriptsrcdir)/pyglue.o
 
 $(python_glue_OBJ_FILES): CFLAGS+=-I$(ldbsrcdir)
 
-_PY_FILES = $(shell find $(pyscriptsrcdir)/samba ../lib/subunit/python -type f -name "*.py")
+_PY_FILES = $(shell find $(pyscriptsrcdir)/samba -type f -name "*.py")
 
-$(eval $(foreach pyfile, $(_PY_FILES),$(call python_py_module_template,$(patsubst $(pyscriptsrcdir)/%,%,$(subst ../lib/subunit/python,,$(pyfile))),$(pyfile))))
+$(eval $(foreach pyfile, $(_PY_FILES),$(call python_py_module_template,$(patsubst $(pyscriptsrcdir)/%,%,$(pyfile)),$(pyfile))))
 
 PYDOCTOR = pydoctor
 PYDOCTOR_OPTIONS = --project-name Samba --project-url http://www.samba.org/ \
index 082afd839715cdca97e2ce1d9adc68ea76a8546b..d3dd2b9290f46744f7c7f4b0d3b327db4ac6ad6e 100755 (executable)
@@ -1,11 +1,10 @@
 #!/usr/bin/python
 
 # work out what python external libraries we need to install
-
 external_libs = {
-    "dns.resolver": "dnspython", 
-    "subunit": "subunit",
-    "testtools": "testtools"}
+    "dns.resolver": "dnspython/dns", 
+    "subunit": "subunit/python/subunit",
+    "testtools": "testtools/testtools"}
 
 list = []
 
index f832b4f15ed84067f8d1ac23269ff37a551edb0d..bf6127f4a5a58909945475f2351b23de6fe4e05e 100755 (executable)
@@ -85,7 +85,7 @@ smb4torture="$samba4bindir/smbtorture${EXEEXT}"
 if which tap2subunit 2>/dev/null; then
        TAP2SUBUNIT=tap2subunit
 else
-       TAP2SUBUNIT="PYTHONPATH=$samba4srcdir/../lib/subunit/python $PYTHON $samba4srcdir/../lib/subunit/filters/tap2subunit"
+       TAP2SUBUNIT="PYTHONPATH=$samba4srcdir/../lib/subunit/python:$samba4srcdir/../lib/testtools $PYTHON $samba4srcdir/../lib/subunit/filters/tap2subunit"
 fi
 $smb4torture -V
 
@@ -466,15 +466,15 @@ plantest "samba3sam.python" none PYTHONPATH="$PYTHONPATH:$samba4srcdir/dsdb/samd
 plantest "subunit.python" none $SUBUNITRUN subunit
 plantest "rpcecho.python" dc:local $SUBUNITRUN samba.tests.dcerpc.rpcecho
 plantest "winreg.python" dc:local $SUBUNITRUN -U\$USERNAME%\$PASSWORD samba.tests.dcerpc.registry
-plantest "ldap.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
-plantest "urgent_replication.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/urgent_replication.py \$PREFIX_ABS/dc/private/sam.ldb
-plantest "ldap_schema.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap_schema.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
+plantest "ldap.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
+plantest "urgent_replication.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/urgent_replication.py \$PREFIX_ABS/dc/private/sam.ldb
+plantest "ldap_schema.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/ldap_schema.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
 plantest "ldap.possibleInferiors.python" dc $PYTHON $samba4srcdir/dsdb/samdb/ldb_modules/tests/possibleinferiors.py $CONFIGURATION ldap://\$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
-plantest "ldap.secdesc.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/sec_descriptor.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
-plantest "ldap.acl.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/acl.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
+plantest "ldap.secdesc.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/sec_descriptor.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
+plantest "ldap.acl.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/acl.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
 plantest "xattr.python" none $SUBUNITRUN samba.tests.xattr
 plantest "ntacls.python" none $SUBUNITRUN samba.tests.ntacls
-plantest "deletetest.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python" $PYTHON $samba4srcdir/lib/ldb/tests/python/deletetest.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
+plantest "deletetest.python" dc PYTHONPATH="$PYTHONPATH:../lib/subunit/python:../lib/testtools" $PYTHON $samba4srcdir/lib/ldb/tests/python/deletetest.py $CONFIGURATION \$SERVER -U\$USERNAME%\$PASSWORD -W \$DOMAIN
 plantest "blackbox.samba3dump" none $PYTHON $samba4srcdir/scripting/bin/samba3dump $samba4srcdir/../testdata/samba3
 rm -rf $PREFIX/upgrade
 plantest "blackbox.upgrade" none $PYTHON $samba4srcdir/setup/upgrade_from_s3 $CONFIGURATION --targetdir=$PREFIX/upgrade $samba4srcdir/../testdata/samba3 ../testdata/samba3/smb.conf