Description of problem: repoman uses it's own code to compare version that differs from what is actually used by RPM. Also it is not possible to have single version comparison logic is different in different package manager and thus it is not possible to provide a single solution. This should be made dependent on artifact type and if possible the corresponding library should be used to do comparison instead of own code. > print cmpfullver('1.0-1.el7.centos', '1.0-1.20170103101841.git17e7bc0.el7.centos') -1 while > rpmdev-vercmp 1.0-1.el7.centos 1.0-1.20161229142437.git17e7bc0.el7.centos 1.0-1.el7.centos < 1.0-1.20161229142437.git17e7bc0.el7.centos
Also and addition to the bug found during looking on the source code. As I see RPM_EPOCH is not being handled and compared also. At least hdr[rpm.RPMTAG_EPOCH] is not referenced anywhere.
Just to note to avoid confusion. cmpfullver for some reason uses output values inverted to what regular cmp [1] function will use: > print cmpfullver('0', '1') 1 > print cmpfullver('1', '0') -1 > print cmpfullver('0', '0') 0 while > print cmp('0', '1') -1 > print cmp('1', '0') 1 > print cmp('0', '0') 0 [1] https://docs.python.org/2/library/functions.html#cmp