Skip to content

version.py: Fix validation of versions like "6.0_0002" (it's invalid!)

postmarketOS Bot requested to merge fix/1144-version-validation-corner-case into master

Created by: ollieparanoid

pmb.parse.version.validate() said 6.0_0002 was valid, but when asking apk it said it was invalid (because 0002 is not a valid version suffix).

This PR fixes it, and adds test cases for this specific case. We already have a great deal of test cases (all from apk), but these only check if comparing one version with another one works correctly.

@ncopa, @kaniini: From what I know, you're using version.py as well. So this is a heads up. Also since you guys know the apk code base: If you have time, maybe one of you could review this fix.

(Fixes #1144 (closed).)

Merge request reports