Blame SOURCES/file-5.39-regex-combinations.patch

8a9804
From a4b3abc4104d8a4eeb84a6242f2f1a830204a539 Mon Sep 17 00:00:00 2001
8a9804
From: Christos Zoulas <christos@zoulas.com>
8a9804
Date: Sat, 12 Mar 2022 15:09:47 +0000
8a9804
Subject: [PATCH] Combine regex's to improve performance adjusting strength to
8a9804
 preserve ranking (Dirk Mueller)
8a9804
8a9804
---
8a9804
 magic/Magdir/make | 29 +++++++----------------------
8a9804
 1 file changed, 7 insertions(+), 22 deletions(-)
8a9804
8a9804
diff --git a/magic/Magdir/make b/magic/Magdir/make
8a9804
index f522b4f18..1abdf7a3e 100644
8a9804
--- a/magic/Magdir/make
8a9804
+++ b/magic/Magdir/make
8a9804
@@ -1,36 +1,21 @@
8a9804
 #------------------------------------------------------------------------------
8a9804
-# $File: make,v 1.4 2018/05/29 17:26:02 christos Exp $
8a9804
+# $File: make,v 1.5 2022/03/12 15:09:47 christos Exp $
8a9804
 # make:  file(1) magic for makefiles
8a9804
 #
8a9804
 # URL: https://en.wikipedia.org/wiki/Make_(software)
8a9804
-0	regex/100l	\^CFLAGS	makefile script text
8a9804
-!:mime	text/x-makefile
8a9804
-0	regex/100l	\^VPATH		makefile script text
8a9804
-!:mime	text/x-makefile
8a9804
-0	regex/100l	\^LDFLAGS	makefile script text
8a9804
-!:mime	text/x-makefile
8a9804
-0	regex/100l	\^all:		makefile script text
8a9804
-!:mime	text/x-makefile
8a9804
-0	regex/100l	\^\\.PRECIOUS	makefile script text
8a9804
+0	regex/100l	\^(CFLAGS|VPATH|LDFLAGS|all:|\\.PRECIOUS)	makefile script text
8a9804
 !:mime	text/x-makefile
8a9804
+!:strength -15
8a9804
 # Update: Joerg Jenderek
8a9804
 # Reference: https://www.freebsd.org/cgi/man.cgi?make(1)
8a9804
 # exclude grub-core\lib\libgcrypt\mpi\Makefile.am with "#BEGIN_ASM_LIST"
8a9804
 # by additional escaping point character
8a9804
-0	regex/100l	\^\\.BEGIN	BSD makefile script text
8a9804
-!:mime	text/x-makefile
8a9804
-!:ext	/mk
8a9804
-!:strength +10
8a9804
 # exclude MS Windows help file CoNtenT with ":include FOOBAR.CNT"
8a9804
 # and NSIS script with "!include" by additional escaping point character
8a9804
-0	regex/100l	\^\\.include	BSD makefile script text
8a9804
-!:mime	text/x-makefile
8a9804
-!:ext	/mk
8a9804
-!:strength +10
8a9804
-0	regex/100l	\^\\.endif	BSD makefile script text
8a9804
+0	regex/100l	\^\\.(BEGIN|endif|include)	BSD makefile script text
8a9804
 !:mime	text/x-makefile
8a9804
 !:ext	/mk
8a9804
-!:strength +10
8a9804
-0	regex/100l	\^SUBDIRS	automake makefile script text
8a9804
+!:strength -10
8a9804
+0	regex/100l	\^SUBDIRS[[:space:]]+=	automake makefile script text
8a9804
 !:mime	text/x-makefile
8a9804
-!:strength +10
8a9804
+!:strength -15