From 2f7a425c53ace8f7f2fabb7ca95bc09c77670d6d Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Fri, 6 Nov 2015 09:16:10 +0100 Subject: gentree: fix Makefile symbol disabling Upstream commit: 4645e84f83e0fff9fe771c3a3656fcbb9ba729fa Currently, a Makefile line like this: obj-$(CONFIG_IPW2100) += ipw2x00/ will get mangled into #obj-$(CONFIG_IPW2100+= ipw2x00/ when disabled by the gentree script. Fix the regular expression to contain the entire match as the first group, so it gets all preserved when replaced later by "#\1" using expression.sub(). This then makes it come out as #obj-$(CONFIG_IPW2100) += ipw2x00/ Signed-off-by: Johannes Berg Signed-off-by: Hauke Mehrtens --- gentree.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gentree.py b/gentree.py index 636ea609..772095fc 100755 --- a/gentree.py +++ b/gentree.py @@ -1057,7 +1057,7 @@ def process(kerneldir, copy_list_file, git_revision=None, # groups -- 50 seemed safer and is still fast) regexes = [] for some_symbols in [disable_makefile[i:i + 50] for i in range(0, len(disable_makefile), 50)]: - r = '^([^#].*((' + bpid.full_prefix_resafe + '|CONFIG_)(' + '|'.join([s for s in some_symbols]) + ')))\W' + r = '^(([^#].*((' + bpid.full_prefix_resafe + '|CONFIG_)(' + '|'.join([s for s in some_symbols]) + ')))\W)' regexes.append(re.compile(r, re.MULTILINE)) for f in maketree.get_makefiles(): data = open(f, 'r').read() -- cgit v1.2.3