docker: Clean dangling tarball files

When a container fails, it leaves a dangling tarball which name is
based on a timestamp. Further uses of make won't clean those files,
neither calling the 'docker-clean' target.

Use the .DELETE_ON_ERROR built-in target to let make remove those
temporary tarballs in case of failure.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20180818030337.22271-1-f4bug@amsat.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
This commit is contained in:
Philippe Mathieu-Daudé 2018-08-18 00:03:37 -03:00 committed by Fam Zheng
parent 25b8f085ac
commit b28ef6b9eb
1 changed files with 1 additions and 0 deletions

View File

@ -25,6 +25,7 @@ IMAGES ?= %
CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$) CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME) DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME)
.DELETE_ON_ERROR: $(DOCKER_SRC_COPY)
$(DOCKER_SRC_COPY): $(DOCKER_SRC_COPY):
@mkdir $@ @mkdir $@
$(if $(SRC_ARCHIVE), \ $(if $(SRC_ARCHIVE), \