testing: Exclude files that are ignored in Git from the distribution

Since the complete hosts and tests directories are part of the tarball
this would include generated certificates and keys.
This commit is contained in:
Tobias Brunner 2019-04-29 14:53:28 +02:00
parent 92c001f766
commit 2a72056cee
1 changed files with 8 additions and 0 deletions

View File

@ -2,3 +2,11 @@ EXTRA_DIST = do-tests make-testing ssh start-testing stop-testing \
testing.conf ssh_config config hosts images scripts tests \
README
# exclude all files ignored by Git from the tarball
dist-hook:
if git -C $(srcdir) ls-files --error-unmatch hosts > /dev/null 2>&1; then \
find $(abs_srcdir)/hosts $(abs_srcdir)/tests -print0 | \
sed -z -e "s|^$(abs_srcdir)/||" | \
git -C $(srcdir) check-ignore -z --stdin | \
xargs -0 -I{} rm -rf $(distdir)/{}; \
fi