Try to implement .dist-ignore support for git-dist: after archive, export and recompress again by excluding .dist-ignore

This commit is contained in:
Riccardo Mottola 2023-02-06 21:19:49 +01:00
parent 5ee21206a8
commit 2ce2a05f45
2 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2023-02-06 Riccard Mottola <rm@gnu.org>
* Master/source-distribution.make
Try to implement .dist-ignore support for git-dist: after archive,
export and recompress again by excluding .dist-ignore
2022-12-28 Richard Frith-Macdonald <rfm@gnu.org>
* ANNOUNCE:

View file

@ -447,7 +447,13 @@ endif
git-dist:
$(ECHO_NOTHING)echo "Exporting from branch or tag $(GIT_TAG_NAME)-$(VERTAG) on local Git repository..."; \
if $(GIT) show $(GIT_TAG_NAME)-$(VERTAG):.dist-ignore 2>/dev/null >/dev/null; then \
echo "*Error* cannot export: dist-ignore is currently unused"; \
$(GIT) archive --format=tar.gz $(GIT_TAG_NAME)-$(VERTAG) -o $(ARCHIVE_FILE) --prefix=$(VERSION_NAME)/ ; \
echo "Extracting $(ARCHIVE_FILE)"; \
$(TAR) xzf $(ARCHIVE_FILE); \
rm $(ARCHIVE_FILE); \
$(TAR) cfX - $(VERSION_NAME)/.dist-ignore $(VERSION_NAME) \
| $(COMPRESSION_PROGRAM) > $(ARCHIVE_FILE); \
rm -rf $(VERSION_NAME); \
else \
$(GIT) archive --format=tar.gz $(GIT_TAG_NAME)-$(VERTAG) -o $(ARCHIVE_FILE) --prefix=$(VERSION_NAME)/ ; \
fi ; \