Lintian::Relation::Version(3) | Debian Package Checker | Lintian::Relation::Version(3) |
Lintian::Relation::Version - Comparison operators on Debian versions
print "yes\n" if versions_equal('1.0', '1.00'); print "yes\n" if versions_gte('1.1', '1.0'); print "no\n" if versions_lte('1.1', '1.0'); print "yes\n" if versions_gt('1.1', '1.0'); print "no\n" if versions_lt('1.1', '1.1'); print "yes\n" if versions_compare('1.1', '<=', '1.1');
This module provides five functions for comparing version numbers. The underlying implementation uses "libapt-pkg-perl" to ensure that the results match what dpkg will expect.
foreach my $version (sort versions_comparator @versions) { ... }
Originally written by Russ Allbery <rra@debian.org> for Lintian and adapted to use libapt-pkg-perl by Adam D. Barratt <adam@adam-barratt-org.uk>.
2020-11-27 | Lintian v2.104.0 |