build/f_repos: Allow out-of-tree .git dir 87/22887/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sun, 9 Oct 2016 17:04:28 +0000 (19:04 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sun, 9 Oct 2016 17:07:11 +0000 (19:07 +0200)
ArmbandFuel@OPNFV uses Fuel@OPNFV git repo as a submodule, so
its .git dir is located outside work tree root (F_GIT_ROOT).

Allow this setup by parsing `git rev-parse --git-dir` intead of
harcoding git dir path.

Fixes: FUEL-200

Change-Id: Ia7f3b23e9333356fe05b9ed0565218f2c7ec8eba
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
build/config.mk
build/f_repos/Makefile

index ab30518..b9be44f 100644 (file)
@@ -22,6 +22,7 @@ FUEL_TRACK_REMOTES =
 
 # git submodule & patch locations for Fuel components
 F_GIT_ROOT   := $(shell git rev-parse --show-toplevel)
+F_GIT_DIR    := $(shell git rev-parse --git-dir)
 F_SUBMOD_DIR := ${F_GIT_ROOT}/build/f_repos/sub
 F_PATCH_DIR  := ${F_GIT_ROOT}/build/f_repos/patch
 F_OPNFV_TAG  := ${FUEL_MAIN_TAG}-opnfv
index 66abf2d..2d2d0bf 100644 (file)
@@ -149,7 +149,7 @@ get-cache: .cacheid
        @if $(CACHETOOL) check $(shell cat .cacheid); then \
                $(MAKE) clean && \
                $(CACHETOOL) get $(shell cat .cacheid) | \
-                       tar xf - -C ${F_GIT_ROOT}/.git; \
+                       tar xf - -C ${F_GIT_DIR}; \
        else \
                echo "No cache item found for $(shell cat .cacheid)" ;\
                exit 0;\
@@ -160,6 +160,6 @@ get-cache: .cacheid
 put-cache: .cacheid
        @if ! $(CACHETOOL) check $(shell cat .cacheid); then \
                $(MAKE) clean && \
-               tar cf - -C ${F_GIT_ROOT}/.git modules | \
+               tar cf - -C ${F_GIT_DIR} modules | \
                        $(CACHETOOL) put $(shell cat .cacheid); \
        fi