+.submodules-patched: ${A_PATCHES}
+ @$(MAKE) submodules-clean
+ @git submodule -q foreach ' \
+ SUB_DIR=${A_PATCH_DIR}/$$name; mkdir -p $$SUB_DIR && \
+ git tag ${A_OPNFV_TAG}-root && \
+ git checkout -q -b opnfv-armband && \
+ find $$SUB_DIR -type d | sort | while read p_dir; do \
+ SUB_PATCHES=$$(ls $$p_dir/*.patch 2>/dev/null); \
+ if [ -n "$$SUB_PATCHES" ]; then \
+ SUB_FEATURE=$${p_dir#$$SUB_DIR} \
+ SUB_TAG=${A_OPNFV_TAG}-fuel$$SUB_FEATURE/patch; \
+ echo "`tput setaf 2`== patching $$name ($$SUB_TAG)`tput sgr0`";\
+ git tag $$SUB_TAG-root && \
+ git am -3 --whitespace=nowarn --patch-format=mbox \
+ --committer-date-is-author-date $$SUB_PATCHES && \
+ git tag $$SUB_TAG || exit 1; \
+ fi \
+ done && \
+ git tag ${A_OPNFV_TAG}'
+ # Staging Fuel@OPNFV patches
+ @ls -d ${F_PATCH_DIR}/* 2>/dev/null | while read p_sub_path; do \
+ SUB_NAME=`basename $$p_sub_path`; \
+ find ${A_PATCH_DIR}/$$SUB_NAME -name '*.patch' 2>/dev/null -exec sh -c '\
+ A_PATCH={}; R_PATCH=$${A_PATCH#${A_PATCH_DIR}/}; \
+ F_PATCH=${F_PATCH_DIR}/$${0}/armband/$${R_PATCH#$${0}/}; \
+ if [ -f $$F_PATCH ]; then \
+ echo "`tput setaf 3`* WARN: $$R_PATCH upstream.`tput sgr0`"; \
+ else \
+ if [ -h $$A_PATCH ]; then \
+ echo "`tput setaf 3`* PHONY: $$R_PATCH`tput sgr0`"; \
+ else \
+ echo "`tput setaf 6`* Staging $$R_PATCH`tput sgr0`"; \
+ mkdir -p `dirname $$F_PATCH` && cp $$A_PATCH $$F_PATCH; \
+ fi; \
+ fi' "$$SUB_NAME" \; || true ; \
+ done
+ @touch $@