From 04f233a80d570c90c1a152114cbf3bdad6a61607 Mon Sep 17 00:00:00 2001 From: Charles Brunet Date: Thu, 9 Feb 2023 07:19:52 -0500 Subject: allow install script to run in dry-run mode --- docs/markdown/snippets/run_script_dry_run.md | 8 ++++++++ docs/yaml/builtins/meson.yaml | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 docs/markdown/snippets/run_script_dry_run.md (limited to 'docs') diff --git a/docs/markdown/snippets/run_script_dry_run.md b/docs/markdown/snippets/run_script_dry_run.md new file mode 100644 index 000000000..aee32c72c --- /dev/null +++ b/docs/markdown/snippets/run_script_dry_run.md @@ -0,0 +1,8 @@ +## Allow custom install scripts to run with `--dry-run` option + +An new `dry_run` keyword is added to `meson.add_install_script()` +to allow a custom install script to run when meson is invoked +with `meson install --dry-run`. + +In dry run mode, the `MESON_INSTALL_DRY_RUN` environment variable +is set. diff --git a/docs/yaml/builtins/meson.yaml b/docs/yaml/builtins/meson.yaml index 1dd746f94..5ef445d84 100644 --- a/docs/yaml/builtins/meson.yaml +++ b/docs/yaml/builtins/meson.yaml @@ -64,6 +64,9 @@ methods: *(since 0.54.0)* If `meson install` is called with the `--quiet` option, the environment variable `MESON_INSTALL_QUIET` will be set. + *(since 1.1.0)* If `meson install` is called with the `--dry-run` option, the + environment variable `MESON_INSTALL_DRY_RUN` will be set. + Meson uses the `DESTDIR` environment variable as set by the inherited environment to determine the (temporary) installation location for files. Your install script must be aware of this while @@ -125,6 +128,15 @@ methods: to install only a subset of the files. By default the script has no install tag which means it is not being run when `meson install --tags` argument is specified. + + dry_run: + type: bool + since: 1.1.0 + default: false + description: | + If `true` the script will be run even if `--dry-run` option is provided to + the `meson install` command. The script can use the `MESON_INSTALL_DRY_RUN` + variable to determine if it is in dry run mode or not. - name: add_postconf_script returns: void -- cgit v1.2.3