summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Candau <antiz@archlinux.org>2024-02-16 11:07:23 +0100
committerRobin Candau <antiz@archlinux.org>2024-02-16 11:07:23 +0100
commit1c9bae96df324026b9721eadb0e367a5ffe58506 (patch)
tree53e7ea67ee6a3eda0f9e534edbe15314a46967f6
parent2f555332fc8b177e588c6fa6128517689b4be239 (diff)
Adapt PKGBUILD.vim to the recent switch to SPDX identifiers for the license array
https://lists.archlinux.org/hyperkitty/list/arch-dev-public@lists.archlinux.org/thread/NFSB7734U2VVDULPRY65ECXDE3XGNZXM/
-rw-r--r--src/vim/syntax/PKGBUILD.vim13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/vim/syntax/PKGBUILD.vim b/src/vim/syntax/PKGBUILD.vim
index e5c6c49..5b5a8cd 100644
--- a/src/vim/syntax/PKGBUILD.vim
+++ b/src/vim/syntax/PKGBUILD.vim
@@ -63,16 +63,17 @@ syn match pbUrlGroup /^url=.*/ contains=pbValidUrl,pb_k_url,pbIllegalUrl,shDoubl
" license
syn keyword pb_k_license license contained
-" echo $(pacman -Ql licenses | grep '/usr/share/licenses/common/' | cut -d'/' -f6 | sort -u)
-syn keyword pbLicense AGPL AGPL3 Apache APACHE Boost CCPL CDDL CPL EPL FDL GPL GPL2 GPL3 LGPL LGPL3 LPPL MPL MPL2 PerlArtistic PHP PSF RUBY Unlicense W3C ZPL contained
" keywords can't contain decimals
-syn match pbLicense /Artistic2\.0\|FDL1\.2\|FDL1\.3\|LGPL2\.1/ contained
+" echo /$(find /usr/share/licenses/spdx/ -type f -printf '%f\n')/ | sed 's/.txt//g; s/\ /\\|/g; s/\.\([0-9]\)/\\.\1/g'
+syn match pbLicense /LPPL-1\.3a\|CC-BY-1\.0\|GPL-3\.0-only\|ZPL-2\.0\|LGPL-2\.0-or-later\|CC-BY-NC-SA-1\.0\|CC-BY-SA-4\.0\|BSL-1\.0\|CC-BY-NC-3\.0\|LGPL-3\.0-or-later\|CC-BY-ND-1\.0\|CC-BY-NC-ND-3\.0\|CC-BY-NC-1\.0\|LGPLLR\|CC-BY-SA-2\.1-JP\|CC-BY-ND-2\.0\|GPL-2\.0-or-later\|GFDL-1\.3-no-invariants-only\|CC-BY-3\.0\|CC-BY-NC-SA-4\.0\|GPL-1\.0-only\|GFDL-1\.3-only\|Artistic-2\.0\|GFDL-1\.2-invariants-only\|CC-BY-NC-SA-2\.0\|LGPL-2\.1-only\|CPL-1\.0\|CC-BY-SA-3\.0-AT\|PHP-3\.01\|CDDL-1\.0\|GPL-3\.0-or-later\|PHP-3\.0\|LGPL-2\.1-or-later\|CC-BY-NC-ND-2\.5\|GFDL-1\.3-no-invariants-or-later\|LLGPL\|MPL-2\.0-no-copyleft-exception\|Linux-syscall-note\|GPL-3\.0-linking-source-exception\|GPL-3\.0-linking-exception\|LGPL-3\.0-linking-exception\|CC-BY-4\.0\|GFDL-1\.3-invariants-or-later\|Unlicense\|CC-BY-NC-SA-2\.5\|CC-BY-SA-2\.0-UK\|GFDL-1\.3-invariants-only\|LPPL-1\.3c\|GFDL-1\.1-no-invariants-or-later\|CC-BY-NC-ND-4\.0\|Ruby\|CC-BY-NC-4\.0\|CC-BY-SA-2\.5\|EPL-1\.0\|LPPL-1\.1\|CC-BY-SA-3\.0\|LGPL-2\.0-only\|ZPL-2\.1\|GPL-2\.0-only\|LPPL-1\.0\|MPL-2\.0\|GFDL-1\.2-no-invariants-or-later\|LGPL-3\.0-only\|CC-BY-NC-ND-1\.0\|GFDL-1\.2-or-later\|GFDL-1\.3-or-later\|CC0-1\.0\|MPL-1\.1\|GFDL-1\.1-only\|AGPL-3\.0-only\|PSF-2\.0\|CC-PDDC\|CC-BY-NC-SA-3\.0\|Artistic-1\.0-Perl\|CC-BY-2\.5\|GFDL-1\.1-invariants-or-later\|GFDL-1\.2-invariants-or-later\|CC-BY-ND-2\.5\|CC-BY-NC-ND-3\.0-IGO\|GFDL-1\.1-no-invariants-only\|GFDL-1\.2-no-invariants-only\|EPL-2\.0\|ZPL-1\.1\|CC-BY-SA-2\.0\|AGPL-3\.0-or-later\|CDDL-1\.1\|MPL-1\.0\|CC-BY-ND-3\.0\|CC-BY-ND-4\.0\|CC-BY-3\.0-AT\|GFDL-1\.1-or-later\|W3C\|GPL-CC-1\.0\|Apache-2\.0\|GPL-1\.0-or-later\|FSFAP\|CC-BY-3\.0-US\|CC-BY-NC-2\.5\|CC-BY-NC-2\.0\|LPPL-1\.2\|CC-BY-2\.0\|CC-BY-NC-ND-2\.0\|CC-BY-SA-1\.0\|GFDL-1\.1-invariants-only\|GFDL-1\.2-only/ contained
+" multiple licenses combination expressions
+syn keyword pbLicenseCombination AND OR WITH contained
" special cases from https://wiki.archlinux.org/index.php/PKGBUILD#license
-syn keyword pbLicenseSpecial BSD ISC MIT OFL Python ZLIB contained
-syn match pbLicenseCustom /custom\(:[[:alnum:].]*\)*/ contained
+syn keyword pbLicenseSpecial BSD-1-Clause BSD-2-Clause BSD-3-Clause ISC MIT OFL Python ZLIB contained
+syn match pbLicenseCustom /custom\(:[[:alnum:].]*\)*\|LicenseRef\(-[[:alnum:].]*\)*/ contained
syn keyword pbLicenseUnknown unknown contained
syn match pbIllegalLicense /[^='"() ]/ contained contains=pbLicenseUnknown,pbLicenseCustom,pbLicenseSpecial,pbLicense
-syn region pbLicenseGroup start=/^license=(/ end=/)/ contains=pb_k_license,pbLicenseCustom,pbLicenseSpecial,pbLicense,pbIllegalLicense
+syn region pbLicenseGroup start=/^license=(/ end=/)/ contains=pb_k_license,pbLicenseCustom,pbLicenseSpecial,pbLicense,pbIllegalLicense,pbLicenseCombination
" backup
syn keyword pb_k_backup backup contained