summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-29 17:12:37 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:16 +1000
commit65edcfa01600db1e6140e147ef74d4904fc531ed (patch)
tree0ed9069ef6e0dca03619de444bbe54a4f4b86be8 /buildtools
parentcd8de1581919dc9df43f3e2c6e045447129f49bc (diff)
downloadsamba-65edcfa01600db1e6140e147ef74d4904fc531ed.tar.gz
samba-65edcfa01600db1e6140e147ef74d4904fc531ed.tar.bz2
samba-65edcfa01600db1e6140e147ef74d4904fc531ed.zip
build: added pattern option for recursive_dirlist
also added LOAD_ENVIRONMENT(), which will be used in the testsuite
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_utils.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 1d26088194..d3be7945c0 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -1,7 +1,7 @@
# a waf tool to add autoconf-like macros to the configure section
# and for SAMBA_ macros for building libraries, binaries etc
-import Build, os, sys, Options, Utils, Task, re
+import Build, os, sys, Options, Utils, Task, re, fnmatch
from TaskGen import feature, before
from Configure import conf
from Logs import debug
@@ -261,7 +261,7 @@ def ENFORCE_GROUP_ORDERING(bld):
Build.BuildContext.ENFORCE_GROUP_ORDERING = ENFORCE_GROUP_ORDERING
-def recursive_dirlist(dir, relbase):
+def recursive_dirlist(dir, relbase, pattern=None):
'''recursive directory list'''
ret = []
for f in os.listdir(dir):
@@ -269,6 +269,8 @@ def recursive_dirlist(dir, relbase):
if os.path.isdir(f2):
ret.extend(recursive_dirlist(f2, relbase))
else:
+ if pattern and not fnmatch.fnmatch(f, pattern):
+ continue
ret.append(os_path_relpath(f2, relbase))
return ret
@@ -373,3 +375,11 @@ except:
Task.md5 = replace_md5
Utils.h_file = replace_h_file
+
+def LOAD_ENVIRONMENT():
+ '''load the configuration environment, allowing access to env vars
+ from new commands'''
+ import Environment
+ env = Environment.Environment()
+ env.load('bin/c4che/default.cache.py')
+ return env