-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snapcraft: Fix LXD snap bash completions #674
base: latest-edge
Are you sure you want to change the base?
Conversation
This commit changes the permissions, location, and file extension of the `lxc` bash completions script to ensure correct execution. Signed-off-by: Kadin Sayani <kadin.sayani@canonical.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I have 2 questions. Thanks
@@ -1471,9 +1472,10 @@ parts: | |||
# When executed by snapd, the `compopt` support detection doesn't work so fake that it is always `builtin` | |||
set_compopt='s|$(type -t compopt)|"builtin"|' | |||
# Modify requestComp variable to use lxc based on context ($SNAP/bin/lxc in Snap environment) | |||
set_request_comp='s|requestComp="${words\[0\]} __complete ${args\[\*\]}"|requestComp="/snap/lxd/current/bin/lxc __complete ${args[*]}"|' | |||
set_request_comp='s|requestComp="${words\[0\]} __complete ${args\[\*\]}"|requestComp="/snap/lxd/current/commands/lxc __complete ${args[*]}"|' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set_request_comp='s|requestComp="${words\[0\]} __complete ${args\[\*\]}"|requestComp="/snap/lxd/current/commands/lxc __complete ${args[*]}"|' | |
set_request_comp='s|requestComp="${words\[0\]} __complete ${args\[\*\]}"|requestComp="/snap/bin/lxc __complete ${args[*]}"|' |
Would that work?
@@ -1394,6 +1394,7 @@ parts: | |||
stage-packages: | |||
- acl | |||
- attr | |||
- bash-completion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that needed for lxc completion bash
to work as intended?
This PR fixes the logic in `cmpRemotes` to ensure remotes are contextually completed correctly based on the current remote. While testing canonical/lxd-pkg-snap#674, I noticed that the `local` remote was not completed while on a different remote.
Fixes canonical/lxd#14635, canonical/lxd#14690 and canonical/lxd#14648.
This PR changes the permissions, location, and file extension of the
lxc
bash completions script to ensure correct execution. Thebash-completions
package is also added to the snap stage packages.