summaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-09-23 21:45:32 +0300
committerAndras Timar <andras.timar@collabora.com>2015-05-19 12:52:57 +0200
commita6f79248a166261129be08d9d99b7724d29089c4 (patch)
tree359d9ca413fd4354f17424d6903cb937936df1c5 /Makefile.in
parent9835149450ad08ac0525761ac18e6aeb63fe4536 (diff)
Add targets 'patch' and 'unpatch' to assist in handling of temporary patches
'make patch' applies any patch file in the uncommitted-patches directory, if it exists. These files should be as produced by git format-patch. 'make unpatch' correspondingly undos what 'make patch' did. None of this is done using git, that is the very point. Change-Id: I348d96be54bc8e544e833206c922cb4bdcbabc4c Conflicts: Makefile.in
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in20
1 files changed, 19 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index e0c2bcff5fca..1585d0b05ee2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -9,7 +9,7 @@
gb_Top_MODULE_CHECK_TARGETS := slowcheck unitcheck subsequentcheck perfcheck
-.PHONY : all bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install docs download etags fetch findunusedcode get-submodules id install install-strip tags debugrun help showmodules translations packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS)
+.PHONY : all bootstrap gbuild build build-non-l10n-only build-l10n-only check clean clean-build clean-host test-install distclean distro-pack-install docs download etags fetch findunusedcode get-submodules id install install-strip tags debugrun help showmodules translations packageinfo internal.clean $(gb_Top_MODULE_CHECK_TARGETS) patch unpatch
MAKECMDGOALS?=all
build_goal:=$(if $(filter build check,$(MAKECMDGOALS)),all)\
@@ -389,4 +389,22 @@ $(eval $(call gb_Top_GbuildToIdeIntegration,$(ide))))
endif # MAKE_RESTARTS
+patch:
+ test -d uncommitted-patches || exit 0
+ for F in uncommitted-patches/*.patch; do \
+ patch --dry-run -p1 <$$F || exit 1; \
+ done
+ mkdir -p uncommitted-patches.applied
+ for F in uncommitted-patches/*.patch; do \
+ patch -p1 <$$F || exit 1; \
+ cp $$F uncommitted-patches.applied; \
+ done
+
+unpatch:
+ test -d uncommitted-patches.applied || exit 0
+ for F in uncommitted-patches.applied/*.patch; do \
+ patch -R -p1 <$$F || exit 1; \
+ rm $$F; \
+ done
+
# vim: set noet sw=4 ts=4: