{"thread":{"id":"54783","subject":"[PATCH v2 5/5] Makefile: don't use a versioned temp distribution directory","startedAt":"2020-12-07T00:37:04Z","lastAt":"2020-12-07T00:37:04Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":2,"patchTotal":5},"messages":[{"id":"411577","messageId":"89325f36-9fae-9575-4fe9-fc6a9261fadb@ramsayjones.plus.com","threadId":"54783","inReplyTo":null,"subject":"[PATCH v2 5/5] Makefile: don't use a versioned temp distribution directory","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2020-12-07T00:36:26Z","receivedAt":"2020-12-07T00:37:04Z","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 distribution tarball. Should\nit be necessary to remove this directory in the 'clean' target, since\nthe name depends on $(GIT_VERSION), the current HEAD must be positioned\non the same commit as when 'make dist' was issued. Otherwise, the target\nwill fail to remove that directory.\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"}]}