build: Do not ignore symlinks to directories when building tarballs
authorMartin Schwenke <martin@meltin.net>
Sun, 6 Aug 2017 04:56:17 +0000 (14:56 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 10 Aug 2017 04:43:13 +0000 (06:43 +0200)
Tarballs currently do not contain symbolic links to directories even
if they are committed in git.  This means that CTDB tests fail when
run in-tree from a tarball, due to a couple of missing links needed by
unit tests:

  ERROR: Directory .../ctdb/tests/var/unit_eventscripts/etc-ctdb/events.d does not exist.

Subdirectories of directories specified via DIST_DIRS() are ignored,
since all the files within them are separately added to the tarball.
Symbolic links to directories are detected as directories, so they are
also ignored, causing them to be missing from the tarball.

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

It is easy to confirm that this change causes no difference to current
tarballs other than causing the missing CTDB test links to be added:

  $ diff -u samba-4.8.0pre1-GIT-eb691cd0242.tar.gz.contents samba-4.8.0pre1-GIT-dfb16de0149.tar.gz.contents
  --- samba-4.8.0pre1-GIT-eb691cd0242.tar.gz.contents 2017-08-08 20:21:40.022993091 +1000
  +++ samba-4.8.0pre1-GIT-dfb16de0149.tar.gz.contents 2017-08-08 20:35:11.001580747 +1000
  @@ -578,7 +578,9 @@
   ctdb/tests/eventscripts/91.lvs.startup.001.sh
   ctdb/tests/eventscripts/91.lvs.startup.002.sh
   ctdb/tests/eventscripts/README
  +ctdb/tests/eventscripts/etc-ctdb/events.d
   ctdb/tests/eventscripts/etc-ctdb/functions
  +ctdb/tests/eventscripts/etc-ctdb/nfs-checks.d
   ctdb/tests/eventscripts/etc-ctdb/nfs-linux-kernel-callout
   ctdb/tests/eventscripts/etc-ctdb/public_addresses
   ctdb/tests/eventscripts/etc-ctdb/rc.local

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

index dbcb02a74d73e910dd26359591e59737a0614840..4dacba23d2e4789e01d4ec2c1aa5db3abedc84b8 100644 (file)
@@ -115,7 +115,7 @@ def dist(appname='', version=''):
                     blacklisted = True
             if blacklisted:
                 continue
-            if os.path.isdir(abspath):
+            if os.path.isdir(abspath) and not os.path.islink(abspath):
                 continue
             if dstsubdir != '.':
                 f = dstsubdir + '/' + f