From ddfe5bf22e1bbb163225e9383d4221405bb625c6 Mon Sep 17 00:00:00 2001 From: renner Date: Wed, 21 Jan 2026 17:03:28 +0100 Subject: [PATCH 1/3] Makefile/rpm: Add shell completions Signed-off-by: renner --- Makefile | 12 +++++++++++- contrib/packaging/bootc.spec | 7 +++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7c661446f..04b429b55 100644 --- a/Makefile +++ b/Makefile @@ -43,8 +43,15 @@ bin: manpages manpages: cargo run --release --package xtask -- manpages +.PHONY: completion +completion: + mkdir -p target/completion + for shell in bash elvish fish powershell zsh; do \ + target/release/bootc completion $$shell > target/completion/bootc.$$shell; \ + done + STORAGE_RELATIVE_PATH ?= $(shell realpath -m -s --relative-to="$(prefix)/lib/bootc/storage" /sysroot/ostree/bootc/storage) -install: +install: completion install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/bootc install -D -m 0755 -t $(DESTDIR)$(prefix)/bin target/release/system-reinstall-bootc install -d -m 0755 $(DESTDIR)$(prefix)/lib/bootc/bound-images.d @@ -54,6 +61,9 @@ install: install -d $(DESTDIR)$(prefix)/lib/bootc/install install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 target/man/*.5; \ install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 target/man/*.8; \ + install -D -m 0644 target/completion/bootc.bash $(DESTDIR)$(prefix)/share/bash-completion/completions/bootc + install -D -m 0644 target/completion/bootc.zsh $(DESTDIR)$(prefix)/share/zsh/site-functions/_bootc + install -D -m 0644 target/completion/bootc.fish $(DESTDIR)$(prefix)/share/fish/vendor_completions.d/bootc.fish install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer systemd/*.path systemd/*.target install -D -m 0644 -t $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/usr/lib/ostree/ baseimage/base/usr/lib/ostree/prepare-root.conf install -d -m 755 $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/sysroot diff --git a/contrib/packaging/bootc.spec b/contrib/packaging/bootc.spec index 8ba83a058..0f708681c 100644 --- a/contrib/packaging/bootc.spec +++ b/contrib/packaging/bootc.spec @@ -164,6 +164,10 @@ chmod +x %{?buildroot}/%{system_reinstall_bootc_install_podman_path} touch %{?buildroot}/%{_docdir}/bootc/baseimage/base/sysroot/.keepdir find %{?buildroot}/%{_docdir} ! -type d -printf '%{_docdir}/%%P\n' | sort > bootcdoclist.txt +install -Dpm 0644 target/completion/bootc.bash %{buildroot}%{bash_completions_dir}/bootc +install -Dpm 0644 target/completion/bootc.zsh %{buildroot}%{zsh_completions_dir}/_bootc +install -Dpm 0644 target/completion/bootc.fish %{buildroot}%{fish_completions_dir}/bootc.fish + %if %{with check} %check if grep -qEe 'Seccomp:.*0$' /proc/self/status; then @@ -190,6 +194,9 @@ fi %endif %{_unitdir}/* %{_mandir}/man*/*bootc* +%{bash_completions_dir}/bootc +%{zsh_completions_dir}/_bootc +%{fish_completions_dir}/bootc.fish %files -n system-reinstall-bootc %{_bindir}/system-reinstall-bootc From 9d85f39d41ec94eac4312886da6240b040d60bb2 Mon Sep 17 00:00:00 2001 From: renner Date: Thu, 22 Jan 2026 17:13:44 +0100 Subject: [PATCH 2/3] fix: old versions don't have these macros Signed-off-by: renner --- contrib/packaging/bootc.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contrib/packaging/bootc.spec b/contrib/packaging/bootc.spec index 0f708681c..ee63896d3 100644 --- a/contrib/packaging/bootc.spec +++ b/contrib/packaging/bootc.spec @@ -194,9 +194,15 @@ fi %endif %{_unitdir}/* %{_mandir}/man*/*bootc* +%if 0%{?rhel} >= 9 +%{_datadir}/bash-completion/completions/bootc +%{_datadir}/zsh/site-functions/_bootc +%{_datadir}/fish/vendor_completions.d/bootc.fish +%else %{bash_completions_dir}/bootc %{zsh_completions_dir}/_bootc %{fish_completions_dir}/bootc.fish +%endif %files -n system-reinstall-bootc %{_bindir}/system-reinstall-bootc From eaf920e5ea95bf633e84c8c110cbf26c1e7805f2 Mon Sep 17 00:00:00 2001 From: renner Date: Thu, 22 Jan 2026 17:22:00 +0100 Subject: [PATCH 3/3] Makefile: add elvish and powershell completion Not packaging those due to the lack of documentation on this. Signed-off-by: renner --- Makefile | 4 +++- contrib/packaging/bootc.spec | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 04b429b55..ab61de07f 100644 --- a/Makefile +++ b/Makefile @@ -62,8 +62,10 @@ install: completion install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man5 target/man/*.5; \ install -D -m 0644 -t $(DESTDIR)$(prefix)/share/man/man8 target/man/*.8; \ install -D -m 0644 target/completion/bootc.bash $(DESTDIR)$(prefix)/share/bash-completion/completions/bootc - install -D -m 0644 target/completion/bootc.zsh $(DESTDIR)$(prefix)/share/zsh/site-functions/_bootc + install -D -m 0644 target/completion/bootc.elvish $(DESTDIR)$(prefix)/share/elvish/lib/bootc.elv install -D -m 0644 target/completion/bootc.fish $(DESTDIR)$(prefix)/share/fish/vendor_completions.d/bootc.fish + install -D -m 0644 target/completion/bootc.powershell $(DESTDIR)$(prefix)/share/powershell/Modules/Bootc/Bootc.psm1 + install -D -m 0644 target/completion/bootc.zsh $(DESTDIR)$(prefix)/share/zsh/site-functions/_bootc install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer systemd/*.path systemd/*.target install -D -m 0644 -t $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/usr/lib/ostree/ baseimage/base/usr/lib/ostree/prepare-root.conf install -d -m 755 $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/sysroot diff --git a/contrib/packaging/bootc.spec b/contrib/packaging/bootc.spec index ee63896d3..a4af7d38c 100644 --- a/contrib/packaging/bootc.spec +++ b/contrib/packaging/bootc.spec @@ -164,9 +164,8 @@ chmod +x %{?buildroot}/%{system_reinstall_bootc_install_podman_path} touch %{?buildroot}/%{_docdir}/bootc/baseimage/base/sysroot/.keepdir find %{?buildroot}/%{_docdir} ! -type d -printf '%{_docdir}/%%P\n' | sort > bootcdoclist.txt -install -Dpm 0644 target/completion/bootc.bash %{buildroot}%{bash_completions_dir}/bootc -install -Dpm 0644 target/completion/bootc.zsh %{buildroot}%{zsh_completions_dir}/_bootc -install -Dpm 0644 target/completion/bootc.fish %{buildroot}%{fish_completions_dir}/bootc.fish +rm -f %{buildroot}/%{_prefix}/share/elvish/lib/bootc.elv +rm -f %{buildroot}/%{_prefix}/share/powershell/Modules/Bootc/Bootc.psm1 %if %{with check} %check