{"thread":{"id":"54585","subject":"[PATCH 6/8] Makefile: don't use a versioned temp distribution directory","startedAt":"2020-11-05T21:08:45Z","lastAt":"2020-11-05T21:08:45Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"409227","messageId":"5add11fe-6d94-f2e0-f91c-360a7844c720@ramsayjones.plus.com","threadId":"54585","inReplyTo":null,"subject":"[PATCH 6/8] Makefile: don't use a versioned temp distribution directory","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2020-11-05T21:08:40Z","receivedAt":"2020-11-05T21:08:45Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nThe 'dist' target uses a versioned temp directory, $(GIT_TARNAME), into\nwhich it copies various files added to the distibution tarball. A future\npatch requires the 'clean' target not to depend on the $(GIT_VERSION)\nvariable. However, the $(GIT_TARNAME) variable contains $(GIT_VERSION) in\nits definition.\n\nCreate an '.dist-tmp-dir' directory and copy the various files into this\nnow un-versioned directory while creating the distribution tarball. Change\nthe 'clean' target to remove the '.dist-tmp-dir' directory, instead of the\nversion dependent $(GIT_TARNAME) directory.\n\nSigned-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>\n---\n Makefile | 15 ++++++++-------\n 1 file changed, 8 insertions(+), 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 09d6f23b88..90e91a2185 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -3060,9 +3060,9 @@ GIT_TARNAME = git-$(GIT_VERSION)\n GIT_ARCHIVE_EXTRA_FILES = \\\n \t--prefix=$(GIT_TARNAME)/ \\\n \t--add-file=configure \\\n-\t--add-file=$(GIT_TARNAME)/version \\\n+\t--add-file=.dist-tmp-dir/version \\\n \t--prefix=$(GIT_TARNAME)/git-gui/ \\\n-\t--add-file=$(GIT_TARNAME)/git-gui/version\n+\t--add-file=.dist-tmp-dir/git-gui/version\n ifdef DC_SHA1_SUBMODULE\n GIT_ARCHIVE_EXTRA_FILES += \\\n \t--prefix=$(GIT_TARNAME)/sha1collisiondetection/ \\\n@@ -3074,13 +3074,14 @@ GIT_ARCHIVE_EXTRA_FILES += \\\n \t--add-file=sha1collisiondetection/lib/ubc_check.h\n endif\n dist: git-archive$(X) configure\n-\t@mkdir -p $(GIT_TARNAME)\n-\t@echo $(GIT_VERSION) > $(GIT_TARNAME)/version\n-\t@$(MAKE) -C git-gui TARDIR=../$(GIT_TARNAME)/git-gui dist-version\n+\t@$(RM) -r .dist-tmp-dir\n+\t@mkdir .dist-tmp-dir\n+\t@echo $(GIT_VERSION) > .dist-tmp-dir/version\n+\t@$(MAKE) -C git-gui TARDIR=../.dist-tmp-dir/git-gui dist-version\n \t./git-archive --format=tar \\\n \t\t$(GIT_ARCHIVE_EXTRA_FILES) \\\n \t\t--prefix=$(GIT_TARNAME)/ HEAD^{tree} > $(GIT_TARNAME).tar\n-\t@$(RM) -r $(GIT_TARNAME)\n+\t@$(RM) -r .dist-tmp-dir\n \tgzip -f -9 $(GIT_TARNAME).tar\n \n rpm::\n@@ -3149,7 +3150,7 @@ clean: profile-clean coverage-clean cocciclean\n \t$(RM) -r bin-wrappers $(dep_dirs) $(compdb_dir) compile_commands.json\n \t$(RM) -r po/build/\n \t$(RM) *.pyc *.pyo */*.pyc */*.pyo $(GENERATED_H) $(ETAGS_TARGET) tags cscope*\n-\t$(RM) -r $(GIT_TARNAME) .doc-tmp-dir\n+\t$(RM) -r .dist-tmp-dir .doc-tmp-dir\n \t$(RM) $(GIT_TARNAME).tar.gz\n \t$(RM) $(htmldocs).tar.gz $(manpages).tar.gz\n \t$(MAKE) -C Documentation/ clean\n-- \n2.29.0\n"}]}