Skip to content

Stricter parsing rules #5

@Morganamilo

Description

@Morganamilo

Hey, I recently made my own srcinfo parser https://github.com/Morganamilo for my own use and to do some data crushing as you can see here Morganamilo/go-srcinfo#1.

I am attempting to crack down on invalid AUR packages, I have sent patches to makepkg to ensure more thorough linting.

There also needs to be better checking on the aurweb side. I have seen countless examples of people manually editing srcinfos or accidentally duplicating them using >> instead of >. As this project is used for the aurweb git hook I believe it would be a good idea to tighten up the parsing rules here.

I have listed some rules that I use:

Parsing will fail if:

  • A srcinfo does not contain all required fields
  • The same pkgname is specified more then once
  • arch is missing
  • pkgver is mising
  • pkgrel is missing
  • An architecture specific field is defined for an architecture that does not exist
  • An unknown key is specified
  • An empty value is specified - due to a bug in makepkg's printsrcinfo this must be allowed
  • Required fields are:
    • pkgbase
    • pkname
    • arch
    • pkgrel
    • pkgver

Although I do understand if these make things too strict and could break with pacman updates. At the very least I would like it ensured that the pkgbase field is not defined twice in the same file.

I'm no python expert but I'm happy to try my hand at some patching if you agree with the above points.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions