X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=mcp%2Fpatches%2FMakefile;h=be3eb9ee59589ab7c2295c76e070fc31965cd2e2;hb=9d47d1dfc5d3ee4a618b5a4e247774c903dbec50;hp=fafa83f86b55fe5cf086b3fcf82f686a02855f61;hpb=f3f8c094a817fa0f4a60ed25185b6ca226c630d1;p=fuel.git diff --git a/mcp/patches/Makefile b/mcp/patches/Makefile index fafa83f86..be3eb9ee5 100644 --- a/mcp/patches/Makefile +++ b/mcp/patches/Makefile @@ -32,7 +32,7 @@ FPATCHES = $(shell find ${F_PATCH_DIR} -name '*.patch') # To enable remote tracking, set the following var to any non-empty string. # Leaving this var empty will bind each git submodule to its saved commit. -FUEL_TRACK_REMOTES ?= yes +FUEL_TRACK_REMOTES ?= .PHONY: all all: release @@ -50,7 +50,7 @@ sub: .cachefuelinfo @if [ -n "${FUEL_TRACK_REMOTES}" ]; then \ cd ${F_GIT_ROOT} && git submodule update --init --remote 2>/dev/null; \ else \ - git submodule update --init 2>/dev/null; \ + cd ${F_GIT_ROOT} && git submodule update --init 2>/dev/null; \ fi @touch $@ @@ -59,6 +59,7 @@ sub: .cachefuelinfo patches-export: sub @git submodule -q foreach ' \ SUB_DIR=${F_PATCH_DIR}/$$name; \ + rm -rf $$SUB_DIR/*; \ git tag | awk "!/root/ && /${F_OPNFV_TAG}-fuel/" | while read F_TAG; do \ SUB_FEATURE=`dirname $${F_TAG#${F_OPNFV_TAG}-fuel/}`; \ echo "`tput setaf 2`-- exporting $$name ($$F_TAG)`tput sgr0`"; \ @@ -87,7 +88,7 @@ patches-import: sub .cachepatched SUB_TAG=${F_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 \ + git am -3 --ignore-whitespace --patch-format=mbox \ --committer-date-is-author-date $$SUB_PATCHES && \ git tag $$SUB_TAG || exit 1; \ fi \ @@ -95,6 +96,15 @@ patches-import: sub .cachepatched git tag ${F_OPNFV_TAG}' @touch $@ +# Add copyright header to patch files if not already present +.PHONY: patches-copyright +patches-copyright: + @grep -e "Copyright (c)" -L ${FPATCHES} | while read p_file; do \ + ptmp=`mktemp` && \ + cat fuel-patch-copyright.template $$p_file > $$ptmp && \ + mv $$ptmp $$p_file; \ + done + # Clean any changes made to submodules, checkout upstream Fuel root commit .PHONY: clean clean: @@ -109,7 +119,7 @@ clean: .PHONY: deepclean deepclean: clean - @git submodule deinit -f ${F_GIT_ROOT} + @cd ${F_GIT_ROOT} && git submodule deinit -f ${F_GIT_ROOT} @rm -f .cache* .PHONY: release