From 3f8585676ba6d2c1bcd5d80a44275fdfa695f8c2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 3 Feb 2021 09:15:45 +1000 Subject: Make installing non-existing subdirs a supported feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit install_subdir() with a non-existing subdir creates the directory in the target directory. This seems like an implementation detail but is quite useful to create new directories for e.g. configuration or plugins in the installed locations. git bisect says this started with 8fe816101467e66792251b4f57e0ddddb537764a. Let's add a test for it and document it to make this behavior official. Limitation: it can only create at the install_dir location, trying to create nested subdirectories does not work and indeed creates the wrong directory structure. That is a bug that should be fixed separately: install_subdir('blah', install_dir: get_option('prefix')) install_subdir('sub/foobar', install_dir: get_option('prefix')) install_subdir('foo/baz', install_dir: get_option('prefix')) $ tree ../_inst ../_inst ├── baz ├── blah └── foobar Fixes #2904 --- run_unittests.py | 1 + 1 file changed, 1 insertion(+) (limited to 'run_unittests.py') diff --git a/run_unittests.py b/run_unittests.py index 2e7fe91..3f97c0c 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2414,6 +2414,7 @@ class AllPlatformTests(BasePlatformTests): 'sub/sub1': 'share/sub1', 'sub_elided': 'share', 'nested_elided/sub': 'share', + 'new_directory': 'share/new_directory', } self.assertEqual(len(intro), len(expected)) -- cgit v1.1