]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Makefile: use git init/add/commit/archive for dist-doc
authorRené Scharfe <l.s.r@web.de>
Sat, 10 Oct 2020 16:45:18 +0000 (18:45 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 12 Oct 2020 19:16:07 +0000 (12:16 -0700)
Reduce the dependency on external tools by generating the distribution
archives for HTML documentation and manpages using git commands instead
of tar. This gives the archive entries the same meta data as those in
the dist archive for binaries.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile

index 95571ee3fcaf7969e62d850f4fe6712f959f6980..b7f3708292086caba9b63807a8a8a265d19ea6f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3105,11 +3105,15 @@ artifacts-tar:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \
 htmldocs = git-htmldocs-$(GIT_VERSION)
 manpages = git-manpages-$(GIT_VERSION)
 .PHONY: dist-doc distclean
-dist-doc:
+dist-doc: git$X
        $(RM) -r .doc-tmp-dir
        mkdir .doc-tmp-dir
        $(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
-       cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar $(TAR_DIST_EXTRA_OPTS) .
+       ./git -C .doc-tmp-dir init
+       ./git -C .doc-tmp-dir add .
+       ./git -C .doc-tmp-dir commit -m htmldocs
+       ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \
+               > $(htmldocs).tar
        gzip -n -9 -f $(htmldocs).tar
        :
        $(RM) -r .doc-tmp-dir
@@ -3119,7 +3123,11 @@ dist-doc:
                man5dir=../.doc-tmp-dir/man5 \
                man7dir=../.doc-tmp-dir/man7 \
                install
-       cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar $(TAR_DIST_EXTRA_OPTS) .
+       ./git -C .doc-tmp-dir init
+       ./git -C .doc-tmp-dir add .
+       ./git -C .doc-tmp-dir commit -m manpages
+       ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \
+               > $(manpages).tar
        gzip -n -9 -f $(manpages).tar
        $(RM) -r .doc-tmp-dir