r57067 - in /trunk/dh-make-perl: Changes TODO debian/changelog debian/control lib/Debian/AptContents.pm lib/Debian/Control/FromCPAN.pm lib/Debian/Dependency.pm lib/Debian/Version.pm lib/DhMakePerl/Command/make.pm lib/DhMakePerl/Utils.pm t/Dependencies.t

dmn at users.alioth.debian.org dmn at users.alioth.debian.org
Wed Apr 28 19:28:05 UTC 2010


Author: dmn
Date: Wed Apr 28 19:27:51 2010
New Revision: 57067

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57067
Log:
drop Debian::Version and use Dpkg::Version instances instead

add (build-)dependency on libdpkg-perl

Removed:
    trunk/dh-make-perl/lib/Debian/Version.pm
Modified:
    trunk/dh-make-perl/Changes
    trunk/dh-make-perl/TODO
    trunk/dh-make-perl/debian/changelog
    trunk/dh-make-perl/debian/control
    trunk/dh-make-perl/lib/Debian/AptContents.pm
    trunk/dh-make-perl/lib/Debian/Control/FromCPAN.pm
    trunk/dh-make-perl/lib/Debian/Dependency.pm
    trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm
    trunk/dh-make-perl/lib/DhMakePerl/Utils.pm
    trunk/dh-make-perl/t/Dependencies.t

