runtime(debcontrol): move kernel/architecture definitions to shared/debarchitectures.vim
Commit: https://github.com/vim/vim/commit/48c823ca01c93141a934e230cd425bc74ebfaf45 Author: James McCoy <james...@jamessan.com> Date: Sun Jul 6 17:59:40 2025 +0200 runtime(debcontrol): move kernel/architecture definitions to shared/debarchitectures.vim related: https://github.com/vim/vim/issues/17679 Signed-off-by: James McCoy <james...@debian.org> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index b86d51bf6..e98a6d3f3 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -3,8 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs <al...@ist.org> " Wichert Akkerman <wakke...@debian.org> -" Last Change: 2024 Mar 26 -" 2025 Jun 13 by Vim Project (add hurd-amd64 arch #17525) +" Last Change: 2025 Jul 05 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debcontrol.vim " Standard syntax initialization @@ -27,26 +26,13 @@ syn match debcontrolElse "^.*$" syn match debControlComma ",[ ]*" syn match debControlSpace "[ ]" -let s:kernels = ['linux', 'hurd', 'kfreebsd', 'knetbsd', 'kopensolaris', 'netbsd'] -let s:archs = [ - \ 'alpha', 'amd64', 'armeb', 'armel', 'armhf', 'arm64', 'avr32', 'hppa' - \, 'i386', 'ia64', 'loong64', 'lpia', 'm32r', 'm68k', 'mipsel', 'mips64el', 'mips' - \, 'powerpcspe', 'powerpc', 'ppc64el', 'ppc64', 'riscv64', 's390x', 's390', 'sh3eb' - \, 'sh3', 'sh4eb', 'sh4', 'sh', 'sparc64', 'sparc', 'x32' - \ ] -let s:pairs = [ - \ 'hurd-i386', 'hurd-amd64', 'kfreebsd-i386', 'kfreebsd-amd64', 'knetbsd-i386' - \, 'kopensolaris-i386', 'netbsd-alpha', 'netbsd-i386' - \ ] +runtime! syntax/shared/debarchitectures.vim " Define some common expressions we can use later on syn keyword debcontrolArchitecture contained all any -exe 'syn keyword debcontrolArchitecture contained '. join(map(copy(s:kernels), {k,v -> v .'-any'})) -exe 'syn keyword debcontrolArchitecture contained '. join(map(copy(s:archs), {k,v -> 'any-'.v})) -exe 'syn keyword debcontrolArchitecture contained '. join(s:archs) -exe 'syn keyword debcontrolArchitecture contained '. join(s:pairs) - -unlet s:kernels s:archs s:pairs +exe 'syn keyword debcontrolArchitecture contained '. join(g:debArchitectureKernelAnyArch) +exe 'syn keyword debcontrolArchitecture contained '. join(g:debArchitectureAnyKernelArch) +exe 'syn keyword debcontrolArchitecture contained '. join(g:debArchitectureArchs) " Keep in sync with https://metadata.ftp-master.org/sections.822 " curl -q https://metadata.ftp-master.debian.org/sections.822 2>/dev/null| grep-dctrl -n --not -FSection -sSection / - diff --git a/runtime/syntax/shared/debarchitectures.vim b/runtime/syntax/shared/debarchitectures.vim new file mode 100644 index 000000000..8005fe86f --- /dev/null +++ b/runtime/syntax/shared/debarchitectures.vim @@ -0,0 +1,27 @@ +" Language: Debian architecture information +" Maintainer: Debian Vim Maintainers +" Last Change: 2025 Jul 05 +" URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/shared/debarchitectures.vim + +let s:cpo = &cpo +set cpo-=C + +let s:kernels = ['linux', 'hurd', 'kfreebsd', 'knetbsd', 'kopensolaris', 'netbsd'] +let s:archs = [ + \ 'alpha', 'amd64', 'armeb', 'armel', 'armhf', 'arm64', 'avr32', 'hppa' + \, 'i386', 'ia64', 'loong64', 'lpia', 'm32r', 'm68k', 'mipsel', 'mips64el', 'mips' + \, 'powerpcspe', 'powerpc', 'ppc64el', 'ppc64', 'riscv64', 's390x', 's390', 'sh3eb' + \, 'sh3', 'sh4eb', 'sh4', 'sh', 'sparc64', 'sparc', 'x32' + \ ] +let s:pairs = [ + \ 'hurd-i386', 'hurd-amd64', 'kfreebsd-i386', 'kfreebsd-amd64', 'knetbsd-i386' + \, 'kopensolaris-i386', 'netbsd-alpha', 'netbsd-i386' + \ ] + +let g:debArchitectureKernelAnyArch = map(copy(s:kernels), {k,v -> v.'-any'}) +let g:debArchitectureAnyKernelArch = map(copy(s:archs), {k,v -> 'any-'.v}) +let g:debArchitectureArchs = s:archs + s:pairs + +unlet s:kernels s:archs s:pairs + +let &cpo=s:cpo -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1uYS19-006z7R-16%40256bit.org.