aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Pappacoda <andrea@pappacoda.it>2021-07-01 19:38:15 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2021-07-04 01:25:23 +0300
commitd0101cbfb7dbf6c61e739f682c4cf08ceea1e3e7 (patch)
treec5a9e4bd8ea839d62eef7932a315326022708237
parentee46c0242f97501672c0bd6312498c464370cbeb (diff)
downloadmeson-d0101cbfb7dbf6c61e739f682c4cf08ceea1e3e7.zip
meson-d0101cbfb7dbf6c61e739f682c4cf08ceea1e3e7.tar.gz
meson-d0101cbfb7dbf6c61e739f682c4cf08ceea1e3e7.tar.bz2
dist: only exclude actual git files
Instead of excluding all files starting with .git, meson dist now only excludes files really used by git
-rw-r--r--mesonbuild/mdist.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/mesonbuild/mdist.py b/mesonbuild/mdist.py
index 22196d8..e63ab17 100644
--- a/mesonbuild/mdist.py
+++ b/mesonbuild/mdist.py
@@ -56,11 +56,13 @@ def create_hash(fname):
def del_gitfiles(dirname):
+ gitfiles = ('.git', '.gitattributes', '.gitignore', '.gitmodules')
for f in glob(os.path.join(dirname, '.git*')):
- if os.path.isdir(f) and not os.path.islink(f):
- windows_proof_rmtree(f)
- else:
- os.unlink(f)
+ if os.path.split(f)[1] in gitfiles:
+ if os.path.isdir(f) and not os.path.islink(f):
+ windows_proof_rmtree(f)
+ else:
+ os.unlink(f)
def process_submodules(dirname):
module_file = os.path.join(dirname, '.gitmodules')