From aa519054ecfc9fd0d51d8f43328fecc4babdb05c Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 4 Jan 2022 12:17:41 +0100 Subject: [PATCH] meson: keep bash-completion symlinks in variable This is small consolidation, let's call meson_make_symlink from one place in loop. Addresses: https://github.com/util-linux/util-linux/pull/1549 Signed-off-by: Karel Zak --- meson.build | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/meson.build b/meson.build index dced67076d..be02e71fd0 100644 --- a/meson.build +++ b/meson.build @@ -753,7 +753,9 @@ add_project_arguments('-include', 'config.h', language : 'c') manadocs = [] manlinks = {} + bashcompletions = [] +bashcompletionslinks = {} subdir('include') subdir('lib') @@ -847,6 +849,7 @@ if opt and not is_disabler(exe) manadocs += ['login-utils/last.1.adoc'] manlinks += {'lastb.1': 'last.1'} bashcompletions += ['last'] + bashcompletionslinks += {'lastb': 'last'} endif opt = not get_option('build-nologin').disabled() @@ -977,11 +980,7 @@ exe = executable( if opt and not is_disabler(exe) exes += exe manadocs += ['login-utils/runuser.1.adoc'] - if bash_completion.found() - meson.add_install_script(meson_make_symlink, - 'su', - join_paths(bash_completion.get_variable('completionsdir'), 'runuser')) -endif + bashcompletionslinks += {'runuser': 'su'} endif ############################################################ @@ -3234,4 +3233,9 @@ if bash_completion.found() install_dir : bash_completion.get_variable('completionsdir') ) endforeach + foreach link_name, target : bashcompletionslinks + meson.add_install_script(meson_make_symlink, + target, + join_paths(bash_completion.get_variable('completionsdir'), link_name)) + endforeach endif -- 2.47.3