commit:     3dffcd2ac9ffe5dc8b2f679bb8dbe61cbbc1c907
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Tue Feb  3 18:42:49 2026 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sun Feb  8 08:26:04 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3dffcd2a

app-containers/cri-tools: Use sysroot.eclass for shell completion

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 app-containers/cri-tools/cri-tools-1.33.0.ebuild | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/app-containers/cri-tools/cri-tools-1.33.0.ebuild 
b/app-containers/cri-tools/cri-tools-1.33.0.ebuild
index 241db61dc90c..f6e80fa32396 100644
--- a/app-containers/cri-tools/cri-tools-1.33.0.ebuild
+++ b/app-containers/cri-tools/cri-tools-1.33.0.ebuild
@@ -1,9 +1,9 @@
-# Copyright 2021-2025 Gentoo Authors
+# Copyright 2021-2026 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 
-inherit go-env go-module shell-completion toolchain-funcs
+inherit go-env go-module shell-completion sysroot
 
 DESCRIPTION="CLI and validation tools for Kubelet Container Runtime (CRI)"
 HOMEPAGE="https://github.com/kubernetes-sigs/cri-tools";
@@ -21,18 +21,14 @@ src_compile() {
        CRICTL="build/bin/${GOOS}/${GOARCH}/crictl"
        emake VERSION="${PV}"
 
-       if ! tc-is-cross-compiler; then
-               "${CRICTL}" completion bash > crictl.bash || die
-               "${CRICTL}" completion zsh > crictl.zsh || die
-       fi
+       sysroot_try_run_prefixed "${CRICTL}" completion bash > crictl.bash || 
die
+       sysroot_try_run_prefixed "${CRICTL}" completion zsh > crictl.zsh || die
 }
 
 src_install() {
        einstalldocs
        dobin "${CRICTL}"
 
-       if ! tc-is-cross-compiler; then
-               newbashcomp crictl.bash crictl
-               newzshcomp crictl.zsh _crictl
-       fi
+       [[ -s crictl.bash ]] && newbashcomp crictl.bash crictl
+       [[ -s crictl.zsh ]] && newzshcomp crictl.zsh _crictl
 }

Reply via email to