Skip to content

Commit 1e9aba6

Browse files
authored
Optionalize bash completion. (#6441)
To allow for a low-dependency installation of cloud-init, optionalize the bash-completion dependency, defaulted to true. This means behaviorally nothing changes, but that the bash-completion features can be easily turned off if not desired.
1 parent b12c9f1 commit 1e9aba6

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

meson.build

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,18 @@ install_subdir(
2828
)
2929

3030
# Binaries and script entrypoints
31-
bash_completions_dir = dependency('bash-completion').get_variable(
32-
pkgconfig: 'completionsdir',
33-
default_value: get_option('datadir') / 'bash-completion' / 'completions',
34-
)
35-
install_data(
36-
'bash_completion/cloud-init',
37-
install_dir: bash_completions_dir,
38-
install_mode: 'rw-r--r--',
39-
install_tag: 'bin',
40-
)
31+
if get_option('bash_completion')
32+
bash_completions_dir = dependency('bash-completion').get_variable(
33+
pkgconfig: 'completionsdir',
34+
default_value: get_option('datadir') / 'bash-completion' / 'completions',
35+
)
36+
install_data(
37+
'bash_completion/cloud-init',
38+
install_dir: bash_completions_dir,
39+
install_mode: 'rw-r--r--',
40+
install_tag: 'bin',
41+
)
42+
endif
4143

4244
install_data(
4345
[

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
option('init_system', type: 'string', value: 'systemd', description: 'Set target init system.')
22
option('distro_templates', type: 'array', value: [], description: 'Distro template files to install. WARNING: Templates may change in the future. If using this option, be sure to check new releases for template file changes.')
33
option('disable_sshd_keygen', type: 'boolean', value: false, description: 'Provide systemd service to disable sshd-keygen if present to avoid races with cloud-init.')
4+
option('bash_completion', type: 'boolean', value: true, description: 'Bash completion for cloud-init.')

0 commit comments

Comments
 (0)