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-12-07 16:01:08 +0100
commit1ddf8a3a2c1edaf17fadd26201c1bc6280ee793d (patch)
treeea6b1d6038f621bc9c1f0952dc603d64200a75f4 /Makefile.in
parentfa12e1070557eb4b6aa38db7602be522956124ea (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 914699eb14ae..0cbd026e5fec 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)\
@@ -374,4 +374,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: