parse: allow "-r" in pkgver
this seems to be parsed correctly, other than this one check bug: https://gitlab.com/postmarketOS/pmbootstrap/-/issues/2260 Reviewed-by: Oliver Smith <ollieparanoid@postmarketos.org> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230813202045.24493-1-lauren@selfisekai.rocks%3E
This commit is contained in:
parent
9045bfb2b9
commit
753e563ccc
|
@ -320,8 +320,7 @@ def apkbuild(path, check_pkgver=True, check_pkgname=True):
|
|||
|
||||
# Sanity check: pkgver
|
||||
if check_pkgver:
|
||||
if ("-r" in ret["pkgver"] or not
|
||||
pmb.parse.version.validate(ret["pkgver"])):
|
||||
if not pmb.parse.version.validate(ret["pkgver"]):
|
||||
logging.info(
|
||||
"NOTE: Valid pkgvers are described here: "
|
||||
"https://wiki.alpinelinux.org/wiki/APKBUILD_Reference#pkgver")
|
||||
|
|
|
@ -154,3 +154,10 @@ def test_parse_unmaintained():
|
|||
path = (f"{pmb_test.const.testdata}/apkbuild"
|
||||
"/APKBUILD.missing-pkgdesc-in-subpackage")
|
||||
assert pmb.parse._apkbuild.unmaintained(path) == "This is broken!"
|
||||
|
||||
|
||||
def test_weird_pkgver():
|
||||
path = (f"{pmb_test.const.testdata}/apkbuild"
|
||||
"/APKBUILD.weird-pkgver")
|
||||
apkbuild = pmb.parse.apkbuild(path, check_pkgname=False, check_pkgver=True)
|
||||
assert apkbuild["pkgver"] == "3.0.0_alpha369-r0"
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
pkgname=dart-stage0
|
||||
pkgver=3.0.0_alpha369-r0
|
||||
pkgrel=1
|
||||
pkgdesc="Dart is a client-optimized language for fast apps on any platform (temporary bootstrap package)"
|
||||
url="https://dart.dev/"
|
||||
arch="aarch64 armv7 x86_64"
|
||||
license="BSD-3-Clause"
|
||||
options="!check"
|
Loading…
Reference in New Issue