Drop shell completions from the RPM
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

This commit is contained in:
2026-10-24 17:38:05 +11:00
parent ea4ed4af9d
commit 2e3dafb28a
3 changed files with 4 additions and 28 deletions
+2 -9
View File
@@ -10,7 +10,7 @@ TAGS := remote,exclude_graphdriver_btrfs,containers_image_openpgp
OS ?= $(shell go env GOOS)
ARCH ?= $(shell go env GOARCH)
.PHONY: all build bin images test vet lint fmt pre-commit clean completions rpm rpm-package patch minor major _tag
.PHONY: all build bin images test vet lint fmt pre-commit clean rpm rpm-package patch minor major _tag
all: build
@@ -41,14 +41,7 @@ pre-commit:
clean:
rm -rf $(DIST)
# Generate bash/zsh/fish completions into dist/completions.
completions: bin
@mkdir -p $(DIST)/completions
$(DIST)/$(BINARY) completion bash > $(DIST)/completions/$(BINARY).bash
$(DIST)/$(BINARY) completion zsh > $(DIST)/completions/_$(BINARY)
$(DIST)/$(BINARY) completion fish > $(DIST)/completions/$(BINARY).fish
# Build the binary then package it (with completions) into an RPM via nfpm.
# Build the binary then package it into an RPM via nfpm.
rpm: bin rpm-package
# Package an already-built binary into an RPM (used by CI after the build step).
-12
View File
@@ -21,15 +21,3 @@ contents:
dst: /usr/share/agent-sandbox/allowed-hosts
file_info:
mode: 0644
- src: dist/completions/agent-sandbox.bash
dst: /usr/share/bash-completion/completions/agent-sandbox
file_info:
mode: 0644
- src: dist/completions/_agent-sandbox
dst: /usr/share/zsh/site-functions/_agent-sandbox
file_info:
mode: 0644
- src: dist/completions/agent-sandbox.fish
dst: /usr/share/fish/vendor_completions.d/agent-sandbox.fish
file_info:
mode: 0644
+2 -7
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Package the (already built) agent-sandbox binary, its shell completions and
# the default allowlist into an RPM with nfpm.
# Package the (already built) agent-sandbox binary and the default
# allowlist into an RPM with nfpm.
# Usage: scripts/build-rpm.sh [version] (defaults to $CI_COMMIT_TAG)
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
@@ -15,11 +15,6 @@ if [[ ! -f $DIST/$BINARY ]]; then
exit 1
fi
mkdir -p "$DIST/completions"
"./$DIST/$BINARY" completion bash >"$DIST/completions/$BINARY.bash"
"./$DIST/$BINARY" completion zsh >"$DIST/completions/_$BINARY"
"./$DIST/$BINARY" completion fish >"$DIST/completions/$BINARY.fish"
export PACKAGE_VERSION="${VERSION#v}"
envsubst <packaging/nfpm.yaml >"$DIST/nfpm.yaml"
nfpm pkg --config "$DIST/nfpm.yaml" --target "$DIST" --packager rpm