From a6acdac1cf3bcdf0f22b9f82a72a2fe6d3f127e8 Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 4 Sep 2018 11:12:07 +0200 Subject: [PATCH] Stop port recipe Git fallthrough with CONTRIB_DIR/.git Ref #2959 --- tool/ports/mk/front_end.inc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tool/ports/mk/front_end.inc b/tool/ports/mk/front_end.inc index 577bfe4acd..eb5795ad29 100644 --- a/tool/ports/mk/front_end.inc +++ b/tool/ports/mk/front_end.inc @@ -45,6 +45,18 @@ _REL_HASH_FILE := $(notdir $(REP_DIR))/ports/$(notdir $(PORT)) # directory where to install the port PORT_DIR := $(CONTRIB_DIR)/$(PORT_NAME)-$(HASH) +# +# Protect the GENODE_DIR Git repository by creating an +# empty Git repository in CONTRIB_DIR. This is to catch +# Git tools called by port recipes from falling through +# the parent directories of PORT_DIR and affecting other +# Git repositories. +# +$(PORT_DIR): $(CONTRIB_DIR)/.git +$(CONTRIB_DIR)/.git: + $(VERBOSE)mkdir -p $(CONTRIB_DIR) + $(VERBOSE)git init --quiet $(CONTRIB_DIR) + # path to hash file generated during installation PORT_HASH_FILE := $(PORT_DIR)/$(PORT_NAME).hash