build: Rename variables for consistency and ease of grepping

Names like bash_comp_dir and fish_comp_dir get missed when grepping for
'completion'.

Note that the name of the directory is a plural, because it contains
lots of completions for many different programs, just like the name of
the pkgconfig variable.

https://github.com/containers/toolbox/pull/1123
https://github.com/containers/toolbox/pull/1138
This commit is contained in:
Debarshi Ray 2022-09-09 19:04:24 +02:00
parent c1e238f689
commit a6fd0db218
2 changed files with 12 additions and 12 deletions

View file

@ -1,17 +1,17 @@
generate_completions_program = find_program('generate_completions.py') generate_completions_program = find_program('generate_completions.py')
if bash_completion.found() if bash_completion_dep.found()
bash_comp_dir = bash_completion.get_variable(pkgconfig: 'completionsdir') bashcompletionsdir = bash_completion_dep.get_variable(pkgconfig: 'completionsdir')
else else
bash_comp_dir = get_option('datadir') / 'bash-completion' / 'completions' bashcompletionsdir = get_option('datadir') / 'bash-completion' / 'completions'
message('bash-completion not found: using', get_option('prefix') / bash_comp_dir, 'as a falback install directory') message('bash-completion not found: using', get_option('prefix') / bashcompletionsdir, 'as a falback install directory')
endif endif
if fish.found() if fish_dep.found()
fish_comp_dir = fish.get_variable(pkgconfig: 'completionsdir') fishcompletionsdir = fish_dep.get_variable(pkgconfig: 'completionsdir')
else else
fish_comp_dir = get_option('datadir') / 'fish' / 'completions' fishcompletionsdir = get_option('datadir') / 'fish' / 'completions'
message('fish not found: using', get_option('prefix') / fish_comp_dir, 'as a fallback install directory') message('fish not found: using', get_option('prefix') / fishcompletionsdir, 'as a fallback install directory')
endif endif
completion_bash = custom_target('bash-completion', completion_bash = custom_target('bash-completion',
@ -19,7 +19,7 @@ completion_bash = custom_target('bash-completion',
command: [generate_completions_program, meson.global_source_root() / 'src', 'bash'], command: [generate_completions_program, meson.global_source_root() / 'src', 'bash'],
depends: [toolbox_go], depends: [toolbox_go],
install: true, install: true,
install_dir: bash_comp_dir, install_dir: bashcompletionsdir,
output: 'toolbox') output: 'toolbox')
completion_zsh = custom_target('zsh-completion', completion_zsh = custom_target('zsh-completion',
@ -35,5 +35,5 @@ completion_fish = custom_target('fish-completion',
command: [generate_completions_program, meson.global_source_root() / 'src', 'fish'], command: [generate_completions_program, meson.global_source_root() / 'src', 'fish'],
depends: [toolbox_go], depends: [toolbox_go],
install: true, install: true,
install_dir: fish_comp_dir, install_dir: fishcompletionsdir,
output: 'toolbox.fish') output: 'toolbox.fish')

View file

@ -18,8 +18,8 @@ go_md2man = find_program('go-md2man')
shellcheck = find_program('shellcheck', required: false) shellcheck = find_program('shellcheck', required: false)
skopeo = find_program('skopeo', required: false) skopeo = find_program('skopeo', required: false)
bash_completion = dependency('bash-completion', required: false) bash_completion_dep = dependency('bash-completion', required: false)
fish = dependency('fish', required: false) fish_dep = dependency('fish', required: false)
migration_path_for_coreos_toolbox = get_option('migration_path_for_coreos_toolbox') migration_path_for_coreos_toolbox = get_option('migration_path_for_coreos_toolbox')
profiledir = get_option('profile_dir') profiledir = get_option('profile_dir')