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

Regenerate PKGBUILD schema #26

Open
lahwaacz opened this issue Dec 24, 2024 · 2 comments
Open

Regenerate PKGBUILD schema #26

lahwaacz opened this issue Dec 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@lahwaacz
Copy link

I was trying to regenerate the PKGBUILD schema but failed due to a couple of issues:

  • It seems that the keywords are extracted from the PKGBUILD man page through the lsp_tree_sitter.misc module. However, it uses the platformdirs package and its site_data_path("man") function, which gives /usr/local/share/man on Arch Linux. However, the true location is /usr/share/man.
  • The init_schema function tries to read licenses from /usr/share/licenses/common:
    + os.listdir("/usr/share/licenses/common")

    This directory does not exist anymore on Arch Linux so it fails with FileNotFoundError: [Errno 2] No such file or directory: '/usr/share/licenses/common'
@lahwaacz
Copy link
Author

Also note that the schema contains several invalid fields:

"directory": {
"description": "(optional) Specifies an alternate directory name for makepkg to download the VCS source into.",
"type": "string"
},
"fragment": {
"description": "(optional) Allows specifying a revision number or branch for makepkg to checkout from the VCS. A fragment has the form type=value, for example to checkout a given revision the source line would be source=(url#revision=123). The available types depends on the VCS being used:\n**bzr**\nrevision (see bzr help revisionspec for details)",
"type": "string"
},
"query": {
"description": "(optional) Allows specifying whether a VCS checkout should be checked for PGP-signed revisions. The source line should have the format source=(url#fragment?signed) or source=(url?signed#fragment). Currently only supported by Git.",
"type": "string"
},

These come from the USING VCS SOURCES section in the man page which describes the format of specific source items. However, the lsp treats them as global variables at the same level as e.g. pkgname and pkgver.

@Freed-Wu Freed-Wu added the bug Something isn't working label Dec 24, 2024
@lahwaacz
Copy link
Author

Another outdated thing: the PKGBUILD.json schema allows custom:.+ in the license field, but not the SPDX alternative LicenseRef-.+.

{
"type": "string",
"pattern": "custom:.+"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants