1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

makefiles/docker.inc.mk: always use quotes around -e and -v options

Harmonize the '--volumes' and '--env' commands before factorizing them.
Remove extra 'space'.
This commit is contained in:
Gaëtan Harter 2019-09-16 10:37:33 +02:00
parent ece313020f
commit d832d78756
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -185,7 +185,7 @@ endef
#
# docker_volumes_mapping <path_in_docker_args|...>
# Command line argument for mapping volumes, if it should be mounted
# -v directory:docker_directory
# -v 'directory:docker_directory'
#
# docker_environ_mapping <path_in_docker_args|...>
# Command line argument for mapping environment variables
@ -204,7 +204,7 @@ define _docker_volume_and_env
$(call docker_environ_mapping,$1,$2,$3)
endef
docker_volumes_mapping = $(foreach d,$1,$(call _docker_volume_mapping,$d,$2,$3))
_docker_volume_mapping = $(if $1,$(if $(call dir_is_outside_riotbase,$1), -v '$(abspath $1):$(call path_in_docker,$1,$2,$3)'))
_docker_volume_mapping = $(if $1,$(if $(call dir_is_outside_riotbase,$1),-v '$(abspath $1):$(call path_in_docker,$1,$2,$3)'))
docker_environ_mapping = $(addprefix -e ,$(call docker_cmdline_mapping,$1,$2,$3))
docker_cmdline_mapping = $(if $($1),'$1=$(call path_in_docker,$($1),$2,$3)')
@ -228,8 +228,8 @@ DOCKER_VOLUMES_AND_ENV += $(call docker_volume_and_env,RIOTBOARD,,riotboard)
DOCKER_VOLUMES_AND_ENV += $(call docker_volume_and_env,RIOTMAKE,,riotmake)
# Add GIT_CACHE_DIR if the directory exists
DOCKER_VOLUMES_AND_ENV += $(if $(wildcard $(GIT_CACHE_DIR)),-v $(GIT_CACHE_DIR):$(DOCKER_BUILD_ROOT)/gitcache)
DOCKER_VOLUMES_AND_ENV += $(if $(wildcard $(GIT_CACHE_DIR)),-e GIT_CACHE_DIR=$(DOCKER_BUILD_ROOT)/gitcache)
DOCKER_VOLUMES_AND_ENV += $(if $(wildcard $(GIT_CACHE_DIR)),-v '$(GIT_CACHE_DIR):$(DOCKER_BUILD_ROOT)/gitcache')
DOCKER_VOLUMES_AND_ENV += $(if $(wildcard $(GIT_CACHE_DIR)),-e 'GIT_CACHE_DIR=$(DOCKER_BUILD_ROOT)/gitcache')
# Remap external module directories.
#
@ -261,7 +261,7 @@ endif
# Handle worktree by mounting the git common dir in the same location
_is_git_worktree = $(shell grep '^gitdir: ' $(RIOTBASE)/.git 2>/dev/null)
GIT_WORKTREE_COMMONDIR = $(abspath $(shell git rev-parse --git-common-dir))
DOCKER_VOLUMES_AND_ENV += $(if $(_is_git_worktree),-v $(GIT_WORKTREE_COMMONDIR):$(GIT_WORKTREE_COMMONDIR))
DOCKER_VOLUMES_AND_ENV += $(if $(_is_git_worktree),-v '$(GIT_WORKTREE_COMMONDIR):$(GIT_WORKTREE_COMMONDIR)')
# This will execute `make $(DOCKER_MAKECMDGOALS)` inside a Docker container.
# We do not push the regular $(MAKECMDGOALS) to the container's make command in