Skip to content

Commit 0e73b2b

Browse files
jklippelAbdulrhmnGhanem
authored andcommitted
add a directory prefix gitea-src-VERSION to release-tar-file (go-gitea#19396)
Use a directory prefix instead on creating the tar file. Fixes: go-gitea#19066
1 parent 15e2f2e commit 0e73b2b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,9 @@ release-sources: | $(DIST_DIRS)
646646
echo $(VERSION) > $(STORED_VERSION_FILE)
647647
# bsdtar needs a ^ to prevent matching subdirectories
648648
$(eval EXCL := --exclude=$(shell tar --help | grep -q bsdtar && echo "^")./)
649-
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
649+
# use transform to a add a release-folder prefix; in bsdtar the transform parameter equivalent is -s
650+
$(eval TRANSFORM := $(shell tar --help | grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'" || echo "--transform 's|^./|gitea-src-$(VERSION)/|'"))
651+
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
650652
rm -f $(STORED_VERSION_FILE)
651653

652654
.PHONY: release-docs

0 commit comments

Comments
 (0)