Skip to content

Commit 36e02f7

Browse files
authored
Fix: support submodule patching if provided (#407)
1 parent 1e07284 commit 36e02f7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

slave.mk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,12 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(a
132132
$(HEADER)
133133
# remove target to force rebuild
134134
rm -f $(addprefix $(DEBS_PATH)/, $* $($*_DERIVED_DEBS) $($*_EXTRA_DEBS))
135+
# apply series of patches if exist
136+
if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi
135137
# build project and take package
136138
make DEST=$(shell pwd)/$(DEBS_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(DEBS_PATH)/$* $(LOG)
139+
# clean up
140+
if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi
137141
$(FOOTER)
138142

139143
# Build project with dpkg-buildpackage
@@ -229,9 +233,11 @@ $(SONIC_INSTALL_TARGETS) : $(DEBS_PATH)/%-install : .platform $$(addsuffix -inst
229233
$(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PATH)/% : .platform $$(addsuffix -install,$$(addprefix $(PYTHON_WHEELS_PATH)/,$$($$*_DEPENDS)))
230234
$(HEADER)
231235
pushd $($*_SRC_PATH) $(LOG)
232-
if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch/series quilt push -a; fi
236+
# apply series of patches if exist
237+
if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; fi
233238
python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG)
234-
if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then quilt pop -a; fi
239+
# clean up
240+
if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then quilt pop -a -f; fi
235241
popd $(LOG)
236242
mv $($*_SRC_PATH)/dist/$* $(PYTHON_WHEELS_PATH) $(LOG)
237243
$(FOOTER)

0 commit comments

Comments
 (0)