Opened 8 months ago
Closed 8 months ago
#22741 closed defect (fixed)
Review bash completion treatment in bash startup scripts
| Reported by: | pierre | Owned by: | blfs-book |
|---|---|---|---|
| Priority: | normal | Milestone: | 13.0 |
| Component: | BOOK | Version: | git |
| Severity: | medium | Keywords: | |
| Cc: |
Description (last modified by )
With commit b106b273c877, bash completion files are read from /usr/share/bash-completion/completions even if the bash_completion package is not installed. But some files in this directory expect that the bash_completion package is installed, and use functions defined in that package, so that sourcing /etc/profile may fail if bash_completion is not installed.
I'm not sure what to do here. I think we should completely drop the reading of bash completion files if the bash_completion package is not installed. But others may have other ideas, so I open this ticket.
Change History (6)
comment:1 by , 8 months ago
| Description: | modified (diff) |
|---|
comment:2 by , 8 months ago
comment:3 by , 8 months ago
| Summary: | Review bach completion treatment in boot scripts → Review bash completion treatment in bash startup scripts |
|---|
comment:5 by , 8 months ago
I've commented out the bash-completion section at r12.4-1169-gcc01ef5e8c.
I don't think we need to keep the instructions as https://github.com/scop/bash-completion has provided a detailed (and more correct than ours) installation process.
comment:6 by , 8 months ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Closing. If proposing adding bash-completion as a BLFS package please open a new ticket.

I'd propose a more aggressive approach: drop this script at all as bash-completion is not a BLFS package. If we keep a script to support a non-BLFS package, it's likely we'll never test it and the script will simply get bit-rotten.
And, anyway it's incorrect to put it as a part of profile. It should be a part of bashrc instead, if we must keep it. Or anything other than the login shell won't have the completion anyway (because the completion functions are not exported): terminal emulators and even simply typing "bash" to open a sub-shell.
The README file of the bash-completion project also says it should be sourced from bashrc.