build: Do not recurse on symlinks to directories when building tarballs
commit769e889e0e617b503a3a7574b4cd2f0bf9909065
authorMartin Schwenke <martin@meltin.net>
Tue, 8 Aug 2017 10:50:25 +0000 (8 20:50 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 10 Aug 2017 04:43:13 +0000 (10 06:43 +0200)
treea60a0d89a2abe90de3b61ad515714996b523685e
parent68a02d18c135a30adf0f67ec370d5e2db5ea136e
build: Do not recurse on symlinks to directories when building tarballs

DIST_FILES() causes all files in any specified directory to be
recursively added to the tarball.  However, a symbolic link to a
directory is detected as a regular directory so is also subject to
recursion.  This means that a symbolic link to a directory is
dereferenced and the directory of files beyond it are added to the
tarball under a directory corresponding to the link.  This is almost
certainly not what is intended because it will usually result in
duplicate files.  This is because the contents of a symbolic link's
target directory will already be present in the tarball.

Instead, do not treat symbolic links to directories as directories,
but add them to the tarball like normal files.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
buildtools/wafsamba/samba_dist.py