* Russ Allbery: > Samuel Henrique <samuel...@debian.org> writes: > >> I suggest making it more explicit by adding an example to it and >> explicitly writing the precedence of them, I did some tests with dpkg >> --compare-versions to confirm and found out that that is (n being a >> number): >> "~ - n + ." eg.: 1.0~0-1 < 1.0-0-1 < 1.0-1 < 1.0+0-1 < 1.0.0-1 > > Ideally no one should ever use 1.0-0-1, so I'm a little dubious about > including it, but otherwise having examples seems like a good idea. > >> And when symbols are repeated (tilt becomes the outlier): >> "~~ ~ - -- n + ++ . .." eg: 1.0~~0-1 < 1.0~0-1 but 1.0--0-1 > 1.0-0-1 (and >> same for + and .) > > Likewise here, 1.0--0-1 is something no one should use.
But until these versions are explicitly described as invalid, shouldn't the comparison algorithm cover them, so that different implementations behave in the same way? Other corner cases are empty epochs and zero epochs. And while not really being a corner case in the Policy, APT compares ~ and ~0 as equal at the end of a version string: >>> apt_pkg.version_compare('1~', '1~0') 0