When building a tarball, avoid trying to copy submodules
authorRichard Levitte <levitte@openssl.org>
Thu, 17 Aug 2017 07:38:02 +0000 (09:38 +0200)
committerRichard Levitte <levitte@openssl.org>
Thu, 17 Aug 2017 09:44:02 +0000 (11:44 +0200)
submodules are directories that we don't want in our tarballs, so
avoid them.

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4178)

Configurations/unix-Makefile.tmpl

index 79236613839d7d1115f0402a3d7e29fb639dc80e..0603b4144d28068c6e138959495c6844094ced8f 100644 (file)
@@ -686,8 +686,11 @@ tar:
        DISTDIR=$(NAME); \
        mkdir -p $$TMPDIR/$$DISTDIR; \
        (cd $(SRCDIR); \
+        excl_re=`git submodule status | sed -e 's/^.//' | cut -d' ' -f2`; \
+        excl_re="^(fuzz/corpora|`echo $$excl_re | sed -e 's/ /$$|/g'`\$$)"; \
+        echo "$$excl_re"; \
         git ls-tree -r --name-only --full-tree HEAD \
-         | grep -v '^fuzz/corpora' \
+        | grep -v -E "$$excl_re" \
         | while read F; do \
               mkdir -p $$TMPDIR/$$DISTDIR/`dirname $$F`; \
               cp $$F $$TMPDIR/$$DISTDIR/$$F; \