Skip to content

Commit 985bb78

Browse files
committed
add a directory prefix to release-tar-file
Do not package tar file such that the sources are unpacked into the current working directory. Use a directory prefix instead on creating the tar file. Fixes: #19066
1 parent 3255ba9 commit 985bb78

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,10 @@ 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 "--transform 's|^./|gitea-src-$(VERSION)/|'"))
651+
$(eval TRANSFORM := $(shell tar --help| grep -q bsdtar && echo "-s '/^./gitea-src-$(VERSION)/'"))
652+
tar $(addprefix $(EXCL),$(TAR_EXCLUDES)) $(TRANSFORM) -czf $(DIST)/release/gitea-src-$(VERSION).tar.gz .
650653
rm -f $(STORED_VERSION_FILE)
651654

652655
.PHONY: release-docs

0 commit comments

Comments
 (0)