91.1. bash-completion-2.18.0
Programmable completion for the bash shell
| Version | 2.18.0, release 1 |
| Shelf | shells — Interactive shells and their add-ons, terminal multiplexers, and terminal emulators |
| Phase | 41_system (System), 31 of 1047 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://github.com/scop/bash-completion |
| Build time | 0.1 SBU |
| Installed size | 1.0 MiB in 1110 files |
| Recipe | ports/core/shells/bash-completion/kpkgbuild |
About
bash-completion is the programmable completion collection for bash: the bash_completion loader and the completion scripts for common commands, kept under /usr/share/bash-completion. The system bash.bashrc sources the loader in every interactive shell that is not in POSIX mode (see Shell environment). The loader reads a command’s file the first time that command is completed, looking for <command>.bash or <command> in ~/.local/share/bash-completion/completions first, then in /usr/share/bash-completion/completions, where other packages put theirs. Its own scripts live in completions-core beside that directory and are read only when no package supplies one; those in completions-fallback, for commands that usually ship their own, come last.
Sources
bash-completion-2.18.0.tar.xz(480.5 KiB)
sha25688bcf85124f77f74f2f2f8bcd16ac4382d807a827ede742a64940c7116aea33f
upstream: https://github.com/scop/bash-completion/releases/download/2.18.0/bash-completion-2.18.0.tar.xz
archive copy: sources-4/shells--bash-completion-2.18.0.tar.xz
Dependencies
Depends on: bash.
Required by (21): appstream, bubblewrap, dconf, flashrom, fwupd, gimp, gstreamer, gtk4, libmbim, libnbd, libqmi, libsecret, libstoragemgmt, modemmanager, mosh, nbdkit, ndctl, notmuch, opensc, p11-kit, swayimg.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install bash-completion'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/shells/bash-completion.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/shells/bash-completion
echo '88bcf85124f77f74f2f2f8bcd16ac4382d807a827ede742a64940c7116aea33f bash-completion-2.18.0.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/bash-completion
SRC=$SRC_ROOT/bash-completion-2.18.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf bash-completion-2.18.0.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
./configure --prefix=/usr --sysconfdir=/etc
make
make DESTDIR=$PKG install
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/bash-completion, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf bash-completion-2.18.0-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/bash-completion, and runs the triggers its paths call for.
Contents
Installed directories: /usr/share/bash-completion/completions-core, /usr/share/bash-completion/completions-fallback, /usr/share/bash-completion/helpers-core, /usr/share/bash-completion/startup-core, /usr/share/cmake/bash-completion, /usr/share/licenses/bash-completion.
Short descriptions
bash-completion.pc |
programmable completion for the bash shell |
Notes
A port can depend on it for its build rather than for run time. Build systems ask pkg-config for bash-completion and read its completionsdir variable to decide where, and whether, to install their own completion files; libnbd’s configure, for one, installs none when the module is missing, and fails when --with-bash-completions asks for them. A package that lacks its completion files, with no error in the build log, may be missing this dependency.
A completion file belongs in /usr/share/bash-completion/completions, named after the command it completes. The package lint refuses /etc/bash_completion.d, which upstream keeps only as a compatibility directory; see What the package lint refuses.