support/download: don't over-remove files from git archives
authorYann E. MORIN <yann.morin.1998@free.fr>
Mon, 4 Jul 2016 07:52:25 +0000 (09:52 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Mon, 4 Jul 2016 08:04:22 +0000 (10:04 +0200)
When we now manually create git archives, we removed all .git-related
files. However, we also exclude empty directories.

This means that a directory which only had a .gitignore file is excluded
from the archive.

Fixes:
    http://autobuild.buildroot.org/results/2aa/2aa8954311f009988880d27b6e48af91bc74c346/
    http://autobuild.buildroot.org/results/b45/b45cceea99b9860ccf1c925eeda498a823b30903/
    http://autobuild.buildroot.org/results/5ae/5ae336052fd32057d9631649279e142a81f5651f/
    http://autobuild.buildroot.org/results/5fc/5fc3abf4a1aea677f576e16c49253d00720a8bef/

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
support/download/git

index 45802d3dd13f627b436b0db4219e1ea52a46ca0f..663006b4d0e9858031c80f2875c1e9caa5c363e6 100755 (executable)
@@ -83,9 +83,9 @@ if [ ${recurse} -eq 1 ]; then
     _git submodule update --init --recursive
 fi
 
-# We do not need the .git dir and other gitfiles to generate the tarball
-find . \( -name .git -o -name .gitmodules -o -name .gitignore \) \
-       -exec rm -rf {} +
+# We do not need the .git dir; we keep other .git files, in case they
+# are the only files in their directory.
+rm -rf .git
 
 popd >/dev/null