Skip to content

Commit bc2ed31

Browse files
avargitster
authored andcommitted
Makefile: under "make dist", include the sha1collisiondetection submodule
Include the sha1collisiondetection submodule when running "make dist". Even though we've been shipping the sha1collisiondetection submodule[1] and using it by default if it's checked out[2] anyone downloading git as a tarball would just get an empty sha1collisiondetection/ directory. Doing this automatically is a feature that's missing from git-archive, but in the meantime let's bundle this up into the tarball we ship. This ensures that the DC_SHA1_SUBMODULE flag does what's intended even in an unpacked tarball, and more importantly means we're building the exact same code from the same paths from git.git and from the tarball. I am not including all the files in the submodule, only the ones git actually needs (and the licenses), only including some files like this would be a useful feature if git-archive ever adds the ability to bundle up submodules. 1. commit 86cfd61 ("sha1dc: optionally use sha1collisiondetection as a submodule", 2017-07-01) 2. cac87dc ("sha1collisiondetection: automatically enable when submodule is populated", 2017-07-01) Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f39e05f commit bc2ed31

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2642,6 +2642,21 @@ dist: git-archive$(X) configure
26422642
$(GIT_TARNAME)/configure \
26432643
$(GIT_TARNAME)/version \
26442644
$(GIT_TARNAME)/git-gui/version
2645+
ifdef DC_SHA1_SUBMODULE
2646+
@mkdir -p $(GIT_TARNAME)/sha1collisiondetection/lib
2647+
@cp sha1collisiondetection/LICENSE.txt \
2648+
$(GIT_TARNAME)/sha1collisiondetection/
2649+
@cp sha1collisiondetection/LICENSE.txt \
2650+
$(GIT_TARNAME)/sha1collisiondetection/
2651+
@cp sha1collisiondetection/lib/sha1.[ch] \
2652+
$(GIT_TARNAME)/sha1collisiondetection/lib/
2653+
@cp sha1collisiondetection/lib/ubc_check.[ch] \
2654+
$(GIT_TARNAME)/sha1collisiondetection/lib/
2655+
$(TAR) rf $(GIT_TARNAME).tar \
2656+
$(GIT_TARNAME)/sha1collisiondetection/LICENSE.txt \
2657+
$(GIT_TARNAME)/sha1collisiondetection/lib/sha1.[ch] \
2658+
$(GIT_TARNAME)/sha1collisiondetection/lib/ubc_check.[ch]
2659+
endif
26452660
@$(RM) -r $(GIT_TARNAME)
26462661
gzip -f -9 $(GIT_TARNAME).tar
26472662

0 commit comments

Comments
 (0)