PMS r174 says: "If at this point the two versions are still equal, the revision number is compared. The revision number has an optional integer suffix as per the previous part. If the revision numbers are equal, so are the two versions." Earlier it says: "Note in particular that \t{1.0} is less than \t{1.0.0}." However it is not clear, if 1.0-r0 == 1.0 or not. Portage implements 1.0-r0 == 1.0 Reproducible: Always Steps to Reproduce: >>> import portage_versions >>> portage_versions.vercmp("1.0","1.0-r0") 0 >>> import pkgcore.ebuild.cpv as cpv >>> cpv.cpy_CPV("foo", "bar", "1.0") == cpv.cpy_CPV("foo", "bar", "1.0-r0") False Actual Results: results differ. Expected Results: same result.
"This may optionally be followed by the suffix -r followed immediately by an integer (the 'revision number'). If this suffix is not present, it is assumed to be -r0." It's entirely clearly specified.
"If this suffix is not present, it is assumed to be \t{-r0}." is in \section{Version Specifications}. Please remove it there and add after "If at this point the two versions are still equal, the revision number is compared. The revision number has an optional integer suffix as per the previous part." in \section{Version Comparison} the following: "If the revision number is not specified it is 0. The versions \t{1.0-r0} and \t{1.0} are equal." This about version comparison, not how one can specify versions. It would also be more consistent with the way it is described for version components. Although \section{Version Specifications} might say that version specifications might end with -r0, but this is not encouraged.
No. Implicit -r0 has meaning everywhere, not just for comparisons. Think PVR and the like.
I am not questioning that it is implied somewhere in the spec. Im just asking you to make it explicit. Its something thats easily overlooked when you implement it. I overlooked that and only found it via unittests. Pkgcore-devs overlooked it. So perhaps it might be helpful to add it to the spec, as it wont grow out of proportion by one helpful sentence. Anyway, Im closing this bug as WORKSFORME because _I_ know how its intended now.