Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a PKGBUILD file b2sums, cksums, architectures and tar are not highlighted #148

Open
Alleop5 opened this issue Mar 1, 2025 · 2 comments

Comments

@Alleop5
Copy link

Alleop5 commented Mar 1, 2025

Source: https://man.archlinux.org/man/core/pacman/PKGBUILD.5.en

In the list below there should be b2sums and cksums.

-- Constants.
lex:add_rule('constant', token(lexer.CONSTANT, word_match{
-- We do *not* list pkgver srcdir and startdir here.
-- These are defined by makepkg but user should not alter them.
'arch', 'backup', 'changelog', 'checkdepends', 'conflicts', 'depends', 'epoch', 'groups',
'install', 'license', 'makedepends', 'md5sums', 'noextract', 'optdepends', 'options', 'pkgbase',
'pkgdesc', 'pkgname', 'pkgrel', 'pkgver', 'provides', 'replaces', 'sha1sums', 'sha256sums',
'sha384sums', 'sha512sums', 'source', 'url', 'validpgpkeys'
}))

But you can also put an architecture after if you add an underscore. I'm pretty sure any architecture is valid for expandability so source_insertfuturearchitecturehere is also valid.
Here's the list of them: source, cksums, md5sums, sha1sums, sha224sums, sha256sums, sha384sums, sha512sums, b2sums, depends, makedepends, checkdepends, optdepends, conflicts, provides, replaces.

Also tar and bsdtar are not highlighted, not sure if that's intentional. The operators for tar would need to be added too.
It's used in popular packages like google-chrome: https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=google-chrome.

-- Keywords.
lex:add_rule('keyword', token(lexer.KEYWORD, word_match{
'patch', 'cd', 'make', 'patch', 'mkdir', 'cp', 'sed', 'install', 'rm', 'if', 'then', 'elif',
'else', 'fi', 'case', 'in', 'esac', 'while', 'for', 'do', 'done', 'continue', 'local', 'return',
'git', 'svn', 'co', 'clone', 'gconf-merge-schema', 'msg', 'echo', 'ln',
-- Operators.
'-a', '-b', '-c', '-d', '-e', '-f', '-g', '-h', '-k', '-p', '-r', '-s', '-t', '-u', '-w', '-x',
'-O', '-G', '-L', '-S', '-N', '-nt', '-ot', '-ef', '-o', '-z', '-n', '-eq', '-ne', '-lt', '-le',
'-gt', '-ge', '-Np', '-i'
}))

Original issue: martanne/vis#1235

@orbitalquark
Copy link
Owner

Thanks for the report. Are you saying that for "source, cksums, md5sums, sha1sums, sha224sums, sha256sums, sha384sums, sha512sums, b2sums, depends, makedepends, checkdepends, optdepends, conflicts, provides, replaces", you can have an optional _[arch] appended to each, where [arch] can be any set of word characters?

@Alleop5
Copy link
Author

Alleop5 commented Mar 1, 2025

Yes. To quote: "Additional architecture-specific sources can be added by appending an underscore and the architecture name e.g., source_x86_64=()."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants