[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sponsor request (perl again)

Devin Carraway wrote:
> This is a small Perl module I had need of during a recent project at
> work, but which wasn't in Debian.
> Essentially it provides the comparison indicating that (e.g.)
> 2.10.1pl1-8 is greater than  Small, simple, perl-only.
> Packages may be had from http://devin.com/debian/.
> Package: libsort-versions-perl
> Architecture: all
> Depends: ${perl:Depends}
> Description: A perl5 module for comparison of revision numbers
>  This module allows easy sorting (via comparisons) of
>  mixed text and numeric strings, such as the complex
>  "version numbers" that many revision control systems,
>  package managers and shared library systems use.

Well we have libapt-pkg-perl which has a version comparison routine.

use AptPkg::Config '$_config';
use AptPkg::System '$_system';
use AptPkg::Version;

$_system = $_config->system;
my $vs = $_system->versioning;

$vs->compare($ver1, $ver2);

Granted it's not small or simple since it uses libapt though.

see shy jo

Reply to: