diff options
author | Andrea Pappacoda <andrea@pappacoda.it> | 2021-07-01 19:38:15 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2021-07-04 01:25:23 +0300 |
commit | d0101cbfb7dbf6c61e739f682c4cf08ceea1e3e7 (patch) | |
tree | c5a9e4bd8ea839d62eef7932a315326022708237 | |
parent | ee46c0242f97501672c0bd6312498c464370cbeb (diff) | |
download | meson-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.py | 10 |
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') |