From 8ca3cc0c3db481b467233151e481a190cbb84c31 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Thu, 18 Jan 2018 16:44:06 +0000 Subject: Add elide_directory keyword for install_subdir() function If elide_directory=true install_subdir() installs directory contents instead of directory itself, eliding name of the source directory. Closes #2869. --- docs/markdown/Reference-manual.md | 28 +++++++++++++++++++++- .../snippets/install_subdir-elide_directory.md | 4 ++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 docs/markdown/snippets/install_subdir-elide_directory.md (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 390371b..e5fcb67 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -772,7 +772,7 @@ installed with a `.gz` suffix. ### install_subdir() ``` meson - void install_subdir(subdir_name, install_dir : ..., exclude_files : ..., exclude_directories : ...) + void install_subdir(subdir_name, install_dir : ..., exclude_files : ..., exclude_directories : ..., elide_directory : ...) ``` Installs the entire given subdirectory and its contents from the @@ -786,6 +786,32 @@ The following keyword arguments are supported: - `exclude_directories`: a list of directory names that should not be installed. Names are interpreted as paths relative to the `subdir_name` location. - `install_dir`: the location to place the installed subdirectory. +- `elide_directory`: install directory contents. `elide_directory=false` by default. + Since 0.45.0 + +For a given directory `foo`: +``` +foo/ + bar/ + file1 + file2 +``` +`install_subdir('foo', install_dir : 'share', elide_directory : false)` creates +``` +share/ + foo/ + bar/ + file1 + file2 +``` + +`install_subdir('foo', install_dir : 'share', elide_directory : true)` creates +``` +share/ + bar/ + file1 + file2 +``` ### is_variable() diff --git a/docs/markdown/snippets/install_subdir-elide_directory.md b/docs/markdown/snippets/install_subdir-elide_directory.md new file mode 100644 index 0000000..516a286 --- /dev/null +++ b/docs/markdown/snippets/install_subdir-elide_directory.md @@ -0,0 +1,4 @@ +## install_subdir() supports elide_directory + +If elide_directory=true install_subdir() installs directory contents +instead of directory itself, eliding name of the source directory. -- cgit v1.1 From 549f9a41e50c0cf0f8550462ab9bff169ff3a106 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Sun, 4 Feb 2018 21:05:53 +0000 Subject: Rename install_subdir() option elide_directory to strip_directory --- docs/markdown/Reference-manual.md | 8 ++++---- docs/markdown/snippets/install_subdir-elide_directory.md | 4 ---- docs/markdown/snippets/install_subdir-strip_directory.md | 4 ++++ 3 files changed, 8 insertions(+), 8 deletions(-) delete mode 100644 docs/markdown/snippets/install_subdir-elide_directory.md create mode 100644 docs/markdown/snippets/install_subdir-strip_directory.md (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index e5fcb67..82f0b5a 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -772,7 +772,7 @@ installed with a `.gz` suffix. ### install_subdir() ``` meson - void install_subdir(subdir_name, install_dir : ..., exclude_files : ..., exclude_directories : ..., elide_directory : ...) + void install_subdir(subdir_name, install_dir : ..., exclude_files : ..., exclude_directories : ..., strip_directory : ...) ``` Installs the entire given subdirectory and its contents from the @@ -786,7 +786,7 @@ The following keyword arguments are supported: - `exclude_directories`: a list of directory names that should not be installed. Names are interpreted as paths relative to the `subdir_name` location. - `install_dir`: the location to place the installed subdirectory. -- `elide_directory`: install directory contents. `elide_directory=false` by default. +- `strip_directory`: install directory contents. `strip_directory=false` by default. Since 0.45.0 For a given directory `foo`: @@ -796,7 +796,7 @@ foo/ file1 file2 ``` -`install_subdir('foo', install_dir : 'share', elide_directory : false)` creates +`install_subdir('foo', install_dir : 'share', strip_directory : false)` creates ``` share/ foo/ @@ -805,7 +805,7 @@ share/ file2 ``` -`install_subdir('foo', install_dir : 'share', elide_directory : true)` creates +`install_subdir('foo', install_dir : 'share', strip_directory : true)` creates ``` share/ bar/ diff --git a/docs/markdown/snippets/install_subdir-elide_directory.md b/docs/markdown/snippets/install_subdir-elide_directory.md deleted file mode 100644 index 516a286..0000000 --- a/docs/markdown/snippets/install_subdir-elide_directory.md +++ /dev/null @@ -1,4 +0,0 @@ -## install_subdir() supports elide_directory - -If elide_directory=true install_subdir() installs directory contents -instead of directory itself, eliding name of the source directory. diff --git a/docs/markdown/snippets/install_subdir-strip_directory.md b/docs/markdown/snippets/install_subdir-strip_directory.md new file mode 100644 index 0000000..9ddb4a4 --- /dev/null +++ b/docs/markdown/snippets/install_subdir-strip_directory.md @@ -0,0 +1,4 @@ +## install_subdir() supports strip_directory + +If strip_directory=true install_subdir() installs directory contents +instead of directory itself, stripping basename of the source directory. -- cgit v1.1 From 13f91840e3e54b60bd97e4a3f3031bc92de2207c Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Sun, 4 Feb 2018 21:23:40 +0000 Subject: Clarify multi-component source directory behavior of install_subdir() --- docs/markdown/Reference-manual.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 82f0b5a..5cfaf0e 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -787,6 +787,7 @@ The following keyword arguments are supported: Names are interpreted as paths relative to the `subdir_name` location. - `install_dir`: the location to place the installed subdirectory. - `strip_directory`: install directory contents. `strip_directory=false` by default. + If `strip_directory=false` only last component of source path is used. Since 0.45.0 For a given directory `foo`: @@ -813,6 +814,13 @@ share/ file2 ``` +`install_subdir('foo/bar', install_dir : 'share', stripe_directory : false)` creates +``` +share/ + bar/ + file1 +``` + ### is_variable() ``` meson -- cgit v1.1 From 79d8f2adbfd824f4155d874a3555de4a982253f8 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Sun, 4 Feb 2018 22:02:47 +0000 Subject: Fix misprint in strip_directory example --- docs/markdown/Reference-manual.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 5cfaf0e..50e68aa 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -814,7 +814,7 @@ share/ file2 ``` -`install_subdir('foo/bar', install_dir : 'share', stripe_directory : false)` creates +`install_subdir('foo/bar', install_dir : 'share', strip_directory : false)` creates ``` share/ bar/ -- cgit v1.1 From 65afa967d087b41d7020dfd6465a573c5469f61f Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Sun, 4 Feb 2018 22:10:47 +0000 Subject: Add strip_directory=true example for multi-component path --- docs/markdown/Reference-manual.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 50e68aa..4b0390e 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -821,6 +821,12 @@ share/ file1 ``` +`install_subdir('foo/bar', install_dir : 'share', strip_directory : true)` creates +``` +share/ + file1 +``` + ### is_variable() ``` meson -- cgit v1.1 From f5917d261cb8ca60b8e2988b4c1350a8d955f190 Mon Sep 17 00:00:00 2001 From: Aleksey Filippov Date: Sun, 4 Feb 2018 22:11:13 +0000 Subject: Use text keyword for directory example code blocks --- docs/markdown/Reference-manual.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/markdown') diff --git a/docs/markdown/Reference-manual.md b/docs/markdown/Reference-manual.md index 4b0390e..ca28643 100644 --- a/docs/markdown/Reference-manual.md +++ b/docs/markdown/Reference-manual.md @@ -791,14 +791,14 @@ The following keyword arguments are supported: Since 0.45.0 For a given directory `foo`: -``` +```text foo/ bar/ file1 file2 ``` `install_subdir('foo', install_dir : 'share', strip_directory : false)` creates -``` +```text share/ foo/ bar/ @@ -807,7 +807,7 @@ share/ ``` `install_subdir('foo', install_dir : 'share', strip_directory : true)` creates -``` +```text share/ bar/ file1 @@ -815,14 +815,14 @@ share/ ``` `install_subdir('foo/bar', install_dir : 'share', strip_directory : false)` creates -``` +```text share/ bar/ file1 ``` `install_subdir('foo/bar', install_dir : 'share', strip_directory : true)` creates -``` +```text share/ file1 ``` -- cgit v1.1