Skip to content

Commit 6741593

Browse files
liushilongbuaamssonicbld
authored andcommitted
[build] Check if patches are applied before applying patches (sonic-net#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
1 parent f6cda03 commit 6741593

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

slave.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ $(addprefix $(FILES_PATH)/, $(SONIC_MAKE_FILES)) : $(FILES_PATH)/% : .platform $
396396
# Remove target to force rebuild
397397
rm -f $(addprefix $(FILES_PATH)/, $*)
398398
# Apply series of patches if exist
399-
if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi
399+
if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt applied || QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi
400400
# Build project and take package
401401
make DEST=$(shell pwd)/$(FILES_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(FILES_PATH)/$* $(LOG)
402402
# Clean up

0 commit comments

Comments
 (0)