Hi, Here are two patches that fix little issues that I've come across in the past couple of days while running dh-make-perl on a couple of CPAN modules. I could commit the fixes straight away, but since those both touch somewhat, ehm, *important* parts of dh-make-perl (they are both related to determining the versions to put in the control file for a new module), I thought I'd ask for review before just breaking dh-make-perl for everyone :) I've tested it with several CPAN modules, but there's always the chance that possible bugs will only appear with others. The first change: do not put "libfoo-perl (>= 0.000-1)" for modules that actually *do* have a dependency on version 0.000 in their META.yml / Makefile.PL / whatever file! :) For an example of this behavior, try dh-make-perl --cpan Software::License --pkg-perl ...and look at Build-Depends-Indep. The second change: when pruning the dependencies aggregated from distinct sources, fix the replacement of an older version with a newer one. This shows up in the somewhat rare case when there are two different ways a package depends on another one, and the two dependencies specify different versions - a rare case, but exactly the one that prune() was meant to handle :) For an example of this behavior, look at the Test::Kwalitee CPAN module which has a "require 5.6.2" directive; Debian::Dependencies->prune() then has to update a 5.6.0-12 dependency to 5.6.2 and comes up with a bare "Build-Depends-Indep: 5.6.2" in the control file. Try it: dh-make-perl --cpan Test::Kwalitee --pkg-perl ...and look at Build-Depends-Indep. Both patches are below. If nobody objects, I will commit them in a day or three. Thanks for reading this far ;) G'luck, Peter diff -urN -urN -x tags -x .svn ./lib/Debian/Dependency.pm /fs/linux/home/roam/deb/pkg-perl/pkg-perl/trunk/dh-make-perl/lib/Debian/Dependency.pm --- ./lib/Debian/Dependency.pm 2009-04-25 01:47:28.000000000 +0300 +++ /fs/linux/home/roam/deb/pkg-perl/pkg-perl/trunk/dh-make-perl/lib/Debian/Dependency.pm 2009-04-24 18:44:52.000000000 +0300 @@ -84,7 +84,7 @@ my $self = shift; return ( - $self->ver + $self->ver && $self->ver !~ /^0+(\.0+)?$/ ? $self->pkg . ' (' . $self->rel . ' ' . $self->ver . ')' : $self->pkg ); diff -urN -urN -x tags -x .svn ./lib/Debian/Dependencies.pm /fs/linux/home/roam/deb/pkg-perl/pkg-perl/trunk/dh-make-perl/lib/Debian/Dependencies.pm --- ./lib/Debian/Dependencies.pm 2009-04-25 01:47:28.000000000 +0300 +++ /fs/linux/home/roam/deb/pkg-perl/pkg-perl/trunk/dh-make-perl/lib/Debian/Dependencies.pm 2009-04-24 19:09:33.000000000 +0300 @@ -124,7 +124,7 @@ if ( exists $deps{$p} ) { my $cur_ver = $deps{$p}->ver; - $deps{$p} = $v + $deps{$p} = Debian::Dependency->new($p, $v) if defined($v) and not defined($cur_ver) or $AptPkg::Config::_config->system->versioning->compare( $cur_ver, $v ) < 0; -- Peter Pentchev roam@ringlet.net roam@space.bg roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This sentence would be seven words long if it were six words shorter.
Attachment:
pgprrnt5yvaTG.pgp
Description: PGP signature