[next,v2,02/11] batman-adv: Use simple script to patch minor compat problems

Message ID 20161009065738.8279-2-sven@narfation.org (mailing list archive)
State Accepted, archived
Commit 17018a99bc68f49ea1da199c9c1b290e3b2c42ed
Delegated to: Marek Lindner
Headers

Commit Message

Sven Eckelmann Oct. 9, 2016, 6:57 a.m. UTC
  Unified diff base patches have the problem that they fix only a single line
and depend on the surrounding. This approach can fail relative often when
the surrounding code will be changed often. Thus semantic patches (like
spatch from coccinelle) or simple find+replace scripts are better for this
approach.

Introduce a simple script file which will store these kind of find+replace
instructions.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
v2:
 - no change
---
 Makefile                       | 3 ++-
 compat-patches/replacements.sh | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)
 create mode 100755 compat-patches/replacements.sh
  

Comments

Sven Eckelmann Oct. 18, 2016, 11:35 a.m. UTC | #1
On Sonntag, 9. Oktober 2016 08:57:29 CEST Sven Eckelmann wrote:
> Unified diff base patches have the problem that they fix only a single line
> and depend on the surrounding. This approach can fail relative often when
> the surrounding code will be changed often. Thus semantic patches (like
> spatch from coccinelle) or simple find+replace scripts are better for this
> approach.
> 
> Introduce a simple script file which will store these kind of find+replace
> instructions.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> v2:
>  - no change
> ---
>  Makefile                       | 3 ++-
>  compat-patches/replacements.sh | 3 +++
>  2 files changed, 5 insertions(+), 1 deletion(-)
>  create mode 100755 compat-patches/replacements.sh

Applied in 17018a99bc68f49ea1da199c9c1b290e3b2c42ed [1].

Kind regards,
	Sven

[1] https://git.open-mesh.org/batman-adv.git/commit/17018a99bc68f49ea1da199c9c1b290e3b2c42ed
  

Patch

diff --git a/Makefile b/Makefile
index b105290..7ef2569 100644
--- a/Makefile
+++ b/Makefile
@@ -99,7 +99,7 @@  install: config $(SOURCE_STAMP)
 config:
 	$(PWD)/gen-compat-autoconf.sh $(PWD)/compat-autoconf.h
 
-$(SOURCE_STAMP): $(SOURCE) compat-patches/*
+$(SOURCE_STAMP): $(SOURCE) compat-patches/* compat-patches/replacements.sh
 	$(MKDIR) $(BUILD_DIR)/net/batman-adv/
 	@$(RM) $(SOURCE_BUILD)
 	@$(CP) $(SOURCE) $(BUILD_DIR)/net/batman-adv/
@@ -111,6 +111,7 @@  $(SOURCE_STAMP): $(SOURCE) compat-patches/*
 		$(PATCH) ../compat-patches/$${i}; \
 		cd - > /dev/null; \
 	done
+	compat-patches/replacements.sh
 	touch $(SOURCE_STAMP)
 
 .PHONY: all clean install config
diff --git a/compat-patches/replacements.sh b/compat-patches/replacements.sh
new file mode 100755
index 0000000..c7875c0
--- /dev/null
+++ b/compat-patches/replacements.sh
@@ -0,0 +1,3 @@ 
+#! /bin/sh
+
+set -e