mirror of
git://sourceware.org/git/libabigail.git
synced 2025-01-13 12:51:03 +00:00
95b12167fa
When sorting two packages by their {Name Value Release} triplet to select the latest one, just doing a string comparison of the NVRs is wrong. Take for example the packages foo-0.10-1.fc25 and foo-0.2-1.fc25. A basic string comparison will result in the string "foo-0.10-1.fc25" being less than "foo-0.2-1.fc25", and thus foo-0.2-1.fc25 will be selected as the latest package. And that is wrong, because the latest one is obviously foo-0.10-1.fc25. So, after some research on this, I figured rpm.labelCompare is a better choice to appropriately compare two NVRs. Another reason why I chose rpm.labelCompare is because the latest build in fedabipkgdiff means a build with the latest version.release within a specific Fedora distribution such as fc23 or fc25. * configure.ac: Add new dependency. * tests/runtestfedabipkgdiff.py.in (builds): Add new builds for running tests to test selecting latest build from a package. (packages): Add new package gnutls. (GetPackageLatestBuildTest.{test_get_latest_one, test_cannot_find_a_latest_build_with_invalid_distro}): Use new builds of package gnutls to run tests. * tools/fedabipkgdiff (cmp_nvr): New function used to compare nvrs by Python built-in function sorted. (Brew.listBuilds): Use the new cmp_nvr function. Signed-off-by: Chenxiong Qi <cqi@redhat.com> Signed-off-by: Dodji Seketeli <dodji@redhat.com> |
||
---|---|---|
.. | ||
.gitignore | ||
abiar.cc | ||
abicompat.cc | ||
abidiff.cc | ||
abidw.cc | ||
abilint.cc | ||
abipkgdiff.cc | ||
abisym.cc | ||
binilint.cc | ||
fedabipkgdiff | ||
Makefile.am |