Modified: trunk/dh-make-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/Changes?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/Changes (original)
+++ trunk/dh-make-perl/Changes Wed Apr 28 19:27:51 2010
@@ -17,3 +17,6 @@
     FromCPAN: use Debian::DpkgLists as a last resort. This allows finding
         dependencies that are present in locally-installed packages.
         (Debian bug #478781)
+
+    Dependency: the 'ver' member is an instance of Dpkg::Version
+        Use its ability to compare and drop Debian::Version

Modified: trunk/dh-make-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/TODO?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/TODO (original)
+++ trunk/dh-make-perl/TODO Wed Apr 28 19:27:51 2010
@@ -18,4 +18,3 @@
 * #536838: Incorrect assumptions about perl module version -> debian package
   version. Some way of figuring out that libfoo-perl 3.42 contains Bar::Baz
   4.23 is needed. while not common, version discrepacy is very annoying.
-* use Dpkg::Version for version representation/comparison

Modified: trunk/dh-make-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/changelog?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/changelog (original)
+++ trunk/dh-make-perl/debian/changelog Wed Apr 28 19:27:51 2010
@@ -14,6 +14,8 @@
   * a new module, Debian:DpkgLists is used to scan dpkg's file lists as a last
     resort for finding dependencies in locally-installed packages (a-la dpkg
     -S). Closes: #478781
+  * Dependency: drop Debian::Version and use Dpkg::Version instances instead
+    + add (build-)dependency on libdpkg-perl
 
   [ Salvatore Bonaccorso ]
   * fallback to  a dummy short description if none can be extracted

Modified: trunk/dh-make-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/debian/control?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/debian/control (original)
+++ trunk/dh-make-perl/debian/control Wed Apr 28 19:27:51 2010
@@ -7,6 +7,7 @@
  libapt-pkg-perl,
  libarray-unique-perl,
  libclass-accessor-perl,
+ libdpkg-perl,
  libemail-date-format-perl,
  libfile-dircompare-perl,
  libfile-find-rule-perl,
@@ -47,6 +48,7 @@
  libapt-pkg-perl,
  libarray-unique-perl,
  libclass-accessor-perl,
+ libdpkg-perl,
  libemail-date-format-perl,
  liblist-moreutils-perl,
  perl (>= 5.10.1) | libmodule-corelist-perl (>= 2.14),

Modified: trunk/dh-make-perl/lib/Debian/AptContents.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/Debian/AptContents.pm?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/Debian/AptContents.pm (original)
+++ trunk/dh-make-perl/lib/Debian/AptContents.pm Wed Apr 28 19:27:51 2010
@@ -32,7 +32,6 @@
 
 use Config;
 use Debian::Dependency;
-use Debian::Version qw(deb_ver_cmp);
 use DhMakePerl::Utils qw(find_core_perl_dependency);
 use File::Spec::Functions qw( catfile catdir splitpath );
 use IO::Uncompress::Gunzip;
@@ -445,7 +444,7 @@
     if ($core_dep) {
 
         # the core dependency is satosfied by oldstable?
-        if ( deb_ver_cmp( $core_dep->ver, $oldstable_perl ) <= 0 ) {
+        if ( $core_dep->ver <= $oldstable_perl ) {
             # drop the direct dependency and remove the version
             undef($direct_dep);
 
@@ -455,7 +454,7 @@
 
         if ($direct_dep) {
             # both in core and in a package.
-            if( deb_ver_cmp($running_perl, $core_dep->ver) >= 0 ) {
+            if( $running_perl >= $core_dep->ver ) {
                 return Debian::Dependency->new("$core_dep | $direct_dep");
             }
             else {

Modified: trunk/dh-make-perl/lib/Debian/Control/FromCPAN.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/Debian/Control/FromCPAN.pm?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/Debian/Control/FromCPAN.pm (original)
+++ trunk/dh-make-perl/lib/Debian/Control/FromCPAN.pm Wed Apr 28 19:27:51 2010
@@ -19,7 +19,6 @@
 use base 'Debian::Control';
 
 use CPAN ();
-use Debian::Version qw(deb_ver_cmp);
 use DhMakePerl::Utils qw( is_core_module find_cpan_module nice_perl_ver split_version_relation );
 use File::Spec qw( catfile );
 use Module::Depends ();
@@ -387,7 +386,7 @@
     my $unversioned = (
         not $dep->ver
             or $dep->rel =~ />/
-            and deb_ver_cmp( $dep->ver, $self->oldstable_perl_version ) <= 0
+            and $dep->ver <= $self->oldstable_perl_version
     );
 
     # if the dependency is considered unversioned, make sure there is no

Modified: trunk/dh-make-perl/lib/Debian/Dependency.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/Debian/Dependency.pm?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/Debian/Dependency.pm (original)
+++ trunk/dh-make-perl/lib/Debian/Dependency.pm Wed Apr 28 19:27:51 2010
@@ -5,7 +5,7 @@
 
 use AptPkg::Config;
 use Carp;
-use Debian::Version qw(deb_ver_cmp);
+use Dpkg::Version ();
 use List::MoreUtils qw(mesh);
 
 =head1 NAME
@@ -220,7 +220,7 @@
 
     return 0 unless $left->ver; # both have no version
 
-    $res = deb_ver_cmp( $left->ver, $right->ver );
+    $res = $left->ver <=> $right->ver;
 
     return $res if $res != 0;
 
@@ -242,6 +242,9 @@
     if $field eq 'ver'
         and defined($value)
         and $value =~ /^0[0.]*$/;
+
+    $value = Dpkg::Version->new( $value, check => 1 )
+        if $field eq 'ver' and defined($value);
 
     $self->SUPER::set( $field, $value );
 }

Modified: trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Command/make.pm Wed Apr 28 19:27:51 2010
@@ -373,8 +373,9 @@
             my $cur_ver = $deps{$p};
 
             $deps{$p} = $v
-                if defined($v) and not defined($cur_ver)
-                    or deb_ver_cmp( $cur_ver, $v ) < 0;
+                if defined($v)
+                    and ( not defined($cur_ver)
+                        or $cur_ver < $v );
         }
         else {
             $deps{$p} = $v;

Modified: trunk/dh-make-perl/lib/DhMakePerl/Utils.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/lib/DhMakePerl/Utils.pm?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/lib/DhMakePerl/Utils.pm (original)
+++ trunk/dh-make-perl/lib/DhMakePerl/Utils.pm Wed Apr 28 19:27:51 2010
@@ -27,7 +27,6 @@
 
 use Module::CoreList ();
 use Debian::Dependency;
-use Debian::Version qw(deb_ver_cmp);
 
 =head1 FUNCTIONS
 
@@ -165,12 +164,12 @@
 
 our %debian_perl = (
     '5.8'   => {
-        min => '5.8.8',
-        max => '5.8.8',
+        min => Dpkg::Version->new('5.8.8'),
+        max => Dpkg::Version->new('5.8.8'),
     },
     '5.10'  => {
-        min => '5.10.0',
-        max => '5.10.1',
+        min => Dpkg::Version->new('5.10.0'),
+        max => Dpkg::Version->new('5.10.1'),
     },
 );
 
@@ -195,8 +194,8 @@
 
         # we want to avoid depending on things like 5.8.9 which aren't in
         # Debian and can contain stuff newer than in 5.10.0
-        if ( $debian_perl{$major}
-            and deb_ver_cmp( $debian_perl{$major}{max}, $v ) >= 0 )
+        if (    $debian_perl{$major}
+            and $debian_perl{$major}{max} >= $v )
         {
             return Debian::Dependency->new( 'perl', $v );
         }

Modified: trunk/dh-make-perl/t/Dependencies.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/dh-make-perl/t/Dependencies.t?rev=57067&op=diff
==============================================================================
--- trunk/dh-make-perl/t/Dependencies.t (original)
+++ trunk/dh-make-perl/t/Dependencies.t Wed Apr 28 19:27:51 2010
@@ -20,8 +20,36 @@
     bless(
         [
             bless( { pkg=>'perl' }, 'Debian::Dependency' ),
-            bless( { pkg=>'libfoo-perl', rel=>'>=', ver=>'5.7' }, 'Debian::Dependency' ),
-            bless( { pkg=>'bar', rel=>'<=', ver=>'4' }, 'Debian::Dependency' ),
+            bless(
+                {   pkg => 'libfoo-perl',
+                    rel => '>=',
+                    ver => bless(
+                        {   version     => '5.7',
+                            epoch       => 0,
+                            revision    => 0,
+                            no_epoch    => 1,
+                            no_revision => 1
+                        },
+                        'Dpkg::Version'
+                    )
+                },
+                'Debian::Dependency'
+                ),
+            bless(
+                {   pkg => 'bar',
+                    rel => '<=',
+                    ver => bless(
+                        {   version     => '4',
+                            epoch       => 0,
+                            revision    => 0,
+                            no_epoch    => 1,
+                            no_revision => 1
+                        },
+                        'Dpkg::Version'
+                    )
+                },
+                'Debian::Dependency'
+                ),
         ],
         'Debian::Dependencies',
     ),
@@ -32,10 +60,17 @@
 cmp_deeply(
     $sum->[3],
     bless(
-        {
-            pkg=>'libsome-perl',
-            rel=>'>=',
-            ver=>'4.4',
+        {   pkg => 'libsome-perl',
+            rel => '>=',
+            ver => bless(
+                {   version     => '4.4',
+                    epoch       => 0,
+                    revision    => 0,
+                    no_epoch    => 1,
+                    no_revision => 1
+                },
+                'Dpkg::Version'
+            ),
         },
         'Debian::Dependency',
     ),




More information about the Pkg-perl-cvs-commits mailing list