Browse Source

Use $(CACHE_DIR)/git instead of $(CACHE_DIR)/gits

Loïc Hoguin 1 year ago
parent
commit
269544fe49
2 changed files with 8 additions and 8 deletions
  1. 5 5
      core/deps.mk
  2. 3 3
      test/core_deps.mk

+ 5 - 5
core/deps.mk

@@ -711,18 +711,18 @@ endef
 ifeq ($(CACHE_DEPS),1)
 
 define dep_cache_fetch_git
-	mkdir -p $(CACHE_DIR)/gits; \
-	if test -d "$(join $(CACHE_DIR)/gits/,$(call dep_name,$1))"; then \
-		cd $(join $(CACHE_DIR)/gits/,$(call dep_name,$1)); \
+	mkdir -p $(CACHE_DIR)/git; \
+	if test -d "$(join $(CACHE_DIR)/git/,$(call dep_name,$1))"; then \
+		cd $(join $(CACHE_DIR)/git/,$(call dep_name,$1)); \
 		if ! git checkout -q $(call dep_commit,$1); then \
 			git remote set-url origin $(call dep_repo,$1) && \
 			git pull --all && \
 			git cat-file -e $(call dep_commit,$1) 2>/dev/null; \
 		fi; \
 	else \
-		git clone -q -n -- $(call dep_repo,$1) $(join $(CACHE_DIR)/gits/,$(call dep_name,$1)); \
+		git clone -q -n -- $(call dep_repo,$1) $(join $(CACHE_DIR)/git/,$(call dep_name,$1)); \
 	fi; \
-	git clone -q --branch $(call dep_commit,$1) --single-branch -- $(join $(CACHE_DIR)/gits/,$(call dep_name,$1)) $2
+	git clone -q --branch $(call dep_commit,$1) --single-branch -- $(join $(CACHE_DIR)/git/,$(call dep_name,$1)) $2
 endef
 
 define dep_fetch_git

+ 3 - 3
test/core_deps.mk

@@ -129,13 +129,13 @@ core-deps-cache-git: init
 	$t test -d $(CACHE_DIR)
 
 	$i "Check that Cowlib was cloned in the cache"
-	$t test -d $(CACHE_DIR)/gits/cowlib
+	$t test -d $(CACHE_DIR)/git/cowlib
 
 	$i "Distclean the application"
 	$t $(MAKE) -C $(APP) distclean $v
 
 	$i "Check that Cowlib is still in the cache"
-	$t test -d $(CACHE_DIR)/gits/cowlib
+	$t test -d $(CACHE_DIR)/git/cowlib
 
 	$i "Break the Cowlib git link so we're forced to use the cache"
 	$t echo 'dep_cowlib = git bad_url master' >> $(APP)/Makefile
@@ -174,7 +174,7 @@ core-deps-cache-git-reuse: init
 	$t test -d $(CACHE_DIR)
 
 	$i "Check that Cowlib was cloned in the cache"
-	$t test -d $(CACHE_DIR)/gits/cowlib
+	$t test -d $(CACHE_DIR)/git/cowlib
 
 	$i "Build the dependencies in $(APP)_2"
 	$t $(MAKE) -C $(APP)_2 deps $v