diff options
-rw-r--r-- | mesonbuild/minstall.py | 2 | ||||
-rw-r--r-- | test cases/common/59 install subdir/meson.build | 6 | ||||
-rw-r--r-- | test cases/common/59 install subdir/sub3/data/data.txt | 1 | ||||
-rw-r--r-- | test cases/common/59 install subdir/sub3/data/excluded.txt | 1 | ||||
-rw-r--r-- | test cases/common/59 install subdir/sub3/data/excluded/excluded.txt | 1 | ||||
-rw-r--r-- | test cases/common/59 install subdir/test.json | 1 | ||||
-rw-r--r-- | unittests/allplatformstests.py | 11 |
7 files changed, 18 insertions, 5 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index 8c74990ad..e0572a828 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -482,6 +482,8 @@ class Installer: raise ValueError(f'dst_dir must be absolute, got {dst_dir}') if exclude is not None: exclude_files, exclude_dirs = exclude + exclude_files = {os.path.normpath(x) for x in exclude_files} + exclude_dirs = {os.path.normpath(x) for x in exclude_dirs} else: exclude_files = exclude_dirs = set() for root, dirs, files in os.walk(src_dir): diff --git a/test cases/common/59 install subdir/meson.build b/test cases/common/59 install subdir/meson.build index 13d41bedf..fb2034bff 100644 --- a/test cases/common/59 install subdir/meson.build +++ b/test cases/common/59 install subdir/meson.build @@ -7,6 +7,12 @@ install_subdir('sub2', exclude_directories : ['excluded'], install_dir : 'share') +# More exclusions +install_subdir('sub3', + exclude_files : ['data/excluded.txt'], + exclude_directories : ['data/excluded'], + install_dir : 'share') + subdir('subdir') # A subdir with write perms only for the owner # and read-list perms for owner and group diff --git a/test cases/common/59 install subdir/sub3/data/data.txt b/test cases/common/59 install subdir/sub3/data/data.txt new file mode 100644 index 000000000..1269488f7 --- /dev/null +++ b/test cases/common/59 install subdir/sub3/data/data.txt @@ -0,0 +1 @@ +data diff --git a/test cases/common/59 install subdir/sub3/data/excluded.txt b/test cases/common/59 install subdir/sub3/data/excluded.txt new file mode 100644 index 000000000..bbde3dc9d --- /dev/null +++ b/test cases/common/59 install subdir/sub3/data/excluded.txt @@ -0,0 +1 @@ +excluded diff --git a/test cases/common/59 install subdir/sub3/data/excluded/excluded.txt b/test cases/common/59 install subdir/sub3/data/excluded/excluded.txt new file mode 100644 index 000000000..bbde3dc9d --- /dev/null +++ b/test cases/common/59 install subdir/sub3/data/excluded/excluded.txt @@ -0,0 +1 @@ +excluded diff --git a/test cases/common/59 install subdir/test.json b/test cases/common/59 install subdir/test.json index 0dd885cb5..aa8e27ab7 100644 --- a/test cases/common/59 install subdir/test.json +++ b/test cases/common/59 install subdir/test.json @@ -12,6 +12,7 @@ {"type": "file", "file": "usr/share/sub1/sub2/data2.dat"}, {"type": "file", "file": "usr/share/sub2/one.dat"}, {"type": "file", "file": "usr/share/sub2/dircheck/excluded-three.dat"}, + {"type": "file", "file": "usr/share/sub3/data/data.txt"}, {"type": "dir", "file": "usr/share/new_directory"} ] } diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py index 8e0bd136c..160435416 100644 --- a/unittests/allplatformstests.py +++ b/unittests/allplatformstests.py @@ -440,14 +440,15 @@ class AllPlatformTests(BasePlatformTests): self.init(testdir) intro = self.introspect('--installed') expected = { + 'nested_elided/sub': 'share', + 'new_directory': 'share/new_directory', + 'sub/sub1': 'share/sub1', + 'sub1': 'share/sub1', 'sub2': 'share/sub2', + 'sub3': '/usr/share/sub3', + 'sub_elided': 'share', 'subdir/sub1': 'share/sub1', 'subdir/sub_elided': 'share', - 'sub1': 'share/sub1', - 'sub/sub1': 'share/sub1', - 'sub_elided': 'share', - 'nested_elided/sub': 'share', - 'new_directory': 'share/new_directory', } self.assertEqual(len(intro), len(expected)) |