Package: cvs-autoreleasedeb
Version: 0.7-1
Severity: important

cvs-autoreleasedeb is using gt to compare versions wich tends to fail on
many cases.
It thinks 1.0-9 is newer than 1.0-10

The attached patch changes it to use libapt-pkg-perl's
AptPkg::Version->compare.


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-nvidia
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages cvs-autoreleasedeb depends on:
ii  cvs                          1:1.12.9-11 Concurrent Versions System
ii  cvs-buildpackage             5.18        A set of Debian package scripts fo
ii  debconf                      1.4.30.11   Debian configuration management sy
ii  dpkg-dev                     1.10.27     Package building tools for Debian
ii  dupload                      2.6.3       utility to upload Debian packages
ii  fakeroot                     1.2.2       Gives a fake root environment
ii  libxml-parser-perl           2.34-4      Perl module for parsing XML files
ii  perl                         5.8.4-6     Larry Wall's Practical Extraction 

-- no debconf information
diff -urN ../cvs-autoreleasedeb.orig/cvs-autoreleasedeb ./cvs-autoreleasedeb
--- ../cvs-autoreleasedeb.orig/cvs-autoreleasedeb       2005-03-15 
11:32:07.696896458 -0300
+++ ./cvs-autoreleasedeb        2005-03-15 11:39:41.446111304 -0300
@@ -1,5 +1,12 @@
 #!/usr/bin/perl
 
+use AptPkg::Config '$_config';
+use AptPkg::System '$_system';
+use AptPkg::Version;
+
+$_config->init;
+$_system = $_config->system;
+my $vs = $_system->versioning;
 use strict;
 
 =head1 NAME
@@ -404,7 +411,7 @@
        foreach my $s (keys %{$conf_struct}) {
                next if ref $conf_struct->{$s} ne "HASH";
                foreach my $p (keys %{$conf_struct->{$s}}) {
-                       if ($newstate_struct->{$s}{$p} gt 
$state_struct->{$s}{$p}) {
+                       if ($vs->compare($newstate_struct->{$s}{$p}, 
$state_struct->{$s}{$p})) {
                                # Use the date of the commit here.
                                $newpacks_struct->{$s}{$p} = scalar(localtime);
                        }
diff -urN ../cvs-autoreleasedeb.orig/debian/control ./debian/control
--- ../cvs-autoreleasedeb.orig/debian/control   2005-03-15 11:32:07.697896195 
-0300
+++ ./debian/control    2005-03-15 11:41:05.266974793 -0300
@@ -2,12 +2,12 @@
 Section: devel
 Priority: optional
 Maintainer: Daniel Ruoso <[EMAIL PROTECTED]>
-Build-Depends-Indep: debhelper (>> 3.0.0), perl
+Build-Depends-Indep: debhelper (>> 3.0.0), perl, libapt-pkg-perl
 Standards-Version: 3.6.1.0
 
 Package: cvs-autoreleasedeb
 Architecture: all
-Depends: dpkg-dev, fakeroot, cvs, ${perl:Depends}, libxml-parser-perl, 
dupload, cvs-buildpackage
+Depends: dpkg-dev, fakeroot, cvs, ${perl:Depends}, libxml-parser-perl, 
dupload, cvs-buildpackage, libapt-pkg-perl
 Pre-Depends: debconf
 Description: Automatically release/upload debian packages from CVS
  This package provides the capability of automatically publish a
diff -urN ../cvs-autoreleasedeb.orig/pkg-version.diff ./pkg-version.diff
--- ../cvs-autoreleasedeb.orig/pkg-version.diff 1969-12-31 21:00:00.000000000 
-0300
+++ ./pkg-version.diff  2005-03-15 11:41:36.961063640 -0300
@@ -0,0 +1,43 @@
+diff -urN ../cvs-autoreleasedeb.orig/cvs-autoreleasedeb ./cvs-autoreleasedeb
+--- ../cvs-autoreleasedeb.orig/cvs-autoreleasedeb      2005-03-15 
11:32:07.696896458 -0300
++++ ./cvs-autoreleasedeb       2005-03-15 11:39:41.446111304 -0300
+@@ -1,5 +1,12 @@
+ #!/usr/bin/perl
+ 
++use AptPkg::Config '$_config';
++use AptPkg::System '$_system';
++use AptPkg::Version;
++
++$_config->init;
++$_system = $_config->system;
++my $vs = $_system->versioning;
+ use strict;
+ 
+ =head1 NAME
+@@ -404,7 +411,7 @@
+       foreach my $s (keys %{$conf_struct}) {
+               next if ref $conf_struct->{$s} ne "HASH";
+               foreach my $p (keys %{$conf_struct->{$s}}) {
+-                      if ($newstate_struct->{$s}{$p} gt 
$state_struct->{$s}{$p}) {
++                      if ($vs->compare($newstate_struct->{$s}{$p}, 
$state_struct->{$s}{$p})) {
+                               # Use the date of the commit here.
+                               $newpacks_struct->{$s}{$p} = scalar(localtime);
+                       }
+diff -urN ../cvs-autoreleasedeb.orig/debian/control ./debian/control
+--- ../cvs-autoreleasedeb.orig/debian/control  2005-03-15 11:32:07.697896195 
-0300
++++ ./debian/control   2005-03-15 11:41:05.266974793 -0300
+@@ -2,12 +2,12 @@
+ Section: devel
+ Priority: optional
+ Maintainer: Daniel Ruoso <[EMAIL PROTECTED]>
+-Build-Depends-Indep: debhelper (>> 3.0.0), perl
++Build-Depends-Indep: debhelper (>> 3.0.0), perl, libapt-pkg-perl
+ Standards-Version: 3.6.1.0
+ 
+ Package: cvs-autoreleasedeb
+ Architecture: all
+-Depends: dpkg-dev, fakeroot, cvs, ${perl:Depends}, libxml-parser-perl, 
dupload, cvs-buildpackage
++Depends: dpkg-dev, fakeroot, cvs, ${perl:Depends}, libxml-parser-perl, 
dupload, cvs-buildpackage, libapt-pkg-perl
+ Pre-Depends: debconf
+ Description: Automatically release/upload debian packages from CVS
+  This package provides the capability of automatically publish a

Reply via email to