Makefile: use git init/add/commit/archive for dist-doc
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>
René Scharfe committed
Oct 10, 2020 at 18:45 UTC
93e70311730b3c93c7f1357b7644355a5f04bba3
1 file changed
+11
-3
Makefile
+11
-3
@@ -3105,11 +3105,15 @@ artifacts-tar:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \
3105
htmldocs = git-htmldocs-$(GIT_VERSION)
3106
manpages = git-manpages-$(GIT_VERSION)
3107
.PHONY: dist-doc distclean
3108
-dist-doc:
3108
+dist-doc: git$X
3109
$(RM) -r .doc-tmp-dir
3110
mkdir .doc-tmp-dir
3111
$(MAKE) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
3112
- cd .doc-tmp-dir && $(TAR) cf ../$(htmldocs).tar $(TAR_DIST_EXTRA_OPTS) .
3112
+ ./git -C .doc-tmp-dir init
3113
+ ./git -C .doc-tmp-dir add .
3114
+ ./git -C .doc-tmp-dir commit -m htmldocs
3115
+ ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \
3116
+ > $(htmldocs).tar
3117
gzip -n -9 -f $(htmldocs).tar
3118
:
3119
$(RM) -r .doc-tmp-dir
@@ -3119,7 +3123,11 @@ dist-doc:
3123
man5dir=../.doc-tmp-dir/man5 \
3124
man7dir=../.doc-tmp-dir/man7 \
3125
install
3122
- cd .doc-tmp-dir && $(TAR) cf ../$(manpages).tar $(TAR_DIST_EXTRA_OPTS) .
3126
+ ./git -C .doc-tmp-dir init
3127
+ ./git -C .doc-tmp-dir add .
3128
+ ./git -C .doc-tmp-dir commit -m manpages
3129
+ ./git -C .doc-tmp-dir archive --format=tar --prefix=./ HEAD^{tree} \
3130
+ > $(manpages).tar
3131
gzip -n -9 -f $(manpages).tar
3132
$(RM) -r .doc-tmp-dir
3133