From 079851824455d5d3aadc6557f359644c2940d8b8 Mon Sep 17 00:00:00 2001 From: Liu Shilong Date: Wed, 18 Jan 2023 13:35:11 +0800 Subject: [PATCH] [build] Check if patches are applied before applying patches (#13386) Why I did it If make fails, we can't rerun the make process, because existing patches can't apply again. How I did it Check if patches are applied. if yes, don't apply patches again. How to verify it --- slave.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slave.mk b/slave.mk index e66fce5728..35711d7c36 100644 --- a/slave.mk +++ b/slave.mk @@ -450,7 +450,7 @@ $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) : $(FILES_PATH)/% : .platform $ # Remove target to force rebuild rm -f $(addprefix $(FILES_PATH)/, $*) # Apply series of patches if exist - if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi + if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt applied || QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi # Build project and take package make DEST=$(shell pwd)/$(FILES_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(FILES_PATH)/$* $(LOG) # Clean up