termux / termux-language-server

🛠️ A language server for some specific bash scripts
https://termux-language-server.readthedocs.io/
GNU General Public License v3.0
81 stars 7 forks source link

False positive warnings on split packages? #20

Open lahwaacz opened 3 months ago

lahwaacz commented 3 months ago

I'm getting the following on the doxygen PKGBUILD:

E   1 # Maintainer: Jakub Klinkovský <lahwaacz at archlinux dot org>     ■ Split PKGBUILD needs additional makedepends ['libfmt.so', 'libspdlog.so', 'libsqlite3.so'] to work properly
    2 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
    3 # Contributor: Dan McGee <dan@archlinux.org>
    4
    5 pkgbase=doxygen
    6 pkgname=(doxygen doxygen-docs)
W   7 pkgver=1.11.0     ■ pkgver: is unsorted due to pkgbase@file:///home/lahwaacz/doxygen/PKGBUILD:5:1-5:7
W   8 pkgrel=4     ■ pkgrel: is unsorted due to pkgbase@file:///home/lahwaacz/doxygen/PKGBUILD:5:1-5:7
W   9 pkgdesc='Documentation system for C++, C, Java, IDL and PHP'     ■ pkgdesc: is unsorted due to pkgbase@file:///home/lahwaacz/doxygen/PKGBUILD:5:1-5:7
W  10 url='http://www.doxygen.nl'     ■ url: is unsorted due to pkgbase@file:///home/lahwaacz/doxygen/PKGBUILD:5:1-5:7
   11 arch=(x86_64)
...
  103 package_doxygen-docs() {
W 104   pkgdesc='Developer documentation for doxygen'     ■ pkgdesc: is unsorted due to pkgbase@file:///home/lahwaacz/doxygen/PKGBUILD:5:1-5:7
  105
  106   mv -v $pkgname/* "$pkgdir"
  107   install -vDm 644 $pkgbase-Release_${pkgver//./_}/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  108 }
  109
  110 # vim: ts=2 sw=2 et:

Why does it warn about unsorted pkgver, pkgrel, pkgdesc and url? Also note that a pkgdesc defined in the package_doxygen-docs function is fine too.

Freed-Wu commented 3 months ago

warn about unsorted

Refer https://github.com/termux/termux-language-server/issues/19#issuecomment-2200467775

pkgdesc defined in the package_doxygen-docs function is fine too.

Should be an unexpected behaviour.

lahwaacz commented 3 months ago

Refer #19 (comment)

But here the order pkgname, pkgver, pkgrel is correct, only they are placed after pkgbase.

Freed-Wu commented 3 months ago

I see, the order comes from man 5 PKGBUILD, in the man, pkgbase is placed after them. :cry:

lahwaacz commented 3 months ago

That is because split packages are not that common, so pkgbase is explained near the end of the manual page. But it does not suggest that pkgbase should be at the bottom - typically it is either right before or right after pkgname. See PKGBUILD-split.proto or some PKGBUILDs of official Arch packages.

Freed-Wu commented 3 months ago

So the order should be adapted to the official recommended order. Except man, is there any good official information about it?

lahwaacz commented 3 months ago

I guess only the PKGBUILD-split.proto file or making a sample from the official Arch packages...