]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0088: pattern for detecting bitbake files is not sufficient v9.0.0088
authorGregory Anders <greg@gpanders.com>
Tue, 26 Jul 2022 20:42:03 +0000 (21:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 26 Jul 2022 20:42:03 +0000 (21:42 +0100)
Problem:    Pattern for detecting bitbake files is not sufficient.
Solution:   Adjust the pattern. (Gregory Anders, closes #10743)

runtime/autoload/dist/ft.vim
src/testdir/test_filetype.vim
src/version.c

index 708a42a050287a25263eb74a3a62bd00b2d1796d..e48575c807fe8f6bf196721b18b7177cccc41072 100644 (file)
@@ -519,7 +519,7 @@ export def FTinc()
     # headers so assume POV-Ray
     elseif lines =~ '^\s*\%({\|(\*\)' || lines =~? ft_pascal_keywords
       setf pascal
-    elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '\w\+ = '
+    elseif lines =~# '\<\%(require\|inherit\)\>' || lines =~# '[A-Z][A-Za-z0-9_:${}]*\s\+\%(??\|[?:+]\)\?= '
       setf bitbake
     else
       FTasmsyntax()
index ea7bf3eca2f6ee38dbca5f3533e30063ec5f3883..0104fdb8f4d2085335a4fc73bacb16394769752b 100644 (file)
@@ -1864,6 +1864,31 @@ func Test_inc_file()
   call assert_equal('bitbake', &filetype)
   bwipe!
 
+  call writefile(['S = "${WORKDIR}"'], 'Xfile.inc')
+  split Xfile.inc
+  call assert_equal('bitbake', &filetype)
+  bwipe!
+
+  call writefile(['DEPENDS:append = " somedep"'], 'Xfile.inc')
+  split Xfile.inc
+  call assert_equal('bitbake', &filetype)
+  bwipe!
+
+  call writefile(['MACHINE ??= "qemu"'], 'Xfile.inc')
+  split Xfile.inc
+  call assert_equal('bitbake', &filetype)
+  bwipe!
+
+  call writefile(['PROVIDES := "test"'], 'Xfile.inc')
+  split Xfile.inc
+  call assert_equal('bitbake', &filetype)
+  bwipe!
+
+  call writefile(['RDEPENDS_${PN} += "bar"'], 'Xfile.inc')
+  split Xfile.inc
+  call assert_equal('bitbake', &filetype)
+  bwipe!
+
   " asm
   call writefile(['asmsyntax=foo'], 'Xfile.inc')
   split Xfile.inc
index 75fe0edf99c3a95b9e4e6ee4abbd4986f32951f8..7c584245a65036e21ed565e073471a777056e66b 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    88,
 /**/
     87,
 /**/