Drop chcat/chtail/chgrep symlink entrypoints; ship chlog subcommands only
The RPM's /usr/bin/chcat conflicts with SELinux's policycoreutils-python-utils on Fedora. Per Ben: remove the symlink entrypoints entirely and ship only the chlog binary with cat/tail/grep subcommands. - Remove chcat/chtail/chgrep symlinks and their completions from nfpm.yaml, build-rpm.sh and the Makefile - Remove the argv[0] dispatch in main.go; subcommands are unchanged - Update the completion test to cover chlog only - Update README usage to chlog cat|tail|grep
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
BINARY := chlog
|
||||
# chcat/chtail/chgrep are argv[0]-dispatched symlinks to the single chlog binary.
|
||||
LINKS := chcat chtail chgrep
|
||||
DIST := dist
|
||||
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
|
||||
GOFLAGS := -ldflags="-s -w -X main.version=$(VERSION)"
|
||||
@@ -13,7 +11,6 @@ all: build
|
||||
|
||||
build:
|
||||
CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) go build $(GOFLAGS) -o $(DIST)/$(BINARY) .
|
||||
@for l in $(LINKS); do ln -sf $(BINARY) $(DIST)/$$l; done
|
||||
|
||||
test:
|
||||
go test -v -race ./...
|
||||
@@ -30,14 +27,12 @@ clean:
|
||||
install:
|
||||
go install $(GOFLAGS) .
|
||||
|
||||
# Generate bash/zsh/fish completions for chlog and each symlink entrypoint.
|
||||
# Generate bash/zsh/fish completions for chlog.
|
||||
completions: build
|
||||
@mkdir -p $(DIST)/completions
|
||||
@for b in $(BINARY) $(LINKS); do \
|
||||
$(DIST)/$$b completion bash > $(DIST)/completions/$$b.bash; \
|
||||
$(DIST)/$$b completion zsh > $(DIST)/completions/_$$b; \
|
||||
$(DIST)/$$b completion fish > $(DIST)/completions/$$b.fish; \
|
||||
done
|
||||
@$(DIST)/$(BINARY) completion bash > $(DIST)/completions/$(BINARY).bash
|
||||
@$(DIST)/$(BINARY) completion zsh > $(DIST)/completions/_$(BINARY)
|
||||
@$(DIST)/$(BINARY) completion fish > $(DIST)/completions/$(BINARY).fish
|
||||
|
||||
rpm: build rpm-package
|
||||
|
||||
|
||||
Reference in New Issue
Block a user