summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-09-12 17:06:23 +0200
committerStefan Metzmacher <metze@samba.org>2012-09-12 23:53:12 +0200
commitd28f36d16e515fb1280b21b04bb5bb113647f247 (patch)
tree42d87ab8088a46f9d3a1e3e068ed5e6e40a6cfd0 /buildtools
parent36b2732426c4301bdbea99bb34fccdd767af044d (diff)
downloadsamba-d28f36d16e515fb1280b21b04bb5bb113647f247.tar.gz
samba-d28f36d16e515fb1280b21b04bb5bb113647f247.tar.bz2
samba-d28f36d16e515fb1280b21b04bb5bb113647f247.zip
build:dist: extend meaning of DIST_FILES to also recurse into directories
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/samba_dist.py18
1 files changed, 16 insertions, 2 deletions
diff --git a/buildtools/wafsamba/samba_dist.py b/buildtools/wafsamba/samba_dist.py
index 30902c4f04..82492e135c 100644
--- a/buildtools/wafsamba/samba_dist.py
+++ b/buildtools/wafsamba/samba_dist.py
@@ -127,6 +127,14 @@ def dist(appname='',version=''):
add_tarfile(tar, fname, abspath, srcsubdir)
+ def list_directory_files(abspath):
+ out_files = []
+ for root, dirs, files in os.walk(abspath):
+ for f in files:
+ out_files.append(os.path.join(root, f))
+ return out_files
+
+
if not isinstance(appname, str) or not appname:
# this copes with a mismatch in the calling arguments for dist()
appname = Utils.g_module.APPNAME
@@ -175,8 +183,14 @@ def dist(appname='',version=''):
absfile = os.path.join(srcdir, file)
- fname = dist_base + '/' + destfile
- add_tarfile(tar, fname, absfile, destfile)
+ if os.path.isdir(absfile):
+ destdir = destfile
+ dir = file
+ files = list_directory_files(dir)
+ add_files_to_tarball(tar, srcdir, dir, dist_base, destdir, blacklist, files)
+ else:
+ fname = dist_base + '/' + destfile
+ add_tarfile(tar, fname, absfile, destfile)
tar.close()