Skip to content

Commit c531203

Browse files
ramsay-jonesgitster
authored andcommitted
Makefile: don't use a versioned temp distribution directory
The 'dist' target uses a versioned temp directory, $(GIT_TARNAME), into which it copies various files added to the distribution tarball. Should it be necessary to remove this directory in the 'clean' target, since the name depends on $(GIT_VERSION), the current HEAD must be positioned on the same commit as when 'make dist' was issued. Otherwise, the target will fail to remove that directory. Create an '.dist-tmp-dir' directory and copy the various files into this now un-versioned directory while creating the distribution tarball. Change the 'clean' target to remove the '.dist-tmp-dir' directory, instead of the version dependent $(GIT_TARNAME) directory. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 98836a8 commit c531203

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3061,9 +3061,9 @@ GIT_TARNAME = git-$(GIT_VERSION)
30613061
GIT_ARCHIVE_EXTRA_FILES = \
30623062
--prefix=$(GIT_TARNAME)/ \
30633063
--add-file=configure \
3064-
--add-file=$(GIT_TARNAME)/version \
3064+
--add-file=.dist-tmp-dir/version \
30653065
--prefix=$(GIT_TARNAME)/git-gui/ \
3066-
--add-file=$(GIT_TARNAME)/git-gui/version
3066+
--add-file=.dist-tmp-dir/git-gui/version
30673067
ifdef DC_SHA1_SUBMODULE
30683068
GIT_ARCHIVE_EXTRA_FILES += \
30693069
--prefix=$(GIT_TARNAME)/sha1collisiondetection/ \
@@ -3075,13 +3075,14 @@ GIT_ARCHIVE_EXTRA_FILES += \
30753075
--add-file=sha1collisiondetection/lib/ubc_check.h
30763076
endif
30773077
dist: git-archive$(X) configure
3078-
@mkdir -p $(GIT_TARNAME)
3079-
@echo $(GIT_VERSION) > $(GIT_TARNAME)/version
3080-
@$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version
3078+
@$(RM) -r .dist-tmp-dir
3079+
@mkdir .dist-tmp-dir
3080+
@echo $(GIT_VERSION) > .dist-tmp-dir/version
3081+
@$(MAKE) -C git-gui TARDIR=../.dist-tmp-dir/git-gui dist-version
30813082
./git-archive --format=tar \
30823083
$(GIT_ARCHIVE_EXTRA_FILES) \
30833084
--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar
3084-
@$(RM) -r $(GIT_TARNAME)
3085+
@$(RM) -r .dist-tmp-dir
30853086
gzip -f -9 $(GIT_TARNAME).tar
30863087

30873088
rpm::
@@ -3158,7 +3159,7 @@ clean: profile-clean coverage-clean cocciclean
31583159
$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json
31593160
$(RM) -r po/build/
31603161
$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*
3161-
$(RM) -r $(GIT_TARNAME) .doc-tmp-dir
3162+
$(RM) -r .dist-tmp-dir .doc-tmp-dir
31623163
$(RM) $(GIT_TARNAME).tar.gz
31633164
$(RM) $(htmldocs).tar.gz $(manpages).tar.gz
31643165
$(MAKE) -C Documentation/ clean

0 commit comments

Comments
 (0)