From a8fffe130e6ad047c2b04afe4fd1d3df532f0d1d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= <essen@ninenines.eu>
Date: Sat, 19 Nov 2016 10:53:31 +0100
Subject: Don't autopatch if rebar is mentioned in comments

---
 core/deps.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/deps.mk b/core/deps.mk
index 9acdee3..1964a52 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -111,9 +111,9 @@ define dep_autopatch
 	elif [ -f $(DEPS_DIR)/$(1)/Makefile ]; then \
 		if [ 0 != `grep -c "include ../\w*\.mk" $(DEPS_DIR)/$(1)/Makefile` ]; then \
 			$(call dep_autopatch2,$(1)); \
-		elif [ 0 != `grep -ci rebar $(DEPS_DIR)/$(1)/Makefile` ]; then \
+		elif [ 0 != `grep -ci "^[^#].*rebar" $(DEPS_DIR)/$(1)/Makefile` ]; then \
 			$(call dep_autopatch2,$(1)); \
-		elif [ -n "`find $(DEPS_DIR)/$(1)/ -type f -name \*.mk -not -name erlang.mk -exec grep -i rebar '{}' \;`" ]; then \
+		elif [ -n "`find $(DEPS_DIR)/$(1)/ -type f -name \*.mk -not -name erlang.mk -exec grep -i "^[^#].*rebar" '{}' \;`" ]; then \
 			$(call dep_autopatch2,$(1)); \
 		else \
 			$(call erlang,$(call dep_autopatch_app.erl,$(1))); \
-- 
cgit v1.2.3