From 976ce3fb343211de87fb074f5392f5fde1310f32 Mon Sep 17 00:00:00 2001 From: Janki Chhatbar Date: Wed, 5 Jul 2023 15:16:45 +0530 Subject: [PATCH] Rename subctl binary to `subctl` Currently while building a subctl is binary is named as `subctl-$version-$arch`. This PR does following changes while creating a tar of the binary: 1. Rename the binary to just `subctl`. This is one of the requirements of Krew. 2. Remove the redundant child directory so that on untar'ing the binary is at `subctl-$version-$arch/` path instead of `subctl-$version-$arch/subctl-$version` Epic: https://github.com/submariner-io/enhancements/issues/182 Signed-off-by: Janki Chhatbar --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 429131fbc..5a5210f1c 100644 --- a/Makefile +++ b/Makefile @@ -37,10 +37,10 @@ include $(SHIPYARD_DIR)/Makefile.inc gotodockerarch = $(patsubst arm,arm/v7,$(1)) dockertogoarch = $(patsubst arm/v7,arm,$(1)) -CROSS_TARGETS := linux-amd64 linux-arm64 linux-arm linux-s390x linux-ppc64le windows-amd64.exe darwin-amd64 darwin-arm64 +CROSS_TARGETS := linux-amd64 #linux-arm64 linux-arm linux-s390x linux-ppc64le windows-amd64.exe darwin-amd64 darwin-arm64 BINARIES := cmd/bin/subctl CROSS_BINARIES := $(foreach cross,$(CROSS_TARGETS),$(patsubst %,cmd/bin/subctl-$(VERSION)-%,$(cross))) -CROSS_TARBALLS := $(foreach cross,$(CROSS_TARGETS),$(patsubst %,dist/subctl-$(VERSION)-%.tar.xz,$(cross))) \ +CROSS_TARBALLS := $(foreach cross,$(CROSS_TARGETS),$(patsubst %,dist/subctl-$(VERSION)-%.tar.xz,$(cross))) $(foreach cross,$(CROSS_TARGETS),$(patsubst %,dist/subctl-$(VERSION)-%.tar.gz,$(cross))) override E2E_ARGS += cluster1 cluster2 @@ -92,11 +92,11 @@ cmd/bin/subctl: cmd/bin/subctl-$(VERSION)-$(GOOS)-$(GOARCH)$(GOEXE) dist/subctl-%.tar.xz: cmd/bin/subctl-% mkdir -p dist - tar -cJf $@ --transform "s/^cmd.bin/subctl-$(VERSION)/" $< + tar -cJf $@ --transform "s|^cmd/bin/subctl-[^/]*|subctl|" $< dist/subctl-%.tar.gz: cmd/bin/subctl-% mkdir -p dist - tar -czf $@ --transform "s/^cmd.bin/subctl-$(VERSION)/" $< + tar -cf $@ --transform "s|^cmd/bin/subctl-[^/]*|subctl|" $< dist/subctl-checksums.txt: $(CROSS_TARBALLS) cd $(@D) && sha256sum $(^F) >> $(@F)