From d6f809e85faaf7182e6f3697400438792e9d4758 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 15 Jul 2019 01:01:46 -0400 Subject: scripts/gen-mplus-patch.pl: Further improve REs --- (limited to 'scripts') diff --git a/scripts/gen-mplus-patch.pl b/scripts/gen-mplus-patch.pl index 290cb1d..91b3613 100755 --- a/scripts/gen-mplus-patch.pl +++ b/scripts/gen-mplus-patch.pl @@ -38,7 +38,7 @@ sub header next; } $version = $entry->string(); - $version =~ s{\AVersion\s1[.]}{}msxa; + $version =~ s{\AVersion[ \t]1[.]}{}msxa; } ($header = <<" EOF") =~ s{^\t\t}{}msxag; @@ -134,7 +134,7 @@ sub patch_kconfig $inject .= sprintf("\tdepends on !FONT_MPLUS_%s_%s_%dx%d\n", uc($face), uc($weight), $width, $height); } - $new =~ s{ ^ ( \s* select \s+ FONT_[A-Za-z0-9_]+ \s* ) $ } + $new =~ s{ ^ ( [ \t]* select [ \t]+ FONT_[A-Za-z0-9_]+ [ \t]* ) $ } {$inject$1}msxa; return make_patch('lib/fonts/Kconfig', $old, $new); @@ -174,8 +174,8 @@ sub patch_makefile } $new =~ s{ \A ( .* ^ font-objs-\$[(]CONFIG_FONT_[A-Za-z0-9_]+[)] - \s* [+]= \s* - font_[a-z0-9_]+[.]o \s* + [ \t]* [+]= [ \t]* + font_[a-z0-9_]+[.]o [ \t]* $ ) }{$1$inject}msxa; return make_patch('lib/fonts/Makefile', $old, $new); -- cgit v0.9.1