Skip to content
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

Fix backblaze CLI bash autocomplete issue #45334

Merged
merged 1 commit into from Aug 19, 2018

Conversation

uskudnik
Copy link
Contributor

@uskudnik uskudnik commented Aug 19, 2018

Backblaze's CLI tool is relying on have function which is
deprecated and gets de-referenced at the end of bash-completion.

This causes issues for NixOS because those bash completions are
run after bash-completion has already run and unset the
have function.

I have submitted patch upstream but I suspect it will take a while before new version is released so I think we should patch it on our end in the meanwhile.

Motivation for this change

Without the patch every time bash is opened:

have: command not found

because have has been unset already because it's deprecated (see description).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Looks good to me

@infinisil
Copy link
Member

One minor thing though: Can you format your commit message according to the Contribution Guidelines? So that is has a backblaze-b2: prefix in this case

Backblaze's CLI tool is relying on `have` function which is
deprecated[1] and gets dereferenced[2] at the end of `bash-completion`.

This causes issues for NixOS because those bash completions are
run after bash-completion[3] has already run and unset the
`have` function.

[1] https://github.com/scop/bash-completion/blob/4d88339928aa064a567d5feb40694dfd24a274c5/bash_completion#L114
[2] https://github.com/scop/bash-completion/blob/4d88339928aa064a567d5feb40694dfd24a274c5/bash_completion#L2103
[3] https://github.com/NixOS/nixpkgs/blob/80b6513fbf5789ff0208c19a89bae49df2b503ad/nixos/modules/programs/bash/bash.nix#L22
@uskudnik uskudnik force-pushed the fix-backblaze-autocompletion-issue branch from 6b9dc5e to af55116 Compare August 19, 2018 20:15
@uskudnik
Copy link
Contributor Author

@infinisil Ah forgot about that one, amended.

@infinisil infinisil merged commit 99c593a into NixOS:master Aug 19, 2018
@uskudnik uskudnik deleted the fix-backblaze-autocompletion-issue branch August 19, 2018 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants