Community Packages

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#61923 - [pacman-contrib] Incorrect error highlighting in syntax/PKGBUILD.vim

Attached to Project: Community Packages
Opened by James Harvey (jamespharvey20) - Wednesday, 06 March 2019, 04:02 GMT
Last edited by Balló György (City-busz) - Monday, 18 March 2019, 08:09 GMT
Task Type Bug Report
Category Packages
Status Assigned
Assigned To Johannes Löthberg (demize)
Daniel M. Capella (polyzen)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No



"vimfiles/syntax/PKGBUILD.vim" highlights two things as errors that it should not. As an example, the valid official PKGBUILD file for gdb:

pkgname=(gdb gdb-common)

It highlights in: "pkgname" the '(', ' ', and ')'; and "sha1sums" the "SKIP".

"pkgname" can of course be an array for split packages.

Any of "md5sums", "sha1sums", "sha224sums", "sha256sums", "sha384sums", and "sha512sums" can of course contain "SKIP".

Even though the error highlighting is technically wrong, maybe it's desired to be left as-is to discourage "pkgname" being a single element array or "SKIP" usage when inappropriate, etc.

On the mailing list, Morten Linderud pointed out that without pacman-contrib's vim PKGBUILD files, vim aliases PKGBUILD's to filetype bash, which doesn't highlight improper errors. Perhaps pacman-contrib's vim PKGBUILD files could be considered for removal. I personally like the idea of having the stricter highlighting that pacman-contrib provides. Seeing top variables as the same color as functions for a PKGBUILD just feels weird after all this time, too.

There might of course be other valid PKGBUILD scenarios pacman-contrib's files don't handle, these are just the 2 I see a lot.

Additional info:

pacman-contrib 1.1.0-1

Steps to reproduce:

$ vim <gdb PKGBUILD>
This task depends upon

Comment by Daniel M. Capella (polyzen) - Tuesday, 19 March 2019, 00:03 GMT
As mentioned in the thread, a rewrite of the syntax file is planned.
Comment by Michael Laß (Bevan) - Friday, 31 July 2020, 09:40 GMT
Currently, vim also highlights dots in package names as error. According to the wiki, those are fine though and in fact some packages in the repositories contain dots in their names. Just something to be considered in a rewrite as well.