From: Tobias Brunner Date: Mon, 29 Apr 2019 12:53:28 +0000 (+0200) Subject: testing: Exclude files that are ignored in Git from the distribution X-Git-Tag: 5.8.0rc1~5^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2a72056cee70330652aa6dec64ea3782552cf710;p=thirdparty%2Fstrongswan.git 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. --- diff --git a/testing/Makefile.am b/testing/Makefile.am index 0195c89515..0ad9f17480 100644 --- a/testing/Makefile.am +++ b/testing/Makefile.am @@ -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