mikkeloscar / gopkgbuild

A golang package for parsing Arch Linux PKGBUILDs
GNU General Public License v3.0
22 stars 5 forks source link

Allow '~' in pkgver #4

Closed Morganamilo closed 6 years ago

Morganamilo commented 6 years ago

The validity check on pkgver is way too strict. makepkg itself states: pkgver is not allowed to contain colons, hyphens or whitespace. makepkg itself also seems a little broken allowing pkgvers with white space and also allowing : and - as long as they come after whitespace. makepkg also seems to allow all unicode characters.

Most of the time this strictness does not cause a problem, although some packages on the AUR and the main repos contain a ~ in their version causing an error to be thrown.

Currently all I have done is added ~ as an allowed character. Although I think check checking method should be changed from a white-list to a black-list where we accept all characters apart from :, -, whitespace and unicode.

mikkeloscar commented 6 years ago

The validity check on pkgver is way too strict. makepkg itself states: pkgver is not allowed to contain colons, hyphens or whitespace.

Where is this stated? I'm not doubting you, just curious since this states something different: https://wiki.archlinux.org/index.php/PKGBUILD#pkgver (It can contain letters, numbers, periods and underscores, but not a hyphen (-).)

Can you link to a package that uses a ~?

Morganamilo commented 6 years ago

It's the error makepkg spits out if you have an invalid pkgver: image

Also these packages in community use a ~:

As well as a few packages on the AUR.

mikkeloscar commented 6 years ago

Thanks!