Skip to contentSkip to conversation

docker: Fix git-archive for submodules

PATCH In review Fam Zheng 3 participants 3 messages Jun 3, 2016 – Jun 6, 2016

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 docker: Fix git-archive for submodules

If dtc or pixman submodule is initialized, "git archive" in the subshell gets a relative filename against $(SRC_PATH), while we have already cd'ed into the submodule directory.

Prefix it with $(CURDIR), which is the full path to the working directory.

---
 tests/docker/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/docker/Makefile.include +1 -1
index 2fd2ca3..3788cd8 100644
@@ -29,7 +29,7 @@ make-archive-maybe = $(if $(wildcard $1/*), \
 
 CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
 # Makes the definition constant after the first expansion
-DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY)
+DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := $(CURDIR)/docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY)
 
 $(DOCKER_SRC_COPY):
 	@mkdir $@
Signature · 1 line
2.8.2
Tested-by on v1 1/1
#1 lore raw
Quoted 17 lines · Fam Zheng

If dtc or pixman submodule is initialized, "git archive" in the subshell gets a relative filename against $(SRC_PATH), while we have already cd'ed into the submodule directory.

Prefix it with $(CURDIR), which is the full path to the working directory.

---
  tests/docker/Makefile.include | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tests/docker/Makefile.include +0 -0
index 2fd2ca3..3788cd8 100644

tests/docker/Makefile.include make-archive-maybe = $(if $(wildcard $1/*), \ · line 35

Quoted 8 lines
tests/docker/Makefile.include +1 -1
@@ -29,7 +29,7 @@ make-archive-maybe = $(if $(wildcard $1/*), \
 
  CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
  # Makes the definition constant after the first expansion
-DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY)
+DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := $(CURDIR)/docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY)
 
  $(DOCKER_SRC_COPY):
  	@mkdir $@
#2 lore raw
In reply to Fam Zheng
Quoted 18 lines · Fam Zheng

If dtc or pixman submodule is initialized, "git archive" in the subshell gets a relative filename against $(SRC_PATH), while we have already cd'ed into the submodule directory.

Prefix it with $(CURDIR), which is the full path to the working directory.

---
 tests/docker/Makefile.include | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/docker/Makefile.include +0 -0
index 2fd2ca3..3788cd8 100644

tests/docker/Makefile.include make-archive-maybe = $(if $(wildcard $1/*), \ · line 35

Quoted 8 lines
tests/docker/Makefile.include +1 -1
@@ -29,7 +29,7 @@ make-archive-maybe = $(if $(wildcard $1/*), \
 
 CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
 # Makes the definition constant after the first expansion
-DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY)
+DOCKER_SRC_COPY = $(eval DOCKER_SRC_COPY := $(CURDIR)/docker-src.$(CUR_TIME))$(DOCKER_SRC_COPY)
 
 $(DOCKER_SRC_COPY):
 	@mkdir $@

Good, another possibility is to use "> $2" instead of "-o $2" in git-archive. I was going to send a patch now for this possibility, you can choose the one you prefer.

Thanks,

Paolo