From 24430528aa6f3f511e3a90294fbf75c091f4ee8c Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 29 Nov 2007 05:16:27 +0200 Subject: [PATCH] dpkg-scanpackages: Use Dpkg::Versions instead of dpkg --compare-versions --- ChangeLog | 5 +++++ debian/changelog | 1 + scripts/dpkg-scanpackages.pl | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80e97c90..43bb78a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-29 Guillem Jover + + * scripts/dpkg-scanpackages.pl: Use Dpkg::Version. + (vercmp): Use compare_versions instead of 'dpkg --compare-versions'. + 2007-11-29 Guillem Jover * scripts/dpkg-scanpackages.pl: Use Dpkg::ErrorHandling. Use error diff --git a/debian/changelog b/debian/changelog index d940a2b7..458869a0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,7 @@ dpkg (1.14.12) UNRELEASED; urgency=low * Move extern declarations to header files and stop defining them as extern. * Unify parsing of Section and Priority in dpkg-gencontrol with Homepage. * Change dpkg-scanpackages to use the Dpkg::ErrorHandling module. + * Change dpkg-scanpackages to use the Dpkg::Versions module. -- Guillem Jover Sat, 24 Nov 2007 07:38:13 +0200 diff --git a/scripts/dpkg-scanpackages.pl b/scripts/dpkg-scanpackages.pl index 7cd52f57..9211e030 100755 --- a/scripts/dpkg-scanpackages.pl +++ b/scripts/dpkg-scanpackages.pl @@ -9,6 +9,7 @@ use Dpkg; use Dpkg::Gettext; use Dpkg::ErrorHandling qw(error syserr subprocerr); use Dpkg::Deps qw(@pkg_dep_fields); +use Dpkg::Version qw(compare_versions); textdomain("dpkg-dev"); @@ -144,9 +145,8 @@ my %vercache; sub vercmp { my ($a,$b)=@_; return $vercache{$a}{$b} if exists $vercache{$a}{$b}; - system('dpkg','--compare-versions',$a,'le',$b); - $vercache{$a}{$b}=$?; - return $?; + $vercache{$a}{$b} = compare_versions($a, 'gt', $b); + return $vercache{$a}{$b}; } my $find_h = new IO::Handle; -- 2.39.5