Skip to content

Commit

Permalink
build: Rename variables for consistency and ease of grepping
Browse files Browse the repository at this point in the history
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.

containers#1123
  • Loading branch information
debarshiray committed Oct 17, 2022
1 parent c1e238f commit 78751b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions completion/meson.build
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
generate_completions_program = find_program('generate_completions.py')

if bash_completion.found()
bash_comp_dir = bash_completion.get_variable(pkgconfig: 'completionsdir')
if bash_completion_dep.found()
bashcompletionsdir = bash_completion_dep.get_variable(pkgconfig: 'completionsdir')
else
bash_comp_dir = get_option('datadir') / 'bash-completion' / 'completions'
message('bash-completion not found: using', get_option('prefix') / bash_comp_dir, 'as a falback install directory')
bashcompletionsdir = get_option('datadir') / 'bash-completion' / 'completions'
message('bash-completion not found: using', get_option('prefix') / bashcompletionsdir, 'as a falback install directory')
endif

if fish.found()
fish_comp_dir = fish.get_variable(pkgconfig: 'completionsdir')
if fish_dep.found()
fishcompletionsdir = fish_dep.get_variable(pkgconfig: 'completionsdir')
else
fish_comp_dir = get_option('datadir') / 'fish' / 'completions'
message('fish not found: using', get_option('prefix') / fish_comp_dir, 'as a fallback install directory')
fishcompletionsdir = get_option('datadir') / 'fish' / 'completions'
message('fish not found: using', get_option('prefix') / fishcompletionsdir, 'as a fallback install directory')
endif

completion_bash = custom_target('bash-completion',
capture: true,
command: [generate_completions_program, meson.global_source_root() / 'src', 'bash'],
depends: [toolbox_go],
install: true,
install_dir: bash_comp_dir,
install_dir: bashcompletionsdir,
output: 'toolbox')

completion_zsh = custom_target('zsh-completion',
Expand All @@ -35,5 +35,5 @@ completion_fish = custom_target('fish-completion',
command: [generate_completions_program, meson.global_source_root() / 'src', 'fish'],
depends: [toolbox_go],
install: true,
install_dir: fish_comp_dir,
install_dir: fishcompletionsdir,
output: 'toolbox.fish')
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ go_md2man = find_program('go-md2man')
shellcheck = find_program('shellcheck', required: false)
skopeo = find_program('skopeo', required: false)

bash_completion = dependency('bash-completion', required: false)
fish = dependency('fish', required: false)
bash_completion_dep = dependency('bash-completion', required: false)
fish_dep = dependency('fish', required: false)

migration_path_for_coreos_toolbox = get_option('migration_path_for_coreos_toolbox')
profiledir = get_option('profile_dir')
Expand Down

0 comments on commit 78751b1

Please sign in to comment.